-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
Translation messages are extracted to .xmb files (message bundle)
Translated messaged are then loaded from .xtb files (translation bundles)
- we don't have currently have support for loading
.xtbfiles - plural messages are not extracted correctly (should be a single msg in ICU format)
- meaning is not serialized to xmbs
More info (ex in TCCH)
Escaped characters in source code
Source code specific escaped characters should be converted to plain text (unescaped) when generating the message bundle (xmb file).
They can’’t do it → They can’t do it
%% → %
\u2026 → … (Unicode horizontal ellipsis)
Plain text (unescaped) characters in the translation bundle (xtb file) should be converted to source code specific syntax when generating the localized code.
They can’t do it → They can’’t do it
% → %%
… → \u2026
Special characters in the generated XMB
There are 5 characters that need to be escaped in the xmb file:
Symbols: quot amp apos lt gt
If these characters are in message text, then the handler must escape them.
Placeholder names
The placeholder name must be in ALL CAPS and use only letters, numbers, and the underscore character.
If you use a placeholder for an opening HTML tag, you should use a comparable placeholder for the closing tag, and they should share a name (e.g., "BEGIN_BOLD" and "END_BOLD").
If you have two placeholders in the same message, one can't be a substring of another. That is, "PHONE_NUMBER" and "WORK_PHONE_NUMBER" aren't allowed together; use "HOME_PHONE_NUMBER" and "WORK_PHONE_NUMBER" instead.
If you have a placeholder named ABC, then the text "ABC" is not allowed to be anywhere in the message, even as a substring.