diff --git a/src/main/kotlin/com/wilinz/globalization/translator/action/android/TranslateSelectedAction.kt b/src/main/kotlin/com/wilinz/globalization/translator/action/android/TranslateSelectedAction.kt index c374622..fe52a5e 100644 --- a/src/main/kotlin/com/wilinz/globalization/translator/action/android/TranslateSelectedAction.kt +++ b/src/main/kotlin/com/wilinz/globalization/translator/action/android/TranslateSelectedAction.kt @@ -7,6 +7,7 @@ import com.intellij.openapi.actionSystem.PlatformDataKeys import com.wilinz.globalization.translator.i18n.message import com.wilinz.globalization.translator.util.isStringsXmlFile import org.dom4j.io.SAXReader +import java.io.StringReader class TranslateSelectedAction : AnAction() { override fun actionPerformed(e: AnActionEvent) { @@ -18,7 +19,7 @@ class TranslateSelectedAction : AnAction() { e = e, file = file, getDocument = { - SAXReader().read(xml) + StringReader(xml).use { SAXReader().read(it) } }, ) } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 90a5af3..23463ea 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -7,27 +7,47 @@ messages.languages + - Title + readme -

Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml - and java properties file

+

+ Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml + and java properties file +

+Dependencies:Compose for IDE Plugin Development (Experimental) +
- GitHub + More information: GitHub -

Usage:

-
1. Translate the entire document
+
+
+

+ 1.Intellij platform i18n plugin,Auto translate 133 languages for your application with one click,Support Android + strings.xml and java .properties file. +

+

+ 2.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. +

+

+ 3.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. +

+

Usage:

+

1. Translate the entire document

  1. Select the values/strings.xml or .properties file
  2. Right click and select "Translate this file".
  3. Select the languages to be translated.
  4. Click OK.
-
2. Incremental translation
+

2. Incremental translation

  1. In the values/strings.xml or .properties file, select n lines of content you want to translate
  2. Right click and select "Translate to Other Languages".
  3. @@ -36,7 +56,7 @@
- ]]>
+]]> diff --git a/src/main/resources/description.html b/src/main/resources/description.html index 7e286b7..08dc701 100644 --- a/src/main/resources/description.html +++ b/src/main/resources/description.html @@ -2,23 +2,43 @@ - Title + readme -

Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml - and java properties file

+

+ Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml + and java properties file +

+Dependencies:Compose for IDE Plugin Development (Experimental) +
- GitHub + More information: GitHub -

Usage:

-
1. Translate the entire document
+
+
+

+ 1.Intellij platform i18n plugin,Auto translate 133 languages for your application with one click,Support Android + strings.xml and java .properties file. +

+

+ 2.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. +

+

+ 3.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. +

+

Usage:

+

1. Translate the entire document

  1. Select the values/strings.xml or .properties file
  2. Right click and select "Translate this file".
  3. Select the languages to be translated.
  4. Click OK.
-
2. Incremental translation
+

2. Incremental translation

  1. In the values/strings.xml or .properties file, select n lines of content you want to translate
  2. Right click and select "Translate to Other Languages".