admin管理员组文章数量:1122846
Using Angular's localize library (@angular/localize) to handle translations in an application. In my German copy however I have certain words that are too long and need a soft hyphen line break opportunity.
If I include the ­
character in the translation file however, it gets rendered as just that. Is there a way to render the line break character correctly, or else prevent the &
character from being rendered in html as &
?
Example translation file (using json format - can use a different format though if it makes a difference):
{
"home-heading-text": "Folgendes Wort ist sehr lang: Abschieds­geschenk"
}
<h1 i18n="@@home-heading-text">Following word is very long: farewell gift</h1>
Using Angular's localize library (@angular/localize) to handle translations in an application. In my German copy however I have certain words that are too long and need a soft hyphen line break opportunity.
If I include the ­
character in the translation file however, it gets rendered as just that. Is there a way to render the line break character correctly, or else prevent the &
character from being rendered in html as &
?
Example translation file (using json format - can use a different format though if it makes a difference):
{
"home-heading-text": "Folgendes Wort ist sehr lang: Abschieds­geschenk"
}
<h1 i18n="@@home-heading-text">Following word is very long: farewell gift</h1>
Share
Improve this question
asked Nov 22, 2024 at 16:05
James JenkinsonJames Jenkinson
1,6512 gold badges17 silver badges35 bronze badges
0
1 Answer
Reset to default 1You can use the unicode value and it seems to work as expected. Please reduce the size of the stackblitz preview window to a really small size and it will be noticeable.
{
"home.welcome": "Hello {$name}! You \u00AD have {$messageCount} messages."
}
Forked Stackblitz
Symfony Translations: Soft hyphens () in messages yaml file? - deceze ♦ Comment
本文标签: localizationInclude ampshy character (or equivalent) in Angular39s localize libraryStack Overflow
版权声明:本文标题:localization - Include &shy; character (or equivalent) in Angular's localize library - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302444a1931535.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论