README.txt 1.4 KB

1234567891011121314151617181920212223242526
  1. This Blockly demo uses Closure Templates to create a multilingual application.
  2. Any changes to the template.soy file require a recompile. Here is the command
  3. to generate a quick English version for debugging:
  4. java -jar soy/SoyToJsSrcCompiler.jar --outputPathFormat generated/en.js --srcs template.soy
  5. To generate a full set of language translations, first extract all the strings
  6. from template.soy using this command:
  7. java -jar soy/SoyMsgExtractor.jar --outputFile xlf/extracted_msgs.xlf template.soy
  8. This generates xlf/extracted_msgs.xlf, which may then be used by any
  9. XLIFF-compatible translation console to generate a set of files with the
  10. translated strings. These should be placed in the xlf directory.
  11. Finally, generate all the language versions wih this command:
  12. java -jar soy/SoyToJsSrcCompiler.jar --locales ar,be-tarask,br,ca,da,de,el,en,es,fa,fr,he,hrx,hu,ia,is,it,ja,ko,ms,nb,nl,pl,pms,pt-br,ro,ru,sc,sv,th,tr,uk,vi,zh-hans,zh-hant --messageFilePathFormat xlf/translated_msgs_{LOCALE}.xlf --outputPathFormat "generated/{LOCALE}.js" template.soy
  13. This is the process that Google uses for maintaining Blockly Games in 40+
  14. languages. The XLIFF fromat is simple enough that it is trival to write a
  15. Python script to reformat it into some other format (such as JSON) for
  16. compatability with other translation consoles.
  17. For more information, see message translation for Closure Templates:
  18. https://developers.google.com/closure/templates/docs/translation