Re: [AD] Figuring out the language from the environment variable LANG |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Leavning all comments in for convenience, even where I have no comments of my
own...
On Thursday 23 January 2003 1:40 pm, you wrote:
> > Here's a patch to fix the situation told about in Alleg5's "GNU
> > gettext support" thread.
>
> Ok for mainline, with the following minor corrections:
>
> + install_allegro automatically calls this function, and if you have an
> + environment variable named LANG, it will use it's two first letters to
> + set the system language.
>
> "its", not "it's".
True, and nice to see someone who knows this for once :) but I think it's
awkward having the two different meanings of 'it' in this sentence. Try
replacing "it(')s" with "variable's".
Also, change the word order: "first two" sounds better. (See below.)
> + /* try to guess language setting from environment variable */
> + if ((env_lang = getenv("LANG")) && env_lang[0] && env_lang[1]) {
> + char lang[3] = "en";
>
> Kill the "3".
>
> + /* yes, this is bad, but we only read the first two letters */
> + lang[0] = env_lang[0];
> + lang[1] = env_lang[1];
> + reload_config_texts(lang);
>
> "two first letters".
No, "first two" does sound better. I insist ;)
> + AL_CONST char *ext, *datafile;
> + char filename[1024], *namecpy = ustrdup(name);
>
> Don't mix char[] and char* variables.
Ben