django – how to make translation work?
Just add the paths of the locale files generated to the settings.py file like the following LOCALE_PATHS = ( “/xxx/xxx/Projects/xxx/sites/avb/locale/”,)
Just add the paths of the locale files generated to the settings.py file like the following LOCALE_PATHS = ( “/xxx/xxx/Projects/xxx/sites/avb/locale/”,)
Solution 2 is what you want. Send them the whole sentence, with the HTML markup embedded. Reasons: The predominant translation tool, Trados, can preserve the markup from inadvertent corruption by a translator. Trados can also auto-translate text that it has seen before, even if the content of the tags have changed (but the number of … Read more
Functions of particular interest are django.utils.translation.get_language() which returns the language used in the current thread. See documentation.
Call: I18n.t instead of simple t. t is a helper method only available in the views, delegating the whole logic to I18n module. UPDATE: As mentioned in the comments, view helper is not only delegating to the I18n module, it makes sure that you can use a default scopes as well.
This question is old at this point, but I think the answer is in need of an update. ngx-translate has been largely abandoned. The author of ngx-translate, ocombe, is hard at work at Google to improve the built in Angular method. He transitioned ngx-translate to maintenance only. As of this date (May 2021), he has … Read more
You were going on right track, what you missed is just to pass someVariable as a parameter to trans() in your Twig file as: <h2>{{ “follow.us.in.twitter”|trans({‘%someVariable%’: someVariable}, “workend”) }}</h2> Now your message in Yml file should be as: follow.us.in.twitter: Hola, Follow %someVariable% en Twitter This should work. For more details and clarity you can refer … Read more
You can use the blocktrans template tag in this case: {% blocktrans %} This is the title: {{ myvar }} {% endblocktrans %}
A nice way to disable MissingTranslations check is to add the option in module specific build.gradle file . android { lintOptions{ disable ‘MissingTranslation’ } //other build tags } If the strings are not present in locale specific Strings file, it will take the strings from the default file which generally is strings.xml.
Here are some good alternatives to Poedit: Translation editors Lokalize: for KDE users (KBabel is now obsolete). GTranslator: for GNOME users. GTeddead link: runs everywhere Eclipse runs. Virtaal: Windows, Linux, Mac. Good choice for GNOME users. Text editor Vim: you can use the Vim script for po files Editing Emacs: you can use po mode … Read more
Other than using raw, there’s an other undocumented (but official) way to do so. All keys ending with _html are automatically rendered unescaped. Rename the key from teasers: welcome: “<strong>Welcome</strong> to the Website …” to teasers: welcome_html: “<strong>Welcome</strong> to the Website …”