Make text not marked for translation stick out
|Reported by:||graham.carlyle@…||Owned by:||nobody|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When changing templates to use the translation related tags, I found it quite tricky to chase down all the bits of text that needed translating. Finding *all* the text is especially important if the there will be a large turnaround time on the translations or there's a charge per set of translations.
To be more confident I'd translated everything I hacked the django src to replace translatable text with the string "XXXX" so text that wasn't marked as translatable stood out.
Index: django/utils/translation/trans_real.py =================================================================== --- django/utils/translation/trans_real.py (revision 10575) +++ django/utils/translation/trans_real.py (working copy) @@ -83,6 +83,9 @@ def __repr__(self): return "<DjangoTranslation lang:%s>" % self.__language + def ugettext(self, msg_id): + return u'XXXX' + class DjangoTranslation23(DjangoTranslation): """ Compatibility class that is only used with Python 2.3.
So maybe this might be a useful "feature" to have. Possibly a setting to make the translation return a dummy value and maybe another setting for the value, being a string or a callable (taking the msg_id).
DEBUG_I18N = True DEBUG_I18N_TRANSLATOR = lambda(msg_id): "XXXX"
I suppose you could create a dummy po file to achieve a similar effect but I couldn't see any easy way of creating such a po file (that could be an alternative I suppose, a utility to generate such a file)
Change History (6)
comment:1 Changed 5 years ago by Alex
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Design decision needed