What to use for localization (php/smarty/pear application)?(本地化使用什么(php/smarty/pear 应用程序)?)
问题描述
我有一个 php/smarty/pear 应用程序,它有自己的本地化实现,涉及使用字符串的 id 并且字符串存储在数据库中.目前该应用程序只有英文,但我将开始添加其他语言.当前的实现非常糟糕,基本上我不是重新发明轮子的忠实粉丝.
I have a php/smarty/pear app that has it's own localization implementation that involves using ids for strings and the strings are stored in a db. currently the app is only in English but I will start adding other languages. The current implementation is very poor and basically I'm not a big fan of re-inventing the wheel.
任何人都可以推荐用于本地化的内容吗?几年前我用过gettext,现在还在用还是有更新更好的东西?
Can anybody recommend what to use for localization? I had used gettext years ago, is that still used or is there something newer and better ?
提前致谢.
推荐答案
我会使用 gettext,因为它是一个成熟的系统,并提供单/复数翻译等功能.为了不依赖于 php 扩展的可用性,你应该回退到 http://launchpad.net/php-gettext 提供了 gettext 的纯 php 实现.
I would use gettext, since it's a mature system and provides features like singular/plural versions of translations. To be not dependant on the availability of the php extension, you should fall back to http://launchpad.net/php-gettext which provides a pure php implementation of gettext.
gettext 还有一个很大的优势,那就是存在许多可以轻松翻译这些文件的工具.
gettext has also the big advantage that dozens of tools exist that make it easy to translate those files.
这篇关于本地化使用什么(php/smarty/pear 应用程序)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:本地化使用什么(php/smarty/pear 应用程序)?
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
