[PD] comments as one long symbol
jancsika at yahoo.com
Sat Mar 29 17:44:30 CET 2014
That way we could implement a simple translation system.
When Pd loads a patch it looks for a translation file in the local language that share the same base file name as the patch. If there isn't a translation file then a comment would load as is. If there is a translation file for the user's language then Pd searches the translation file for the comment and loads up the corresponding translated comment.
So why do comments as one long symbol help? Because then a search is as simple looping through an array of atoms and doing:
if (gensym(buf) == gensym(translation_file_buf))
Fast and simple. And you just need an extra entry in the ce_env struct to hold the name of the translation file for the user's locale.
I still don't know how gettext works, but I'm guessing we could set it up to pull out comments from a Pd file, then use that to generate the template for the help patch translations.
Comments? Attacks? Beers?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pd-list