[PD] choosing your language at launch WAS: Japanese Pure Data book is out now.

Bryan Jurish moocow.bovine at googlemail.com
Sun Mar 4 00:30:45 CET 2012


morning all,

apologies for missing this the first time around, and for reviving the
topic if the question has already been addressed, but...

On 2012-02-25 17:59, András Murányi wrote:
> If you want the *whole* app to change language, I'm pretty sure it will
> need to be restarted. Then I guess an equivalent of "export LANG" can be
> issued from tcl (and/or C?) at startup. (Could someone with the knowledge
> confirm/correct this plz?)

you can use the [locale] object (probable "moocow/locale" in
pd-extended) to set C99 locale stuff like LANG (or more POSIXly correct,
LC_ALL).  Use it like:

[set LC_ALL de_DE.UTF-8, set LC_NUMERIC C(
 |
[locale]

... note that it's important to keep LC_NUMERIC=C in order to avoid
parse errors for locales with funny floating-point conventions (such as
de_DE, which uses the comma as a floating-point separator).

The C equivalent is just:

 #include <locale.h>
 setlocale(LC_ALL,"de_DE.UTF-8");
 setlocale(LC_NUMERIC,"C");

Not sure if this helps with changing the gettext-lookups for the running
process though; maybe follow it up with an exec() ?

marmosets,
	Bryan

-- 
Bryan Jurish                       "There is *always* one more bug."
moocow.bovine at gmail.com     -Lubarsky's Law of Cybernetic Entomology



More information about the Pd-list mailing list