Modifying i18n locales and after Rails app initializes? -
i'm trying use i18n locales multisite application , wondering whether it's @ possible load translation locale files after rails app has initialized?
i'm using excellent globalize gem activerecord model translations, want able load locales given site it's own folder. i'm therefore trying use along following lines in site loader code:
i18n.load_path = file.join(site.path, 'locales')
where site.path variable relates current site's configuration & asset directory.
i don't want rely on adding i18n initializer glob through sites directory locales 2 reasons:
i can't guarantee different site won't use same translatable string, , don't want them overwriting each other.
i don't want have restart application each time new site has been added.
if helps, logic doing way allows sites multi language, , not, , allows me lazy whether site multi-language or not because if can above successfully, can use i18n.available_locales determine whether or not show lanuage switcher in admin app etc.
Comments
Post a Comment