angular - ng2 i18n:在模板中使用 NOT 英语作为默认语言
问题描述
我正在为讲俄语的人开发应用程序。英语语言环境是“备份”。所以我想在我的模板中看到俄语单词,以便更容易理解。LOCALE_ID
它工作正常,但如果我不在模块设置中提供,注入总是“en-US”。或者如果我提供它总是'ru',不管--configuration
国旗
是否可以将默认语言设置为非英语?
我的angular.json
样子
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
...
"i18nLocale": "ru",
},
"configurations": {
"en": {
"i18nFile": "app/assets/i18n/messages.en.xlf",
"i18nFormat": "xlf",
"i18nLocale": "en",
"i18nMissingTranslation": "error"
}
}
我
ng serve my-app --configuration en
为英语和俄语
提供应用程序ng serve my-app
解决方案
推荐阅读
- wysiwyg - 添加列出所有文档的自定义图标,单击时应将其添加为链接
- python - 如何使用 Pymongo 将带有 collection.update_many() 的文档插入到 Collection (MongoDB) 中(不重复)
- php - 如果 PHP 中的运算符无法正常工作
- python - 加载冻结推理图以进行张量优化时无法导入元图
- php - SQL 在查询中获取所有用户活动的总和
- c# - Entity Framework Core - ForeingKey 显示空值
- r - 创建一个新变量,它是一个变量以其他两个变量为条件的平均值(并维护数据集中的所有其他变量)
- xml - 如何根据条件跳过 XML 中的节点并将该值添加到具有匹配条件的节点中
- shell - 如何避免在ggsci中删除重复时出现提示
- javascript - 如何在 jQuery click 上预加载下一个背景 css 图像?