1

We're using ember-i18n to do i18n in our Ember app, and so far it's been fine. We've got a bunch of keys for strings like "Cancel" and "Save" and "Please don't do that", but I'm not sure if string-based i18n is the right way to approach the section I hit today, which is basically a warning (I'm inventing this text, but the sentiment is the same):

Stop! What you're about to do cannot be undone. If you click the next button, you accept responsibility for:

  • Three small children
  • The Greek sovereign debt crisis
  • Windows 98

If you agree, click "I Agree" to continue.

Should I just put a bunch of keys in the language file for that block? One key for the whole shebang, HTML and all? Or is there another way?

4

1 回答 1

3

嗨@pjmorse 我建议你使用一堆钥匙 有两个原因。

  1. 此处需要将 html 标记和文本组合为所需键的值。

例如:

Stop! What you're about to do cannot be undone. If you click the next button, you accept responsibility for: <br>
<ul>
<li>
Three small children<li>
<li>The Greek sovereign debt crisis<li>
<li>Windows 98<li>
</ul>

据我所知,这将是不好的做法。还,

2. 如果你想改变<ul> to <ol>

您需要更改所有语言文件。所以最好使用一堆键并将 html 设计与国际化分开。

快乐编码。

于 2014-02-18T14:54:57.133 回答