Comment 7 for bug 995287

Revision history for this message
Mark McLoughlin (markmc) wrote : Re: actually use translated strings

Summary of what the sphinx code Monty points to actually does:

  1) it provides a l_() function which delays the actual translation of the string until the string's value is needed. This appears to be for the case where a module wants to define a translatable string at import time, but not have the translation happen until runtime. With C, you'd similarly mark a string using N_() and translate it using gettext() at runtime

  2) it has a locale.init() function which allows you to pass in multiple localedirs and it will use translations from any .mo files found in those dirs by merging them all into a single catalog. This is basically an improved gettext.install().

I don't know any cases where we need (1) yet - but we might in future.

I also don't think fixing this bug requires (2) - for any given translation domain, there's only ever a single directory in any installation where we need to look up translations.