本文介绍了PHP Gettext:设置域路径后如何更改默认的MO路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用PHP Gettext扩展名对Web应用程序进行本地化.当您这样做时:
I use PHP Gettext extension for localizing a Web app. When you do:
bindtextdomain("example", "/locales");
如果将语言环境设置为fr_FR,它将在以下位置查找MO:
If you're setting the locale to fr_FR, it will look for the MO in:
/locales/fr_FR/LC_MESSAGES/example.mo
是否可以自定义该路径?例如,我想使用以下结构:
Is there a way to customize that path? For instance I would like to use the following structure:
/locales/example.fr_FR.mo
推荐答案
目录结构由gettext固定.
The directory structure is fixed by gettext.
dir_name/locale/LC_category/domain_name.mo
dir_name/locale/LC_category/domain_name.mo
这篇关于PHP Gettext:设置域路径后如何更改默认的MO路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!