I set out to improve gettext i18n in Erlang tonight. Given the erlang constant pool being optimized so that it returns references into it rather than “consing” a duplicate copy… do you see where this is going?
My result so far is just a proof of concept, too early to be released really. I just want to spread the word and show what the concept is:
I18N:gettext('Hello World')in source, but probably as
?__(I18N, 'Hello World'). The existing code uses the process dictionary to store the I18N table to use, and so can I.
I’ll get back when I have better code generation. Perhaps generating AST and compiling down to a .beam directly. Right now it generates source text and doesnt even escape strings.
Oh yeah, and a link: noss/erlang-gettext @ github