[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] How to set the string lenght in the translation?
From: |
Bruno Haible |
Subject: |
Re: [bug-gettext] How to set the string lenght in the translation? |
Date: |
Mon, 26 Mar 2018 13:33:53 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-116-generic; KDE/5.18.0; x86_64; ; ) |
Hi,
Miguel de Dios Matias wrote:
> I am helping in the free software project Cataclysm DDA (
> https://github.com/CleverRaven/Cataclysm-DDA) in the spanish translation.
> And another developer says me that some strings in spanish are "overflow"
> the GUI.
Indeed, on average translated strings are longer than English strings;
often 30% longer, sometimes even 50% longer.
> Well, we are working the translations in Transifex (it is not the best
> choice because it is not free software but it is ok) and I can see there is
> a field with the name "character limit". But I don't know how to set this
> limit in the C code or in the PO files.
Indeed, the XLIFF format for example has the ability to specify a size limit
[1].
However, in the GNU project, we recommend instead to write the program
in such a way that it can accommodate translations of any size. In the GUI
examples
gettext-tools/examples/hello-c-*/hello.c
gettext-tools/examples/hello-c++-*/hello.cc
you will see that a significant part of the program code is devoted to
computing the bounding boxes and sizes of container boxes in an appropriate
way (bottom-up, not top-down).
If you really can't follow this advice, you can ask the translators to
limit the size of the translation, through a translator comment [2].
But you can't force the translator.
Bruno
[1] http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#size-unit
[2]
https://www.gnu.org/software/gettext/manual/html_node/Bug-Report-Address.html