Saturday, May 2, 2020

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

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 <gqqnb2005@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-users+unsubscribe@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/CAK4qSCea_xax6DnhBOcss85SrT1FwAaPOoVbo1SPbtpnwYm5pQ%40mail.gmail.com.

No comments:

Post a Comment