gpt4 book ai didi

PHP 获取文本 : how to change the default MO path after setting the path of the domain?

转载 作者:可可西里 更新时间:2023-11-01 13:55:51 28 4
gpt4 key购买 nike

我使用 PHP Gettext 扩展来本地化 Web 应用程序。当你这样做时:

bindtextdomain("example", "/locales");

如果您将语言环境设置为 fr_FR,它将在以下位置查找 MO:

/locales/fr_FR/LC_MESSAGES/example.mo

有没有办法自定义该路径?例如我想使用以下结构:

/locales/example.fr_FR.mo

最佳答案

目录结构由gettext固定。

Because many different languages for many different packages have to be stored we need some way to add these information to file message catalog files. The way usually used in Unix environments is have this encoding in the file name. This is also done here. The directory name given in bindtextdomains second argument (or the default directory), followed by the name of the locale, the locale category, and the domain name are concatenated:

dir_name/locale/LC_category/domain_name.mo

关于PHP 获取文本 : how to change the default MO path after setting the path of the domain?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9515863/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com