问题描述
我正在从事一个大项目.我正在考虑一个新想法,以创建将多种语言国际化的最佳方式.
I'm working in a big project.I'm thinking of a new idea to create the best way of internacianalization to many languages.
解决方案:
- 1. 将数据存储为数组 - 树文件系统.. 这不是一个好方法,因为我需要在线"修改文件.
- 2.I18n表.所有翻译都有一个公用表或相关表.(查询到数据库+数据库缓存)
- 3.YAML(对我来说是新的)
我正在阅读 YAMl 文档,我喜欢这种结构.我建议使用第三个解决方案.我想听听您的意见/建议.
提前致谢.
I am reading about YAMl documentation and I like this structure..I suggest the 3rd solution.I would like to hear your opinions/suggestions.
Thank you in advance.
推荐答案
好的,我没有答案.
我将在这里描述我的本地化解决方案
OK,I have no answers.
I will describe here my solutions for localization
对于常见的翻译,我使用了 Yaml 格式.
(数据具有这种格式):
文件名:common.en_US.yaml
For a common translations I used Yaml format.
(Data has this format):
Filename:common.en_US.yaml
menu:
clients: Clients
other: Other
management: Management
如何使用:
l10n::get('menu/clients');
对于 javaScript 翻译,我使用了相同的 yaml 格式.
For the javaScript translations,I used the same yaml format.
如何使用:
对于大型动态数据,我使用了l10n 本地化标准.
其中本地化表具有前缀 _l10n
l10n::get_data('table',68);
这篇关于YAML 国际化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!