JS web page automatic translation v2.5 released, adding image translation support, etc.

Two lines of js realize fully automatic translation of html. No need to change pages, no language configuration files, no API Key, friendly to SEO!

Upgrade Instructions

  1. Add image translation support translate.images 
  2. Add translate.language.setDefaultTo(...) If it is used for the first time, what language will be displayed by default. For example, if the current local language is Simplified Chinese, if it is set to English, then when the user uses it for the first time, it will be automatically translated into English for display. If the user manually switches to other languages ​​such as Korean, then the user's manual switching will be followed, and Korean will be displayed.
  3. Increase the ability to translate words with the mouse
  4. Added support for dozens of languages ​​such as Italian and Cebuano
  5. Adjust the tag that is ignored by default and remove the i tag
  6. Adjust the translate.user access layer to remove the setting that the homepage defaults to index.html
  7. Optimize translate.api When translating, it will automatically read the translation interface used from the configuration to perform translation operations, without using our official free api.translate.zvo.cn
  8. translate.user adds the ability to redirect static resources to adapt to websites other than the wangmarket CMS website building system
  9. Optimize the use of TCDN additional code, no longer limited to js, ​​you can also add style, html, etc.
  10. Optimize Google Translate adaptation and adapt to its latest free translation interface
  11. Fix TCDN and fix the bug that the source station failed to save
  12. Fix the problem that if there is a line break in the translated text in the translation service, an error will occur

online experience

http://res.zvo.cn/translate/demo.html

quick use

At the end of your webpage, before adding the following code, a language selection label will appear at the bottom of the page: </html> 

< script src = "https://res.zvo.cn/translate/translate.js" >  </ script > 
< script > translate.setUseVersion2(); //Set to use v2.x version translate.language.setLocal( ' chinese_simplified' ); //Set the local language (the language of the current web page). If not set, the default is 'chinese_simplified' Simplified Chinese. You can fill in such as 'english', 'chinese_simplified', etc. For details, please refer to the description at the bottom of the document. translate.execute (); // translate </script>




おすすめ

転載: www.oschina.net/news/251382