沃梦达 / 编程问答 / php问题 / 正文

本地化使用什么(php/smarty/pear 应用程序)?

What to use for localization (php/smarty/pear application)?(本地化使用什么(php/smarty/pear 应用程序)?)

本文介绍了本地化使用什么(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 应用程序)?

基础教程推荐