Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wilinz committed Jul 30, 2022
1 parent fc45bd0 commit 4306618
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -18,7 +19,7 @@ class TranslateSelectedAction : AnAction() {
e = e,
file = file,
getDocument = {
SAXReader().read(xml)
StringReader(xml).use { SAXReader().read(it) }
},
)
}
Expand Down
38 changes: 29 additions & 9 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,47 @@
<resource-bundle>messages.languages</resource-bundle>

<description><![CDATA[
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<title>readme</title>
</head>
<body>
<h3>Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml
and java properties file</h3>
<h3>
Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml
and java properties file
</h3>
<b>Dependencies:<a href="https://plugins.jetbrains.com/plugin/18439-compose-for-ide-plugin-development-experimental-">Compose for IDE Plugin Development (Experimental)</a></b>
<br>
<b>
<a href="https://github.com/wilinz/globalization-translator">GitHub</a>
More information: <a href="https://github.com/wilinz/globalization-translator">GitHub</a>
</b>
<h4>Usage:</h4>
<h5>1. Translate the entire document</h5>
<br>
<br>
<p>
1.Intellij platform i18n plugin,Auto translate 133 languages for your application with one click,Support Android
strings.xml and java .properties file.
</p>
<p>
2.This plugin supports translate Android.xml and java .properties file, which can preserve the placeholders such as
<code>%1$s</code>, <code>%2$d</code>, <code>{0}</code>,<code>{1}</code> and can Reserved escape characters like
<code>\n</code>,<code>\"</code>,<code>\'</code>, etc., support string, string-array, plurals
tag.
</p>
<p>
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.
</p>
<h3>Usage:</h3>
<h3>1. Translate the entire document</h3>
<ol>
<li>Select the values/strings.xml or .properties file</li>
<li>Right click and select "Translate this file".</li>
<li>Select the languages to be translated.</li>
<li>Click OK.</li>
</ol>
<h5>2. Incremental translation</h5>
<h3>2. Incremental translation</h3>
<ol>
<li>In the values/strings.xml or .properties file, select n lines of content you want to translate</li>
<li>Right click and select "Translate to Other Languages".</li>
Expand All @@ -36,7 +56,7 @@
</ol>
</body>
</html>
]]></description>
]]></description>

<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products -->
Expand Down
34 changes: 27 additions & 7 deletions src/main/resources/description.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,43 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<title>readme</title>
</head>
<body>
<h3>Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml
and java properties file</h3>
<h3>
Intellij platform i18n plugin,Generate 131 languages for your application with one click,Support Android strings.xml
and java properties file
</h3>
<b>Dependencies:<a href="https://plugins.jetbrains.com/plugin/18439-compose-for-ide-plugin-development-experimental-">Compose for IDE Plugin Development (Experimental)</a></b>
<br>
<b>
<a href="https://github.com/wilinz/globalization-translator">GitHub</a>
More information: <a href="https://github.com/wilinz/globalization-translator">GitHub</a>
</b>
<h4>Usage:</h4>
<h5>1. Translate the entire document</h5>
<br>
<br>
<p>
1.Intellij platform i18n plugin,Auto translate 133 languages for your application with one click,Support Android
strings.xml and java .properties file.
</p>
<p>
2.This plugin supports translate Android.xml and java .properties file, which can preserve the placeholders such as
<code>%1$s</code>, <code>%2$d</code>, <code>{0}</code>,<code>{1}</code> and can Reserved escape characters like
<code>\n</code>,<code>\"</code>,<code>\'</code>, etc., support string, string-array, plurals
tag.
</p>
<p>
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.
</p>
<h3>Usage:</h3>
<h3>1. Translate the entire document</h3>
<ol>
<li>Select the values/strings.xml or .properties file</li>
<li>Right click and select "Translate this file".</li>
<li>Select the languages to be translated.</li>
<li>Click OK.</li>
</ol>
<h5>2. Incremental translation</h5>
<h3>2. Incremental translation</h3>
<ol>
<li>In the values/strings.xml or .properties file, select n lines of content you want to translate</li>
<li>Right click and select "Translate to Other Languages".</li>
Expand Down

0 comments on commit 4306618

Please sign in to comment.