I've just started using smarty but i have some problems to find a proper way for multilanguage scripts.
There are some solutions for this problem, that i found until now.
- smarty-gettext this seems like a nice solutions, because translator could easily work with poedit but the plugin wasn't updated since 2005, seems to be outdated.
- different templates for each language seems not to be best practice, becaue language and content is no longer split up and adding new languages and updating templates can become a real pain in the a**.
- Custom array solutions there are a bunch of solutions like this be they all sound like a quick 'n dirty workaround and are definitely not best practice, i think.
I hope you have some ideas for good solutions.
gettext
is definitely the way to go here unless you want to use xliff or something (if thats the case id recommend using Zend_Translate and creating a smarty extension with it as the engine). I would use the existing smarty plugin but fork it so that if you need to update it you can and then contribute those back to the community.That said, How deep are you in smarty code?
If youre just getting started id recommend switching to Twig which also has i18n extension, and since its managed by the Twig core team it shouldnt be out of date unless development of Twig ceases all together which is unlikely since its the default template system for Symfony2