Coder Social home page Coder Social logo

airsaid / androidlocalizeplugin Goto Github PK

View Code? Open in Web Editor NEW
565.0 6.0 87.0 21.45 MB

:earth_asia: Android localization plugin. supports multiple languages and multiple translators.

Home Page: https://plugins.jetbrains.com/plugin/11174-androidlocalize

License: Apache License 2.0

Java 97.89% Kotlin 2.11%
android idea plugin localize i18n strings localization intellij-plugin translation

androidlocalizeplugin's Introduction

English | 简体中文

image AndroidLocalizePlugin

Plugin Version Plugin Rating Build

Website | GitHub | Issues | Reviews

Android localization plugin. supports multiple languages and multiple translators.

Features

  • Multiple translator support:
    • Google translator.
    • Microsoft translator.
    • Baidu translator.
    • Youdao translator.
    • Ali translator.
    • DeepL translator.
    • OpenAI ChatGPT translator.
  • Supports up to 100+ languages.
  • One key generates all translation files.
  • Support no translation of existing string.
  • Support for specifying that text is not translated.
  • Support for caching translated strings.
  • Support to set the translation interval time.

Usage

  • Step 1: Select the values/strings.xml(or any string resource in values directory).
  • Step 2: Right click and select "Translate to Other Languages".
  • Step 3: Select the languages to be translated.
  • Step 4: Click OK.

Preview

image image

Install

Install Plugin

FAQ

  • Q: How to ignore translation?

    A: Use the translatable or xliff:g tags. for example:

    <string name="app_name" translatable="false">HelloAndroid</string>
    <string name="star_rating">Check out our 5<xliff:g id="star">\u2605</xliff:g></string>
    <string name="app_home_url">Visit us at <xliff:g id="application_homepage">https://github.com/Airsaid/AndroidLocalizePlugin</xliff:g></string>
    <string name="prod_name">Learn more at <xliff:g id="game_group">Muggle Game Studio</xliff:g></string>
    

    Note: Display one line without extra line breaks and spaces in between.

  • Q: Translation failure: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode

    A: If you are using the default translation engine (Google), then you can try switching to another engine on the settings page and use your own account for translation. Because the default translation engine is not stable.

ChangeLog

ChangeLog

Support and Donations

You can contribute and support this project by doing any of the following:

  • Star the project on GitHub.

  • Give feedback.

  • Commit PR.

  • Contribute your ideas/suggestions.

  • Share the plugin with your friends/colleagues.

  • If you like the plugin, please consider making a donation to keep the plugin active:

    Open Collective WeChat Pay Alipay
    Donate To Our Collective WeChat Play Alipay

Thank you for your support!

Sponsors

Development powered by JetBrains

License

Copyright 2018 Airsaid. https://github.com/airsaid

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

androidlocalizeplugin's People

Contributors

actions-user avatar airsaid avatar dependabot[bot] avatar frogggias avatar github-actions[bot] avatar herberlin avatar musagil avatar rbenza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

androidlocalizeplugin's Issues

Single quote character must be escaped in strings.xml

First, thanks a lot for this great plugin: amazing :-)

Please select the affected platforms

  • N/A

Please select the translator to use

  • N/A

Version of Plugin and IDE

  • Plugin Version: 2.5.0
  • IDE Version: Android Studio Bumblebee | 2021.1.1 Patch 2

Issue details

Translation result containing single quote characters should contain 'escaped single quote'.
Full list of 'special characters' which need to be escpaed is availalbe here: https://developer.android.com/guide/topics/resources/string-resource#escaping_quotes .
(single quote, double quotes, etc...)

Example:

English source
<string name="contacts_select_contact_fragment_text_hint">I enter the name of the contact here</string>

French result (when using this plugin):
<string name="contacts_select_contact_fragment_text_hint">J'entre le nom du contact ici</string>

which is not correct.
Instead of "j'entre", we should have "j\'entre" because single quote must be escaped in strings.xml.
Result should be:
<string name="contacts_select_contact_fragment_text_hint">J\'entre le nom du contact ici</string>

Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio - 4.2.2
  • IntelliJ IDEA

Please select the translator to use

  • Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version: 2.3.0
  • Android Studio Version: 4.2.2

Issue details

Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate "My Application" text from Auto language to German language: java.io.IOException: Server returned HTTP response code: 429 for URL: https://translate.google.cn/translate_a/single?sl=auto&tl=de&client=gtx&dt=t&dj=1&ie=UTF-8&oe=UTF-8&tk=941359.572215

Please add new features
Add Google Client ID and API key easy for paid libary

设置代理后依然翻译后内容为空

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio 3.5.3

Version of Plugin and IDE

  • Plugin Version: 1.4
  • IDE Version: 3.5.3

Issue details

使用插件 1.4版本 设置代理后,依然翻译为空,无法使用

cannot retry due to redirection, in streaming mode

Please ensure you have given all the following requested information in your report.
Please select the affected platforms

