You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the--placeholder-format option printf is converting universal placeholders to use with positional interpolation. This is not the best for translations, as positions of variables can differ in different languages.
i.e. "Login and follow @[%1$s:name] to see all [%1$s:count] messages" --> "Login and follow @%1$s to see all %1$s messages"
This technique lets language-specific translations reorder the placeholder text. For example, an English translation may be "Today is November 26.", while a Spanish translation may be "Hoy es 26 de noviembre." – with the month and the day placeholders swapped.
For this reason, you should use named-string interpolation (e.g., %(day)s) instead of positional interpolation (e.g., %s or %d) whenever you have more than a single parameter. If you used positional interpolation, translations wouldn’t be able to reorder placeholder text.
Is it possible to add an placeholder format that respects the name of the universal placeholder?
The text was updated successfully, but these errors were encountered:
Currently the
--placeholder-format
optionprintf
is converting universal placeholders to use with positional interpolation. This is not the best for translations, as positions of variables can differ in different languages.i.e. "Login and follow @[%1$s:name] to see all [%1$s:count] messages" --> "Login and follow @%1$s to see all %1$s messages"
As Django's documentation says:
Is it possible to add an placeholder format that respects the name of the universal placeholder?
The text was updated successfully, but these errors were encountered: