Transl: Getting rid of the conf directory (Part 1)

Paul Vriens at
Mon Jul 13 04:03:07 CDT 2009


In an effort to make conf more dynamic (and less depending on hardcoded
configuration) I'd like to get rid of the conf directory.

Let's make a first distinction here. We currently have a conf directory
used by the scripts/* files and one by the php/* files.

I'd like to discuss the scripts/conf directory first. Once that is done 
we can start discussing the php/conf directory

The scripts conf directory
The conf directory shows all the languages currently known by transl to 
be in use for translations. (We get a warning if a language is found in 
the source and we don't have a conf file for it.)

The most prominent use of the conf directory is to create a list of 
languages that will show up on the index page.
The conf file could hold a parameter "[ignore-sublang]". This parameter 
is used to change a LANG_XXX, SUBLANG_* into LANG_XXX, SUBLANG_NEUTRAL.

So, if we want to get rid of the hardcoded conf directory we need some 
logic that replaces the above.

The logic should hold the following rules:

1. LANG_XXX, SUBLANG_XXX_YYY is the highest level possible so we don't 
have to do anything here.

2. LANG_XXX, SUBLANG_DEFAULT (only 1 sublanguage in our code) should 

3. LANG_XXX, SUBLANG_DEFAULT (multiple sublanguages in our code) should 
show all possible LANG_XXX, SUBLANG_XXX_YYY.

4. LANG_XXX, SUBLANG_NEUTRAL (only 1 sublangugage in our code) should 

5. LANG_XXX, SUBLANG_NEUTRAL (multiple sublanguages in our code) should 
mean show all possible LANG_XXX, SUBLANG_XXX_YYY.

(This logic is already somehow in place when the Portuguese issue was 

I propose the following changes:

1. The first thing that should happen before any parsing is done is to 
get a list of all the different languages Wine is translated in.
2. Automatically create a scripts/conf directory that is based on the 
list found in step 1. This is temporary until the php part is converted 
as well. These conf files don't need the [hide] parameter or the 
[ignore-sublang] parameter anymore.
3. Change some of the php scripts to get rid of the two parameters 
mentioned in step 2. This basically means that we are not going to show 
pages anymore for the neutral languages (English is the exception).

Note for step 2.
The php scripts rely on the php/conf (copy of scripts/conf) directory 
for retrieving the name of a language. The kernel32 resources also have 
these names albeit sometimes a little different. I've noted the 
following differences:

conf-dir		kernel32
========		========
Chinese (Simplified)	Chinese (PRC)
Chinese (Traditional)	Chinese (Taiwan)
English (US)		English (United States)
English (Neutral)	English
Portugese (Brazilian)	Portuguese (Brazil)
Portugese (Portugal)	Portuguese (Portugal)

Do we want to go with the kernel32 names or should we have some kind of 
name override?

To prove my point I just looked at the list of translations we have, 
created the necessary files in scripts/conf, got rid of the 2 parameters 
and ran the script to regenerate everything. The results were 
as expected and looked basically the same as on our transl page. After 
changing the index page to not use the [hide] parameter anymore but some 
other logic it looked exactly the same.

Thoughts, ideas, suggestions, questions on all of this?

(As said he php/conf directory can/will be discussed in a second email 
once this is "solved").



More information about the wine-devel mailing list