Well, my solution so far is to add formalchemy's translations to my app's locale dir:
config.add_translation_dirs('myapp:locale', 'formalchemy:i18n_resources')
but that will load the formalchemy's locale under domain formalchemy. Therefore
I also copied functions get_localizer and make_localizer from pyramid.i18n, and in
make_localizer I re-domainize the formalchemy translations to myapp's domain,
like this:
if mofile.endswith('.mo') and os.path.isfile(mopath):
with open(mopath, 'rb') as mofp:
domain = mofile[:-3]
if "formalchemy"==domain: domain = "faapp"
dtrans = Translations(mofp, domain)
translations.add(dtrans)
Is it a too ugly hack or do you think it is passable?
I also set
request.environ['fa.translate'] = auto_translate
so that formalchemy does has to do a bit less.
--
Petr