【发布时间】:2019-08-01 02:47:19
【问题描述】:
我已经成功构建了一个 Angular 国际化项目,但是我现在想通过文化来实现它,我的意思不仅仅是 es,而是 es-AR 或 en-NZ。
这些是我在angular.js 文件中的西班牙语和英语配置:
"build": {
...
"configurations": {
...
"production-es": {
"optimization": true,
"outputHashing": "all",
"outputPath": "dist/browser/es/",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"baseHref": "/es/",
"i18nFile": "src/locale/messages.es.xlf",
"i18nFormat": "xlf",
"i18nLocale": "es",
"i18nMissingTranslation": "error"
},
"production-en": {
"optimization": true,
"outputHashing": "all",
"outputPath": "dist/browser/en/",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"baseHref": "/en/",
"i18nFile": "src/locale/messages.en.xlf",
"i18nFormat": "xlf",
"i18nLocale": "en",
"i18nMissingTranslation": "error"
}
}
},
"serve": {
...
"configurations": {
...
"es": {
"browserTarget": "i18n-demo:build:production-es"
},
"en": {
"browserTarget": "i18n-demo:build:production-en"
}
}
}
我必须为文化添加什么? 非常感谢提前:)
【问题讨论】:
-
你已经做了同样的事情,但使用
es-AR而不是es?
标签: angular localization internationalization