Skip to content

I18n

Navi support to define I18n strings.

Use @ and follow by a identifier to define a I18n string.

The following statement defines the I18n string hello, which supports two languages: zh-CN and en.

nvs

Yes, we can also use string interpolation to define I18n strings:

nvs

You can use @<identifier> to reference I18n string with current locale.

For example, the following code assigns Hello or 你好 to the variable value when the closing price is greater than the opening price, otherwise it is an empty string.

nvs

WARNING

The string interpolation in I18n string definition is relative to the statement where the definition is referenced.

For example, the following code assigns Length 10 or 长度 10 to the variable a, and Length 20 or 长度 20 to the variable b.

nvs

Result:

nvs