Localization: Php and Javascript -


i'm thinking of best way localize website. using laravel, has php localization class, need translate javascript strings

ideally, use library or translation file editable through poedit , used both javascript , php, can't find solution that. possible without having create whole new code library?

the solution thought of until far ideal:

  • use php localization class php strings
  • use javascript localization library javascript
  • store language in cookie read both ends.

the idea of keeping 2 separate language files (one php , 1 javascript) not seem elegant solution.

i saw javascript libraries laravel, require compile library javascript array file every time update something, make not dynamic , redundant, since php strings won't used in javascript , vice-versa.

any thoughts on this?

you have javascript files php generated per request, mean still use php localization library both.

i imagine might not play nice caching javascript files in browser, have php script generates javascript files, creating different file per language, time need update them, run php script again overwrite them

i have never worked on localization, imagine involves file matches words/phrases each language? if so, set cron job checks last time file updated, runs php script generate javascript files? won't have worry running manually each time


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -