Saturday, May 2, 2020

Re: How to refer to another translation in a translation?

I don't get why you are talking about this.

I understand the words may change order in another language, but I'm not talking about ordering.


<h1>{% trans 'color' %}</h1>
<p>{% trans 'color has various emotional effects.' %}</p>
<p>{% trans 'Red color makes people feel angry.' %}</p>
<p>{% trans 'Blue color makes people feel said.' %}</p>

Now I translate this America English to British English.


msgid "color"
msgstr "colour"

Since I already translated color to colour, I want to refer this translation in other translations.

msgid "color has various emotional effects."
msgstr "{{ refer to the translated text of color }} has various emotional effects."

msgid "Red color makes people feel angry."
msgstr "Red {{ refer to the translated text of color }}  makes people feel angry."

In this msgstr, is it possible to refer to the string colour?

In this way, in case later my boss says color should be translated to tint in en-UK, I only need to change one place.



在 2020年5月2日星期六 UTC-7上午11:44:41,Andréas Kühne写道:
Hi,

Your idea isn't that good. The problem is the following:

_("My name is {name}").format(name='Andréas')

This is a translation in a python context. So say that that translation gets translated into another language, where the name should come first:

msgid "My name is {name}"
msgstr "{name} other translated text"

You never know what order the translations will be coming in, in various languages. So you should actually AVOID DRY in translations.... The more you can pinpoint a translatable string the better.

Also - the .po files that are used for translation are a format that is specified OUTSIDE of python and django anyway :)

Regards,

Andréas


Den lör 2 maj 2020 kl 00:39 skrev gqq nbig <gqqn...@gmail.com>:
msgid "Tree free"
msgstr "aa"

msgid
"True free is good"
msgstr "aa is good"

This po file has a key "Tree free", which I translated to "aa". There is another key "True free is good", which should be translated to "aa is good." 

Considering the Don't Repeat Yourself rule, can I refer the translation of "Tree free" in "True free is good".

I'm looking for a syntax or sort of things that is like 


msgid "True free is good"
msgstr "{% trans 'Tree free' %} is good"



Can I refer to another translation in a translation? I'm fine with extending an internal class, how should I do it?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a5a0b03a-eb4c-4699-ac69-5c1db9320805%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4732ad74-0266-4c0c-b938-33ea40c15627%40googlegroups.com.

No comments:

Post a Comment