learningequality/ka-lite — pull request #2698 by cpauya (2014-11-18 16:57:51+00:00)
Title: Modify `makemessages.py` to add the keyword for i18n for handlebars files.

Hi @aronasorman - this is for #2472.

This modifies the `makemessages` management command so that the text inside the `{{_ "text here" }}` helper function will be picked up for i18n.

Please note that we need to use literal values for the strings in the above handlebars helper function or else it will not be picked up by `makemessages`.

On this PR, I tried to use `xgettext -d %s -L Lua...` to be compatible with the current handlebars helper function for i18n which is in this format `{{_ "your text here" }}`. However it cannot parse all texts.

For example this `
{{_ "All" }}
` is bypassed and since I don't know any Lua - I can only guess that "All" is a probably a reserved keyword on that language. In contrast, using `
{{_ "all" }}
` is fine.

We therefore have two options as my TODOs:

1. Pick a language that is compatible with the `{{_ "text" }}` format. Doing a `man xgettext` will show the supported languages:

> Choice of input file language:
-L, --language=NAME
recognise the specified language (C, C++, ObjectiveC, PO, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Smalltalk, Java, JavaProperties, C#, awk, YCP, Tcl, Perl, PHP, GCC-source, NXStringTable, RST, Glade, Lua, JavaScript, Vala, Desktop)
2. Modify our handlebars i18n helper function so that it is `C-language` compatible like `{{_ ("text") }}`. This means we have to change all handlebars templates - should be an easy find-and-replace.

I will continue doing item 1. then item 2. if am not sucessful - unless any of you guys can help which language to use.