Usage of typographic quotes

I just encountered a problem in the german translations (fixes applied on transifex already) where python quotes (’) where replaced by typographic quotes in date format strings. This lead to sudden errros
(wrong format u’g’) in upcoming events , the format expected quoted python strings. So be sure to check the context before using typographical quotes.


1 Like

Sorry, I am not sure to understand though. Can you give an example?

#: indico/util/
 msgid "tomorrow"
-msgstr "morgen"
+msgstr "'morgen'"
 #: indico/util/
 msgid "'Yesterday'"
-msgstr "‚Gestern‘"
+msgstr "'Gestern'"
 #: indico/util/
 msgid "'Today'"
-msgstr "‚Heute‘"
+msgstr "'Heute'"
 #: indico/util/
 msgid "'Tomorrow'"
-msgstr "'‚Morgen‘'"
+msgstr "'Morgen'"

These are used inside a babel format time.

The first one with no quotes in the msgid should not get quotes. if you look at the code, that one is not used in a format string.

But yes, if you see single quotes that are used in any way that doesn’t look “normal” (inside a sentence, as an apostrophe, etc), there’s a good chance they have significance and thus should not be changed. That said, for the relative cases we could just omit the quotes from the translatable string, but e.g. for 'last_week': _(u"'Last' EEEE"), we can’t really do it, since the EEEE placeholder may not come after the “Last” in all languages…

I confirm, “Last Monday” would be come “Lundi dernier” in French (not talking about capitalising here).
And the pitfall with the “quotes”/„Anführungszeichen” (which are not apostrophs (aka “neutral quotes”) BTW, but left-right distinctive quotes) will be present in all languages, which do not follow the simplifying english/ASCII schema, e.g.「鉤括弧」.

Given that this is exceptional and highly contextual, would it be a solution to use clearly symbolic names (like ONE_WEEK_AGO) in the source code and add the english translation in the english (default, almost empty) POT file? Translaters will then be pointed quasi-unavoidably to the special situation and can still use the english (or any other existing) translation as a template.

This would be annoying in development where people often do not have up to date compiled language files. I’d rather use gettext context for this…