How to extract goog.getMsg for i18n?

355 views
Skip to first unread message

Daniel Steigerwald

unread,
Oct 28, 2012, 12:32:06 AM10/28/12
to closure-comp...@googlegroups.com
"To let Closure Compiler handle the extraction and insertion of messages..."
How it's that possible?

Johannes Nel

unread,
Oct 28, 2012, 2:16:48 AM10/28/12
to closure-comp...@googlegroups.com
by using the {msg} directive in templates or goog.getMsg in code alongside an xlf file you compile in. 
You will compile a version for each language instead of it happening at runtime.

--
j:pn
\\no comment
Message has been deleted

Daniel Steigerwald

unread,
Oct 29, 2012, 5:59:15 PM10/29/12
to closure-comp...@googlegroups.com
So if I just put {msg} directive in templates and goog.getMsg, messages are magically extracted somewhere, great! Unfortunately somewhere outside of my computer.

... I have read everything about Closure i18n I was able to googled plus Closure book. As I know there is no possibility to extract messages from code. Just from .soy templates. Some code probably have not been released yet.

Dne neděle, 28. října 2012 7:16:49 UTC+1 Johannes Nel napsal(a):

Ilia Mirkin

unread,
Oct 29, 2012, 6:53:48 PM10/29/12
to closure-comp...@googlegroups.com
In code you can use goog.getMsg() and you can supply a .xtb file to
the compiler (which is as far as I could tell a non-standard format,
but it's pretty easy to work it out from reading the code).
Separately, soy templates have unrelated support to use xliff files,
but that doesn't integrate with goog.getMsg in any way.

If you're using plovr, you can try
https://codereview.appspot.com/6194048/ which adds XTB support to
plovr and https://codereview.appspot.com/6201051/ on top of that if
you want to use XLIFF files. Someone on the plovr list reported
success with using those, although that's all a bit dated.
Reply all
Reply to author
Forward
0 new messages