Android Platform SDK- where it is?
'platforms\android-XX\data\res'
folder (where XX represents the Android version). Within this folder, you will find numerous sub-folders named 'values'
with different suffixes corresponding to the target languages. By opening any 'strings.xml'
file from these folders, you will discover an extensive list of resource strings that have been localized for the respective language. Leveraging this extensive localization database in all our applications can significantly reduce the time and costs involved in project localization. Import Android Platform SDK localization terms.
TsiLang Dictionary Manager (starting from version 4.0.7) offers the ability to import these localization strings into the dictionary. This means that you can simply utilize the ‘Auto-translate’ feature from any TsiLang editor to automatically insert them into your projects. Additionally, with just a few simple steps, you can create a comprehensive dictionary with translations for commonly used user interface terms.
Just a few easy steps!
Let’s begin by creating a new dictionary file and naming it ‘android.dic’ (although you can use your existing dictionary and add the new content to it). Open the Dictionary Manager and you will be presented with its main window:
In the application’s menu, select the ‘Import’ command and choose the Android SDK localization XML file from the Platform SDK folder, for example:
“C:\Users\Public\Documents\Embarcadero\Studio\15.0\PlatformSDKs\adt-bundle-windows-x86-20131030\sdk\platforms\android-19\data\res\values\strings.xml”.
So let’s start with content from “values” folder (without any suffixes) as it contains the default English localization.
Import XML Wizard.
In the “Import XML” Wizard select “Android SDK Localization File” option as XML format:
So Dictionary Manager will know how to parse the XML file.
Then click the “Next” button to continue.
On the next step, activate “Simple importing” option to speed-up the importing process since our dictionary is empty at this step.
Android Platform SDK localization file content.
The Android Platform SDK localization XML file contains string entries identified with the ‘name’ attribute, and the localized content is stored in the value of each XML entry. The ‘name’ attribute will also be used to identify the entry in the dictionary, so it will be imported as a separate language. Select the name for this language in the dictionary. We recommend using the default value ‘Android_Name_ID’ as the language name. However, you can always enter your own name for this language. Also, specify the language name for the string localization values from the importing file. Since we have selected the ‘default’ (English) localization file, we will name the importing language as ‘English’.
Click ‘Next’ after you have specified the language names. The Wizard will then perform the import using the gathered information. Once the importing process is complete, simply close the Wizard. The Dictionary Manager will now display the newly imported languages:
Adding more languages from Android Platform SDK localization files.
Now our dictionary includes the Android string ID language and English localization for strings used in the Android Platform SDK. To add more languages, we will repeat the steps above. Run the ‘Import XML’ Wizard again, this time with other 'strings.xml'
files from the 'values'
sub-folders that correspond to the desired languages. For example, to add the German language, you can import strings from the 'values-de'
sub-folder, and to add the French language, you can import strings from the 'values-fr'
sub-folder.
Note: Make sure to activate the ‘Smart Importing’ option while importing!
Conclusion
As you can see, building your own dictionary with approximately 1600 localization items took less than a couple of minutes. Now you have a robust extension to your localization database that can assist in translating your multi-language applications, even without the need for a translator service. Simply utilize the ‘Auto-translate’ feature from SIL Editor or TsiLang Translations Editor to retrieve translations from the dictionary for your projects.
You can download this article in PDF format here: creating_localization_dictionary_using_android_sdk_resources.pdf.