On Nov 9, 2007 12:44 AM, Philip Jenvey <[EMAIL PROTECTED]> wrote:
> On Nov 8, 2007, at 2:30 PM, Tomasz Nazar wrote:
> > I'd really like, that when changing translations (localized
> > i18n/**/*.po/mo files) pylons/paster are reloaded with newly, updated
> > texts.
> > (similar like changes to templates, public files are instantly
> > visible).
> The reloader is at paste.reloader -- you can register other files for
> it to watch via paste.reloader.watch_file(filename).
That was exactly that, thanks:
watch_file(os.path.join(root, 'i18n', 'en', 'LC_MESSAGES', 'portal.mo'))
watch_file(os.path.join(root, 'i18n', 'fr', 'LC_MESSAGES', 'portal.mo'))
:)
> > And btw, is it possible to get rid of PO-to-MO-compilation step? Or
> > can it be done on the fly somehow?
>
> You can all the commands in one shot, assuming you're using Babel,
> with a setuptools alias:
>
> http://peak.telecommunity.com/DevCenter/setuptools#alias-define-
> shortcuts-for-commonly-used-commands
>
> Something like:
>
> setup.py alias momo extract_messages update_catalog compile_catalog
>
> Sounds like you're looking for on the fly recompilation, like mako
> templates do when you visit them via your web app. I haven't seen any
> solutions for that, but it could be done
I ask, cause in Java properties it works this way without middle step
of MO compilation.
Anyway, for now I also have a short script, but it does sth slightly different.
I decided to use Java properties as a base for translations, (not
pot/po), as there is a great GUI for editing Java translations -- all
languages are visible at one screen, so one can edit all. It's much
more efficient than PoEdit (which hangs on Windows often).
http://www.zaval.org/products/jrc-editor/
So I do sth like this after:
msgcat -P -s portal/i18n/portal.properties -o
portal/i18n/en/LC_MESSAGES/portal.po
msgcat -P -s portal/i18n/portal_fr.properties -o
portal/i18n/fr/LC_MESSAGES/portal.po
python setup.py compile_catalog -f
;) Just a tip
See you,
Tomasz
--
_i______'simplicity_is_the_key'__________tomasz_nazar
_ii____'i_am_concern_oriented'________________JKM-UPR
_iii__'patsystem.sf.net'___________________linux_user
_'aspectized.com'___________________________prevayler
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---