我可以更改有关JHipsters'jhiTranslate'的字符串数组的串联字符吗? [英] Can I change the concatenation character of the String-Array regarding JHipsters 'jhiTranslate'?

查看:94
本文介绍了我可以更改有关JHipsters'jhiTranslate'的字符串数组的串联字符吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用字符串数组进行翻译,例如i18n/en/home.json喜欢

If I use a string array for translation in e.g. i18n/en/home.json like

     "primaryIntroduction": {
         "p1": [
             "Then Jenkins triggers a task to connect to the docker-server",
             " and calls some docker- and docker-compose commands to pull the new image",
             " and rebuilds and restarts the docker-container."
         ]
    }

jhipster在英语页面上将<p>连接起来,例如:

jhipster concatenates the <p> on the english page like:

然后,詹金斯(Jenkins)触发任务以连接到 docker-server,并调用一些docker-和docker-compose命令以 拉出新映像,然后重建并重新启动docker-container.

Then Jenkins triggers a task to connect to the docker-server, and calls some docker- and docker-compose commands to pull the new image, and rebuilds and restarts the docker-container.

(注意逗号)

输入新行而不用引号结束该行,则json文件将停止. 没有换行符,较大的段落很难阅读和翻译.

Entering a new line without ending the line with a quotation mark, the json-file will brake. Without newlines, bigger paragraphs are hard to read and to translate in my opinion.

我可以更改句子对自己的连接方式吗?例如,将数组的字符串放在一起时,要使用空格而不是逗号?在Angular系统中为该级联字符引入控制变量是否有用?

Can I change the way the sentences are concatenated on myself? For example take a whitespace instead of a comma when putting the strings of the array together? Would it be useful to introduce a control-variable for that concatenation character in the Angular system?

推荐答案

这是正常的,键p1的值是一个数组,而数组的字符串表示形式是逗号分隔的列表.参见 https://github.com/ngx-translate/core/issues/339详细信息.

This is normal, the value for your key p1 is an array and the string representation of an array is a comma separated list. See https://github.com/ngx-translate/core/issues/339 for details.

此问题已通过支持 JSON5 格式在ngx-translate中解决,但是很遗憾,它尚未发布似乎项目不再得到积极维护,因为最新版本是2018年11月.

This issue was solved in ngx-translate by supporting JSON5 format but unfortunately it has not been released yet and it seems the project is no longer actively maintained as last release is from november 2018.

因此,您可以尝试使用管道建议来支持数组,请参见 https ://github.com/ngx-translate/core/issues/339#issuecomment-360450296

So you could try the pipe suggestion to support arrays, see https://github.com/ngx-translate/core/issues/339#issuecomment-360450296

这篇关于我可以更改有关JHipsters'jhiTranslate'的字符串数组的串联字符吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