I'm developing a PHP-based application that requires internationalization (i18n) support.
我正在开发一个基于php的应用程序,它需要国际化(i18n)支持。
I'm using Smarty 3 as a template solution (and TinyMVC as the framework), and although I've been using it for small projects before (back in the days of Smarty 2.x), I haven't known about any easy-to-use i18n plugins for it. Is there such plugin/extension for Smarty 3.x that'll do the job for me? I don't mind if the backend is a bit hard to setup, that's fine, all I need is a good way to implement it in templates.
我使用Smarty 3作为模板解决方案(TinyMVC作为框架),尽管我以前在小型项目中使用过它(在Smarty 2.x时代),但我还不知道有任何易于使用的i18n插件可用。是否有Smarty 3的插件/扩展?可以帮我做这个工作吗?我不介意后端很难设置,这很好,我只需要一个在模板中实现它的好方法。
I need to translate this app into multiple languages, so I need to find a way for Smarty to support it. Is there one? Thanks.
我需要把这个应用翻译成多种语言,所以我需要找到一个让Smarty支持的方法。有一个吗?谢谢。
1 个解决方案
#1
3
You can use a gettext
plugin with Smarty, such as the one posted on this thread which the poster developed for Smarty 3 and that he claims to have been using in production for over six months without issue.
你可以使用一个带有Smarty的gettext插件,比如这个贴子上的那个,这个贴子是为Smarty 3开发的,他声称已经在生产中使用了六个多月没有问题。
#1
3
You can use a gettext
plugin with Smarty, such as the one posted on this thread which the poster developed for Smarty 3 and that he claims to have been using in production for over six months without issue.
你可以使用一个带有Smarty的gettext插件,比如这个贴子上的那个,这个贴子是为Smarty 3开发的,他声称已经在生产中使用了六个多月没有问题。