[ x] Android Studio

Please select the translator to use

Google

Version of Plugin and IDE

Plugin Version:2.3.0
IDE Version:2020.3.1

Issue details

Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate "Text Symbol" text from Auto language to Marathi language: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode

长句子带特殊符号标签翻译失败

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:2.2.0
  • IDE Version:

Issue details

Please provide the details of your issue

com.airsaid.localization.translate.TranslationException: Failed to translate "Over " text from Auto language to Arabic language: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode

下边是完整句子:

Over <xliff:g id="count">%1$d</xliff:g> users download this file in 24 hours and <xliff:g id="percent">%2$d%%</xliff:g> downloads success.
Recommed you to wait patiently.

关于字符乱码的建议

作者的这个插件挺不错的。使用过程中有点小问题,字符乱码了,在此给下建议哈.

修改TranslateTask这里类里面的write()方法,在写文件时指定utf-8编码:

try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, false), "UTF-8"))) {
...
} catch (IOException e) {
e.printStackTrace();
}

代码亲测有效(我fork了项目,针对我想要的效果改进了下)

429 too many requests

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [ x] Android Studio

Please select the translator to use

  • Google

Version of Plugin and IDE

  • Plugin Version:2.3.0
  • IDE Version:2020.3.1

Issue details

Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate "Call" text from Auto language to Afrikaans language: java.io.IOException: Server returned HTTP response code: 429 for URL: https://translate.google.cn/translate_a/single?sl=auto&tl=af&client=gtx&dt=t&dj=1&ie=UTF-8&oe=UTF-8&tk=756340.876666

能不能自己指定翻译渠道 大佬

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue

英语句子标点符号后有空格的,会被截断

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue

英文句子句子中在标点符号后,如果有空格,会被截断,仅翻译前半部分

如何设置不翻译的标签,有一些css标签也给翻译了

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:1.3
  • IDE Version:3.5.0

Issue details

Please provide the details of your issue

css标签页被翻译了,如何避免 :
<string name="ok"><u><big></big></u></string>

<string name="ok"><u><大></大></u></string>

Invalid Sign(54001) error

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Please select the translator to use

  • Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version: LATEST
  • IDE Version: ArticFox 2020.3.1

Issue details

Please provide the details of your issue

Failed to translate "App" text from Auto language to Korean language: Invalid Sign(54001)

Error code appears

Unescaped apostrophes

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [x ] Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:1.3
  • IDE Version:Android Studio 3.5
    Build #AI-191.8026.42.35.5791312, built on August 9, 2019
    JRE: 1.8.0_202-release-1483-b49-5587405 amd64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Linux 5.0.0-27-generic

Issue details

Following on from #18 the apostrophes in the translated text are not escaped and Android Studio marks them as an error.

String Escapes

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version: latest
  • IDE Version: 3.4.2

Issue details

Escapes in string resources break the translation.

When translating remove every "" from the source string and it would be great if you could escape the translated strings after.

Not ignoring parts of strings marked to ignore

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [ X] Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:1.3
  • IDE Version:Android Studio 3.5
    Build #AI-191.8026.42.35.5791312, built on August 9, 2019
    JRE: 1.8.0_202-release-1483-b49-5587405 amd64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Linux 5.0.0-27-generic

Issue details

According to https://developer.android.com/guide/topics/resources/localization, it should be possible to mark sections to be not translated with xliff:g</xliff:g>, such as number placeholders and embedded format strings. However the plugin doesn't honour that.

Attempting to translate this

<string name="configuration_error_explaination">Your controller reported the following configuration error:<xliff:g>\n\n%1$s\n\n</xliff:g>Go into the Tuning section, fix the problem and power cycle your controller.</string>

into French gives

<string name="configuration_error_explaination">Votre contrôleur a signalé l'erreur de configuration suivante: <xliff: g> \ n \ n% 1 $ \ n \ n </ xliff: g> Allez dans la section Tuning, fixer le cycle de problème et la puissance de votre contrôleur.</string>

Which breaks the \n and the formatted number.

Multiple sentences in a single string seem to break the translation

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version: 2.1.0
  • IDE Version: 4.2.1

Issue details

Please provide the details of your issue

When a string consists of two or more sentences only the first gets translated.

For example "This is a test string. Can you translate the second sentence too?" only translates this "This is a test string. "

Using the same string in google translate works fine.

Tags with empty bodies

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [ X ] Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version: 1.3
  • IDE Version: 3.2.1

Issue details

After translation I get tags with empty bodies for any language:

< string name="app_name"></ string >
< string name="tour_text_a"></ string >
< string name="tour_text_b"></ string >
< string name="tour_text_c"></ string >
< string name="tour_text_d"></ string >
< string name="tour_text_e"></ string >

I tried removing the plugin and installing again

Thank you

翻译得到的全是空文本

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue

翻译全是乱码

