Same string with different translation

You can use gettext’s context for that. Django has added support for that in 1.3 release (in code) and 1.4 (for templates), see https://docs.djangoproject.com/en/dev/topics/i18n/translation/#contextual-markers Update: For example following code: from django.utils.translation import pgettext, ugettext month = pgettext(“month name”, “May”) month = pgettext(“fifth month”, “May”) month = ugettext(“May”) Translates to: #: foo/views.py:4 msgctxt “month name” msgid … Read more

put new line in string to translate

You can use \n but you will have to provide some styling. So in your template use this: <div class=”my-translated-paragraph”> {{‘STRING_TO_TRANSLATE’ | translate}} </div> Your en.json: { “STRING_TO_TRANSLATE”: “text on first line.\nText on second line” } Your (s)CSS file: .my-translated-paragraph{ white-space: pre-wrap; } More info an the magic behind white-space: https://stackoverflow.com/a/42354356/3757110 See also a github … Read more

Non-English texts in Stripe possible?

For further reference: While you can’t use human messages on stripe errors to be displayed directly on localized pages, you can take advantage of response.error.code to provide your own translations. var errorMessages = { incorrect_number: “The card number is incorrect.”, invalid_number: “The card number is not a valid credit card number.”, invalid_expiry_month: “The card’s expiration … Read more

How do you handle translation of text with markup?

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)