Some time ago, because the customer requested to add the Persian language, but currently android2.3.1 does not have this language, the customer must have the Persian language, after a long time of exploration and online help, finally, the Persian language was added.
The following describes how to add a language:
1. Add the abbreviation of language and country internationalization in sdkdemo. mkCodeSuch as Iran: IR, and FA, which is an international standard and cannot be written at will. If you do not know the abbreviation of a country or region, you can search for it online.
Product_locales: =Fa_irEn_us zh_cn en_GB fr_fr it_it es_es ........
Path of sdkdemo. mk: gingerbread \ device \ rockchip \ sdkdemo. mk.
2. Add a Persian font under the framework/base/data/font directory, such as droidsansarabic. TTF.
3. After adding the font, it is necessary to call the font, the file that calls the font is in external/skia/src/ports/SKFontHost-android.app,
Static const fontinitrec gsystemfonts [] = {
{"Droidsans. TTF", gsansnames },
.........
{"Droidsansarabic. TTF", gfbnames },
4. The font is ready, and some makefiles need to be modified. Under external/icu4c/studata/Android. mk:
Config: = $ (word 1 ,\
$ (If $ (findstring AR, $ (product_locales), large )\
$ (If $ (findstring FA, $ (product_locales), large )\
5. Add a new values-fa-RIR folder under frameworks/base/CORE/RES/and create a new strings. xml file.
6. After the preceding five steps are completed, the Persian option will appear in the settings à Language & keyboard à Select language list, but no Persian text will appear after you select Persian. In this case, create a folder named values-fa-RIR under Res/in the corresponding app and translate the strings. xml file. For example, the main app's strings. XML Path is: gingerbread \ packages \ apps \ export top2d_mbx_new \ res \ values-fa-RIR \ strings. xml
Finally, remember:
Make clean
Make prebuild
Make