[Android Software Development] majdinj:
<<In this post, we will concentrate on making the added languages visible and usable in your cooked ROM. Also we will learn how to add different CSC code regions in the cooked ROM>>​

How to add languages to language display and language input:

1. Navigate to system\csc\common\system\csc folder and open language.xml file. Here we will concentrate in this section:

<LanguageSet>
[B][COLOR="Blue"]<Display>[/COLOR][/B] [B][COLOR="Green"]<!-- This section is for displayed languages[/COLOR][/B]
en_GB;en_US;fr_FR;
ar_AE;fa_FA;ur_PK;
</Display>
[B][COLOR="Blue"]<Input>[/COLOR][/B] [B][COLOR="Green"]<!-- This section is for input languages[/COLOR][/B]
<SupportList>
en_GB;en_US;fr;ar;fa;ur;
</SupportList>
<EnableList>
</EnableList>
</Input>
</LanguageSet>

for each section you can add iso code language for each region. Here is the code again after applying iso code languages:

<LanguageSet>
<Display>
en_GB;ar_AE;az_AZ;bg_BG;ca_ES;cs_CZ;da_DK;de_AT;de_CH;de_DE;
el_GR;en_AU;en_IE;en_NZ;en_PH;en_US;en_ZA;es_ES;es_US;et_EE;
eu_ES;f_FI;fa_FA;fr_CH;fr_FR;ga_IE;gl_ES;hr_HR;hu_HU;hy_AM;
in_ID;is_IS;it_IT;ka_GE;kk_KZ;ko_KR;lt_LT;lv_LV;mk_MK;ms_MY;
nb_NO;nl_BE;nl_NL;pl_PL;pt_BR;pt_PT;ro_RO;ru_RU;sk_SK;sl_SI;
sr_RS;sv_SE;th_TH;tr_TR;ur_PK;uk_UA;uz_UZ;vi_VN;zh_CN;zh_HK;
zh_TW;
</Display>
<Input>
<SupportList>
en_GB;ar;az;bg;bn;ca;cs;da;de;el;
en_US;es;et;eu;fa;fi;fr;gl;gu;hi;
hr;hu;hy;id;is;it;ka;kk;kn;ko;
lt;lv;ml;ms;mr;nb;nl;pa;pl;pt;
ro;ru;sk;sl;sr;sv;ta;te;th;tr;
uk;ur;vi;zh_CN;
</SupportList>
<EnableList>
</EnableList>
</Input>
</LanguageSet>

of course after extracting a lot of ROMs from specific regions, you can just add their iso code language in your cooked ROM language.xml after having the iso codes from their language.xml files

2. Now copy this modified language.xml and paste it on system\csc directory

3. Now to display language name in your device, you need to decompile ResourceManager.apk and navigate to res\values folder and open strings.xml and add new languages resources strings there in this form:

<string name="vo_rm_authority">com.visionobjects.resourcemanager</string>
<string name="[B][COLOR="Red"]en_GB[/COLOR][/B]">[B][COLOR="Blue"]English(UK)[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]en_US[/COLOR][/B]">[B][COLOR="Blue"]English(US)[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]az[/COLOR][/B]">[B][COLOR="Blue"]Azərbaycan[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]ca[/COLOR][/B]">[B][COLOR="Blue"]Català[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]cs[/COLOR][/B]">[B][COLOR="Blue"]Čeština[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]da[/COLOR][/B]">[B][COLOR="Blue"]Dansk[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]de[/COLOR][/B]">[B][COLOR="Blue"]Deutsch[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]et[/COLOR][/B]">[B][COLOR="Blue"]Eesti[/COLOR][/B]</string>
<string name="[B][COLOR="Red"]es[/COLOR][/B]">[B][COLOR="Blue"]Español[/COLOR][/B]</string>
..
..
[B][COLOR="Green"]and so on[/COLOR][/B]

Here the red texts are regional iso codes for the added language, and the blue texts are the displayed language name in your device (you can decompile ResourceManager.apk from different ROMs' regions in order to have the iso codes and the corresponding languages strings).

4. Now you need to add input database for different languages. After extracting different ROMs' regions, copy all the content of system\T9DB and paste it in same directory of the ROM that you will make it support different languages.

5. Now you will need to integrate languages data base; after extracting different ROMs' regions, copy all the content of system\hdic folder and paste it in same directory of the ROM that you will make it support different languages.

How to set default language in initial setup wizard:

Go to system\csc folder and open customer.xml and edit this section:

<Phone>
<DefLanguage>[B][COLOR="Blue"]ar_AE[/COLOR][/B]</DefLanguage>
<DefLanguageNoSIM>[B][COLOR="Blue"]ar_AE[/COLOR][/B]</DefLanguageNoSIM>
<DateTimeFormat>
<DateFormat>ddmmyyyy</DateFormat>
</DateTimeFormat>
<VisiblePassword>off</VisiblePassword>
</Phone>

Just change the blue colored iso code and substitute it with your favorite one from language.xml display section

CSC codes:

How to set default csc code:

Go to system\csc\%yourCSCfolder%\system\csc folder and copy all its content (usually contents.db, customer.xml, others.xml, and sales_code.dat) and paste it on system\csc directory.

Alternatively, you can edit the files in system\csc folder that includes:

customer.xml

<SalesCode>[B][COLOR="Blue"]KSA[/COLOR][/B]</SalesCode>

change it to your csc iso code (that is the csc folder name in system\csc folder).

language.xml:

<SalesCode>[B][COLOR="Blue"]KSA[/COLOR][/B]</SalesCode>

the same as change in customer.xml

sales_code.dat

[B][COLOR="Blue"]KSA[/COLOR][/B]

the same as change in customer.xml

How to add extra CSC codes:

After extracting all CSC folders from different ROMs region, first copy and paste them in system\csc folder then you need to go to system directory and open SW_Configuration.xml and add all CSC folders you just paste:

<NbCustomer>[B][COLOR="Blue"]67[/COLOR][/B]</NbCustomer> [B][COLOR="Green"]<!-- Here enter how many csc code folders you have in system\csc[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ABS[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]AFG[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]AFR[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |--- Here add CSC folders[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ALO[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]
<CustomerData src="/Customer/[B][COLOR="Blue"]ARB[/COLOR][/B]/customer.xml" />[B][COLOR="Green"] |[/COLOR][/B]

..
..
[B][COLOR="Green"]and so on[/COLOR][/B]

And now you are ready to create your multi-languages and multi-csc ROM,, :cool: