21 Commits

Author SHA1 Message Date
Victor Berchet
bb4db2d8f3 feat(compiler): add target locale to the translation bundles (#14290)
PR Close #14290
2017-02-09 14:32:39 -08:00
Victor Berchet
1c24271daf refactor(compiler): [i18n] integrate review feedback 2017-01-24 14:47:04 -08:00
Victor Berchet
c3e5ddbe20 refactor(compiler): [i18n] move dedup and placeholder mapping to the MessageBundle
It makes implementing a `Serializer` simpler as implementations do not have to
care any more about message dedup and placeholder mapping.
2017-01-24 14:47:04 -08:00
Victor Berchet
d02eab498f fix(compiler): [i18n] XMB/XTB placeholder names can contain only A-Z, 0-9, _n
There are restrictions on the character set that can be used for xmb and xtb
placeholder names.

However because changing the placeholder names would change the message IDs it
is not possible to add those restrictions to the names used internally. Then we
have to map internal name to public names when generating an xmb file and back
when translating using an xtb file.

Note for implementors of `Serializer`:
- When writing a file, the implementor should take care of converting the
internal names to public names while visiting the message nodes - this is
required because the original nodes are needed to compute the message ID.
- When reading a file, the implementor does not need to take care of the mapping
back to internal names as this is handled in the `I18nToHtmlVisitor` used by the
`TranslationBundle`.

fixes b/34339636
2017-01-24 14:47:04 -08:00
Victor Berchet
0fe3cd9a4c fix(i18n): add a default example to xmb placeholders (#13507)
Otherwise the TC would not be able to load the message
2016-12-15 15:33:42 -08:00
Victor Berchet
f238c8ac7a Revert "fix(compiler): xmb <ph> tags should not self close (#13413)"
This reverts commit 4b3d13519399f8db5ead50ab24ee6e5a64acbe43.
closes #13463
2016-12-14 12:54:58 -08:00
Victor Berchet
4b3d135193 fix(compiler): xmb <ph> tags should not self close (#13413) 2016-12-12 19:10:20 -08:00
Victor Berchet
76e4911e8b fix(core): fix placeholders handling in i18n.
Prior to this commit, translations were built in the serializers. This
could not work as a single translation can be used for different source
messages having different placeholder content.

Serializers do not try to replace the placeholders any more.
Placeholders are replaced by the translation bundle and the source
message is given as parameter so that the content of the placeholders is
taken into account.

Also XMB ids are now independent of the expression which is replaced by
a placeholder in the extracted file.
fixes #12512
2016-11-14 12:55:48 -08:00
Victor Berchet
ed5e98d0df fix(core): misc i18n fixes 2016-11-14 12:55:48 -08:00
Victor Berchet
c60ba7a72f refactor(core): remove ListWrapper from i18n 2016-11-14 12:55:48 -08:00
Victor Berchet
08c038ebd9 fix(core): xmb serializer uses decimal messaged IDs
fixes #12511
2016-11-14 12:55:48 -08:00
Joao Dias
77ee27c59e refactor(): use const and let instead of var 2016-11-12 16:40:17 -08:00
Victor Berchet
65a60b7456 style(I18N): Carriage returns in serialized files 2016-09-30 17:59:43 -07:00
Victor Berchet
91dd672aa4 style(xmb): add a space after ICU message cases 2016-08-11 23:24:22 -07:00
Victor Berchet
43512aa5eb fix(i18n): ICU placeholders are replaced by their translations (#10586)
They were replaced by the original message.
2016-08-09 21:05:04 -07:00
Victor Berchet
cdb1a237e5 refactor(compiler): html_parser -> ml_parser 2016-08-05 13:39:54 -07:00
Marc Laval
cd18de7a21 refactor(compiler): use Object.keys instead of Object.getOwnPropertyNames (#10498) 2016-08-04 10:35:41 -07:00
Victor Berchet
e34a04d2ad feat(xmb/xtb): support dtd 2016-07-29 14:18:34 -07:00
Victor Berchet
0eee1d5de3 feat(i18n): xtb serializer 2016-07-29 13:40:58 -07:00
Victor Berchet
cc5cfe87c3 feat(i18n): xmb serializer 2016-07-29 13:40:58 -07:00
Victor Berchet
48f230a951 feat(I18nAst): introduce an intermediate AST 2016-07-29 13:40:58 -07:00