Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用i18n(aot)向angular添加多语言_Angular_Typescript_Internationalization - Fatal编程技术网

使用i18n(aot)向angular添加多语言

使用i18n(aot)向angular添加多语言,angular,typescript,internationalization,Angular,Typescript,Internationalization,我想在Angular2项目中添加对多语言的支持。 我遵循了关于国际化的文档: 我正在使用angular cli,所以我按照aot说明进行操作。 如果我从终端向其发送此命令,它将工作: ng serve --aot --locale it --i18n-format xlf --i18n-file src/locale/messages.i t.xlf 现在,我想让用户能够在运行时更改语言(我将所有已翻译的消息保存在带有xlf扩展名的locale文件夹中)。有可能吗?没有,如果不使用另一个区域设

我想在Angular2项目中添加对多语言的支持。 我遵循了关于国际化的文档: 我正在使用angular cli,所以我按照aot说明进行操作。 如果我从终端向其发送此命令,它将工作:

ng serve --aot --locale it --i18n-format xlf --i18n-file src/locale/messages.i
t.xlf

现在,我想让用户能够在运行时更改语言(我将所有已翻译的消息保存在带有xlf扩展名的locale文件夹中)。有可能吗?

没有,如果不使用另一个区域设置重新加载另一个index.html页面就不行。我们如何在angular和web服务器上进行重定向?你能提供一些信息吗?