��Q���_�l���Լ���Ո��server_client_id ��Q���_�l���Լ���Ո��appid ��Q���_�l���Լ���Ո��protocol_scheme

Android studio chipmunk canary 7 gives error!

Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate "My Application" text from Auto language to *** language: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode

里面是空的标签

暂无数据
得到的string文件里面都没有翻译,啥情况???

新生产的文件里面都是这样。。。。。。。。。。。。

为什么转换后出现乱码呢

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [√ ] Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:2.2.0
  • IDE Version:4.1

Issue details

Please provide the details of your issue
不知道是操作不对嘛,转换后values语言乱码
如“\u5378\u8F7D\u5E94\u7528”这样显示。

Question about translating a specific string

Tell me if it will be difficult to implement such a function: When you click on the string tag, call up a menu for translating this particular string into other languages. This function is needed when the text of some line has been changed and it needs to be changed in all other languages. In such a situation, it is not reasonable to call a complete overwrite of the entire file, because there are texts that professional translators have worked on.

期望有全选按钮

期望选择语言时有全选按钮,每一个分别勾选比较麻烦,谢谢!

Android Studio 3.6 Canary 4
Build #AI-191.7479.19.36.5679705, built on June 22, 2019
JRE: 1.8.0_202-release-1483-b49-5587405 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.5

Code question.

Why did you introduce AbstractValue entities when you can work with XmlTag? Instead of keeping copies of the xmlTag , you write their text into your own entities, overwrite attributes, such as translatable, then translate and manually add the necessary tags back, such as . I think you've made it more difficult.

能否只针对我新增的或有修改的进行翻译

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Please select the translator to use

  • Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version:最新
  • IDE Version:最新

Issue details

Please provide the details of your issue

能否仅针对新增的或修改的进行翻译,而不改变其他的,因为翻译文件中往往有一些特殊符号或其他内容,一更改会出问题。

所以能不能有一个选项支持仅插入新增的翻译结果,或者能够让用户选择想要翻译修改的字符串

Translation error

Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate "SystemService" text from Auto language to Chinese Simplified language: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode

amdroid studio 版本 2021.1.1 patch 2

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Please select the translator to use

  • Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue

翻译英语出错
Translation error: com.airsaid.localization.translate.TranslationException: Failed to translate "我是测试" text from Auto language to English language: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode

Api key for Google translations

There is not enough opportunity to use my Api key for Google translations, I was quickly blocked in an interval of 2 seconds. Please add this feature

百度翻译报错

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version: 2.0.0
  • IDE Version: 4.2.1

Issue details

百度翻译报错:Invalid Access Limit(54003)

翻译都是空白的,

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [√ ] Android Studio
  • IntelliJ IDEA

Please select the translator to use

  • [ √] Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version:3.4.2
  • IDE Version:183

Issue details

1.版本是1.5的,翻译都是空白如下图:
1633943124(1)
2.Android Localize 没有翻译的渠道选择如下图
image
3.下载2.3.0的版本安装报如下错误
image

卡死人不偿命

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [1 ] Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue
啥时候能解决一下啊,哥

卡死问题什么时候能解决呢?

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue

翻译失败: connect timed out

提示:
com.airsaid.localization.translate.TranslationException: Failed to translate "Whale Booster" text from Auto language to Japanese language: java.net.SocketTimeoutException: connect timed out
使用环境是在国内, 用google翻译.
vpn可以正常使用, 网页正常打开. 请问这个问题该如何解决

cannot stop; suffer from vpn connection problems.

Issue details

Hit 'convert to oher languages' will start a background process that user cannot stop.

Further, if user's network cannot connect to google translate, then this process will wait minutes for timeout for each language and create several empty tags.

Thus, we need 1. Better control over the background process. 2. Save and load for selected languages .

Please select the affected platforms

  • Android Studio

Version of Plugin and IDE

  • Plugin Version: AndroidLocalizePluginv1.3
  • IDE Version: Android Studio3.5

修复了Google免费翻译和百度API翻译

Please ensure you have given all the following requested information in your report.

修复了Google免费翻译和百度API翻译,正常使用,已申请PR
代码糙,可以参考新URL 修复
感谢作者~
https://github.com/YaronWong/AndroidLocalizePluginFix?organization=YaronWong&organization=YaronWong

Please select the affected platforms

  • Android Studio
  • IntelliJ IDEA

Please select the translator to use

  • Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version:
  • IDE Version:

Issue details

Please provide the details of your issue

一两个string翻译不了,就卡出来了

Please ensure you have given all the following requested information in your report.

Please select the affected platforms

  • [ ✅] Android Studio
  • IntelliJ IDEA

Please select the translator to use

  • [ ✅] Google
  • Microsoft
  • Baidu
  • Youdao

Version of Plugin and IDE

  • Plugin Version:最新
  • IDE Version:android studio 最新

Issue details

一两个string翻译不了,就卡出来了,没有成功过一次。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.