Including the final : with strings
There is a bug and associated code review open for Horizon regarding how to handle the trailing ":" on some messages: The Bug: https://bugs.launchpad.net/horizon/+bug/1296075 The Code Review: https://review.openstack.org/#/c/84342/ The bug and existing code advocate removing the final ":" from strings that have it for consistency. While I understand the need for consistency, I just got a request from a French translator to do the opposite implementation. The translator for French shared with me that including the punctuation as part of the translatable material makes it much easier to create a correct translation. In French, a space is expected between the final word and the final punctuation, including a colon. When the translators are looking at "Image Details:", its much easier from them to recognize where the space should go so they can create "Détails de l'image :". Without the colon as part of the message its hard to know if they should add a trailing space or not. What's the feeling from the i18n community about how we should treat the final punctuation on our strings? Doug Fish
On Wed, Apr 30, 2014 at 12:25 AM, Douglas Fish <drfish@us.ibm.com> wrote:
There is a bug and associated code review open for Horizon regarding how to handle the trailing ":" on some messages:
[...]
What's the feeling from the i18n community about how we should treat the final punctuation on our strings?
Well, I always advocated removing them, just like unnecessary HTML markup (like strings enclosed in <b></b>). It only creates duplicate strings which differ only with a single character, thus it can happen that a string on the same page has two different translations (for example when the string with the ":" was added later than the first string). But that's just my opinion (as it's also my bug ;) so we can change it for Juno if the consensus is to keep the punctuation... Regards, -- Łukasz [DeeJay1] Jernaś
On 29/04/14 23:25, Douglas Fish wrote:
There is a bug and associated code review open for Horizon regarding how to handle the trailing ":" on some messages:
The Bug: https://bugs.launchpad.net/horizon/+bug/1296075 The Code Review: https://review.openstack.org/#/c/84342/
The bug and existing code advocate removing the final ":" from strings that have it for consistency. While I understand the need for consistency, I just got a request from a French translator to do the opposite implementation. The translator for French shared with me that including the punctuation as part of the translatable material makes it much easier to create a correct translation. In French, a space is expected between the final word and the final punctuation, including a colon. When the translators are looking at "Image Details:", its much easier from them to recognize where the space should go so they can create "Détails de l'image :". Without the colon as part of the message its hard to know if they should add a trailing space or not.
What's the feeling from the i18n community about how we should treat the final punctuation on our strings?
With a disclaimer that I am not a translator, it seems to me if removing the punctuation prevents a language team from creating high quality translations, we should not remove it. Looking around the web for software localisation and colons, this seems to be a known pitfall especially when it comes to French, and the usual recommendation is to keep the punctuation in. (The bug also mentions trailing whitespace in strings - that sounds to me like it should be removed with no issues!) Thanks, Julie
Doug Fish
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
Hi all, Couldn't we solve this issue using contextual markers [1]? That way we wouldn't need to duplicate strings and we provide the translators with enough context for their translations. Cheers, [1] http://lists.openstack.org/pipermail/openstack-i18n/2014-April/000528.html
On 30/04/14 13:52, Victoria Martínez de la Cruz wrote:
Hi all,
Couldn't we solve this issue using contextual markers [1]? That way we wouldn't need to duplicate strings and we provide the translators with enough context for their translations.
Hello Victoria! I'm not sure if that would help to resolve the problem, if I understand correctly there would still be different translations for each different contextual marker anyway. Julie
Cheers,
[1] http://lists.openstack.org/pipermail/openstack-i18n/2014-April/000528.html
_______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
Thinking about the user of contextual markers a bit: If the same string exists with two different contextual markers its going to get put into the PO file twice. Once with each unique contextual marker. Contextual markers won't reduce the amount of stuff that needs to be translated. Doug Fish From: Victoria Martínez de la Cruz <victoria@vmartinezdelacruz.com> To: "openstack-i18n@lists.openstack.org" <Openstack-i18n@lists.openstack.org>, Date: 04/30/2014 07:53 AM Subject: Re: [Openstack-i18n] Including the final : with strings Hi all, Couldn't we solve this issue using contextual markers [1]? That way we wouldn't need to duplicate strings and we provide the translators with enough context for their translations. Cheers, [1] http://lists.openstack.org/pipermail/openstack-i18n/2014-April/000528.html _______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
Le 30/04/2014 22:15, Douglas Fish a écrit :
Thinking about the user of contextual markers a bit: If the same string exists with two different contextual markers its going to get put into the PO file twice. Once with each unique contextual marker. Contextual markers won't reduce the amount of stuff that needs to be translated.
Here is a quick way to check if a translation exists without contextual markers: (.venv)yves@paradox ~/openstack/horizon $ python manage.py shell Python 2.7.4 (default, Sep 26 2013, 03:20:26) Type "copyright", "credits" or "license" for more information. IPython 2.0.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: from django.utils.translation import activate, gettext In [2]: activate('fr') In [3]: print gettext('Start') Démarrer (the same can be done with "from django.utils.translation import pgettxt") and use pgettext(context_message, string) to check if a translation exists "with 'context_message'") As you see, in the example above the string is already translated without a context, so we should not add a context to it if we want to keep the existing translation, "unless" it will be used in another context (i.e.: here this word is used to "Start" an instance, but if you use it in a sentence like "Please choose a network to be configured at Start", "Start" in French would be "démarrage" and if it where introduced as a variable in the sentence the existing translation would fail. (Even the word "Démarrer" is wrong "inside" a sentence where it should be "démarrer" (capital letter only at the beginning of a sentence or for Nouns, and "Démarrer" is a verb not a Noun. Even worse: each language has it's own rules when it comes to Nouns, Verbs, etc... so I admit that for the coder it's a situation where he/she can pull his/her hair off to know if a contextual marker is required or not. So as long as a word has no contextual marker and is already translated and also used always in the same context, indeed, it does not need a contextual marker if we do not want to duplicate it in the PO file. But... e.g. in French (and even more in other languages), "Start" can be "Démarrer", "Démarrage", "Début" depending on the context. This context is guessable by the translator if the word is in a full sentence, but in sentences using the word alone as a variable there is no way the translator can guess the context when he sees the word alone. Also, a word alone can generally not be added to an existing string, because for many languages, a word which starts with a capital letter inside a sentence is just wrong if the word is not a Noun. Only a contextual marker allows the translator to know where it is placed. So indeed, you are right saying that adding contextual markers can lead to adding an already existing string. If this string is long or always used in the same context, then the contextual marker is not necessary. However if it's a short word used as a variable inside a string, in many languages without a context it will work in "one" place in the whole code and fail in all the others. If it's a short word not used as a variable in another sentence, and already translated, then we will not add the contextual marker to be able to reuse the existing translation. The difficulty I admit it is to know if a string is already used in the same context with or without a contextual marker. This leads to searching for the string to reuse the same contextual marker if it exists, or to check if it will be used in the same context if it is translated without a contextual marker... I admit it can give some head-aches :-) -- Yves-Gwenaël Bourhis
Thinking about the user of contextual markers a bit: If the same string exists with two different contextual markers its going to get put into
Am I correct in understanding that single words are the biggest candidates for using contextual marking? In exchanges with a French translator I've heard that the word "None" is often problematic when it's a standalone word. If I understood and recall correctly "None" might be masculine or feminine depending on the context its used, so for a high quality translation, a different word should be used. Taking a look at our translation https://github.com/openstack/horizon/blob/master/openstack_dashboard/locale/... it looks like there are 30 or 35 instances of the words "None" in Dashboard over 8 or 9 screens. Are you envisioning that the developers put in 30 or 35 different contextual markers so that the translators can choose which translation to use for each word? or maybe 8 or 9 markers is the right granularity? or maybe there is another way the markers should be used? Doug Fish From: Yves-Gwenaël Bourhis <yves-gwenael.bourhis@cloudwatt.com> To: openstack-i18n@lists.openstack.org, Date: 05/02/2014 04:15 AM Subject: Re: [Openstack-i18n] Including the final : with strings Le 30/04/2014 22:15, Douglas Fish a écrit : the
PO file twice. Once with each unique contextual marker. Contextual markers won't reduce the amount of stuff that needs to be translated.
Here is a quick way to check if a translation exists without contextual markers: (.venv)yves@paradox ~/openstack/horizon $ python manage.py shell Python 2.7.4 (default, Sep 26 2013, 03:20:26) Type "copyright", "credits" or "license" for more information. IPython 2.0.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: from django.utils.translation import activate, gettext In [2]: activate('fr') In [3]: print gettext('Start') Démarrer (the same can be done with "from django.utils.translation import pgettxt") and use pgettext(context_message, string) to check if a translation exists "with 'context_message'") As you see, in the example above the string is already translated without a context, so we should not add a context to it if we want to keep the existing translation, "unless" it will be used in another context (i.e.: here this word is used to "Start" an instance, but if you use it in a sentence like "Please choose a network to be configured at Start", "Start" in French would be "démarrage" and if it where introduced as a variable in the sentence the existing translation would fail. (Even the word "Démarrer" is wrong "inside" a sentence where it should be "démarrer" (capital letter only at the beginning of a sentence or for Nouns, and "Démarrer" is a verb not a Noun. Even worse: each language has it's own rules when it comes to Nouns, Verbs, etc... so I admit that for the coder it's a situation where he/she can pull his/her hair off to know if a contextual marker is required or not. So as long as a word has no contextual marker and is already translated and also used always in the same context, indeed, it does not need a contextual marker if we do not want to duplicate it in the PO file. But... e.g. in French (and even more in other languages), "Start" can be "Démarrer", "Démarrage", "Début" depending on the context. This context is guessable by the translator if the word is in a full sentence, but in sentences using the word alone as a variable there is no way the translator can guess the context when he sees the word alone. Also, a word alone can generally not be added to an existing string, because for many languages, a word which starts with a capital letter inside a sentence is just wrong if the word is not a Noun. Only a contextual marker allows the translator to know where it is placed. So indeed, you are right saying that adding contextual markers can lead to adding an already existing string. If this string is long or always used in the same context, then the contextual marker is not necessary. However if it's a short word used as a variable inside a string, in many languages without a context it will work in "one" place in the whole code and fail in all the others. If it's a short word not used as a variable in another sentence, and already translated, then we will not add the contextual marker to be able to reuse the existing translation. The difficulty I admit it is to know if a string is already used in the same context with or without a contextual marker. This leads to searching for the string to reuse the same contextual marker if it exists, or to check if it will be used in the same context if it is translated without a contextual marker... I admit it can give some head-aches :-) -- Yves-Gwenaël Bourhis _______________________________________________ Openstack-i18n mailing list Openstack-i18n@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
Le 02/05/2014 16:05, Douglas Fish a écrit :
Am I correct in understanding that single words are the biggest candidates for using contextual marking?
Exactly.
In exchanges with a French translator I've heard that the word "None" is often problematic when it's a standalone word. If I understood and recall correctly "None" might be masculine or feminine depending on the context its used, so for a high quality translation, a different word should be used.
Indeed, in French 'None' can be "Aucun", "Aucune" or "Rien", depending on the context, but there is also a plural form for 'None': 'Aucuns', 'Aucunes', 'Riens'. The word 'None' alone is totally impossible to get right. This is not limited to French, German has the same issues and even more often than French for other short words, where 'None' is 'Kein', 'Keine', 'Keinen', 'Keinem', 'Keiner' depending on the context. French has only masculine and Feminine, but e.g. German and Romanian have Masculine, Feminine and Neutral. German has accusative and nominative forms also... You must even consider English as an exception language for not having different words or spellings for the gender or form, because the majority of languages make a difference. So the gender can not be the context. The context is the sentence where the word takes place.
Taking a look at our translation https://github.com/openstack/horizon/blob/master/openstack_dashboard/locale/... it looks like there are 30 or 35 instances of the words "None" in Dashboard over 8 or 9 screens.
Are you envisioning that the developers put in 30 or 35 different contextual markers so that the translators can choose which translation to use for each word? or maybe 8 or 9 markers is the right granularity? or maybe there is another way the markers should be used?
It's impossible to say if the word is masculine/feminine in the context, because in can be masculine in French, Feminine in German, etc... and vice-versa... (and extra genders in other languages). So either the context is an example of the sentence where the word takes place, either developers should as much as possible avoid using single words and should use a full string instead. Even though the word "None" is used in 30 or 35 different places, I seriously doubt it would require as many contexts, It's often used in the same kind of sentence and these kind of sentences should be the context. The best I think would be to use a context chart so that we use the same contexts and avoid to many markers. So Single words should be used in the same limited amount of contexts, and we should use full sentences (which are the easiest to translate without a context string) as much as possible. -- Yves-Gwenaël Bourhis
participants (5)
-
Douglas Fish
-
Julie Pichon
-
Victoria Martínez de la Cruz
-
Yves-Gwenaël Bourhis
-
Łukasz Jernaś