Intellij platform i18n plugin,Auto translate 131 languages for your application with one click,Support Android strings.xml and java .properties file
This plugin supports translate Android.xml and java .properties file, which can preserve the placeholders such as %1$s
, %2$d
, {0}
,{1}
and can Reserved escape characters like \n
,\"
,\'
, etc., support string
, string-array
, plurals
tag.
Advantages of this plugin compared to other plugins: fast translation speed, translate files into 131 languages in less than two minutes, support for retaining placeholders, support for incremental translation.
Intellij platform -> Settings -> Plugins -> Marketplace -> Search "GlobalizationTranslator" -> Install
or
Download GlobalizationTranslator.zip from here -> Settings -> Plugins -> Click Settings Icon Button -> Install Plugin form Disk
Dependency:Compose for IDE Plugin Development (Experimental)
1. Intellij Version >= 213:
Settings -> Plugins -> Marketplace -> Search "Compose for IDE Plugin Development (Experimental)" -> Install
2. Intellij Version < 213:
Click Here Download
-> Settings -> Plugins -> Click Settings Icon Button -> Install Plugin form Disk
- Translate the entire document
- Select the values/strings.xml or .properties file
- Right click and select "Translate this file".
- Select the languages to be translated.
- Click OK.
- Incremental translation
- In the values/strings.xml or .properties file, select n lines of content you want to translate
- Right click and select "Translate to Other Languages".
- Select the languages to be translated.
- Click OK.
After translating Android strings.xml, many values-** folders will be generated, which is very confusing. At this time, we can create a new folder in the app/main directory and name it at will, such as res-i18n , Then create a new values directory in the res-i18n directory, and copy the previous res/value/strings.xml to the values directory Then edit build.gradle , add res.srcDirs += "src/main/res-i18n" under sourceSets/main, where res-i18n is the name of the newly created folder, and then click gradle sync. After that, the files generated by the translation are all in the res-i18n directory, which looks a lot more refreshing.
android {
//...
sourceSets {
main {
res.srcDirs += "src/main/res-i18n"
}
}
}
Be careful to choose the source language correctly, otherwise the translation may not be accurate
1.For Android strings.xml please add translatable="false" for strings not to be translated:
<string name="test" translatable="false">Test</string>
2.For .properties file,please store untranslated strings and translated strings in separate files
https://github.com/wilinz/Sponsor
Run command in terminal: ./gradlew runIde