localization - Django L10N: Making the Flat Model of 'po' File Not Flat -



localization - Django L10N: Making the Flat Model of 'po' File Not Flat -

the problem is: .po files flat. so, don't have convenient hierarchy.

example:

msgid "site_title" msgstr "this title of site" msgid "about_site_title" msgstr "and now... site"

problem occurs when have lot of messages in our .po file. it's hard find specific message want change.

we need bind our .po messages specific templates (html templates).

the obvious solution utilize custom prefix (for illustration name of template file). if have home.html , about.html our message strings be:

msgid "home:site_title" msgstr "this title of site" msgid "about:site_title" msgstr "and now... site"

could offer more convenient solution please?

basically .po files ordinary text files entries separated empty line. writing simple parser split 1 .po multiple files based on prefix msgid "something: seems no-brainer solution dealing huge translation files. organization multiple po files simplifies translation process (but must maintain msgid unique, prefixes need stay).

the next tool recommend called django-rosetta. provides web-based access po files, handles edition , displays occurrences of translation strings in files (i.e. templates).

django localization gettext

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -