Home > Development Tools > VSCode > A brief discussion on vscode using i18n-ally plug-in to achieve internationalization

A brief discussion on vscode using i18n-ally plug-in to achieve internationalization

青灯夜游
Release: 2021-06-07 11:30:50
forward
8014 people have browsed it

This article recommends a vscode plug-in "i18n-ally", which can be used to build and automate translations and achieve internationalization. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

A brief discussion on vscode using i18n-ally plug-in to achieve internationalization

For a long time, Vue I18n was used in Vue.js to implement international multi-language settings. In the past, it was necessary to manually find files and write translations, which was relatively cumbersome and complicated.

Now I know a very useful vs code plug-in i18n-ally from my colleagues, which can build and automate translation, share it with everyone, and also make a record for myself.

[Recommended learning: "vscode tutorial", "vue.js tutorial"]

A brief discussion on vscode using i18n-ally plug-in to achieve internationalization

And , i18n-ally is an officially recommended third-party tool. It is really easy to use. Anyone who uses it will know.

First install the plug-in i18n-ally in vs code.

A brief discussion on vscode using i18n-ally plug-in to achieve internationalization

Secondly, this is the configuration, as follows:

settings.json:

  // 安装插件后可能会自动在工作区生成这行配置
  "i18n-ally.localesPaths": [
    "src/i18n"
  ],
  // 以下需要自己配置
  "i18n-ally.keystyle": "nested",
  "i18n-ally.namespace": true,
  "i18n-ally.enabledParsers": [
    "json",
    "js"
  ],
  "i18n-ally.sortKeys": true,
  "i18n-ally.sourceLanguage": "zh-hans",
  "i18n-ally.displayLanguage": "en-us",
Copy after login

Then, add the previous js file Change it to json format and you can use it. The documentation on github gives many demonstrations and will not be repeated here.

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of A brief discussion on vscode using i18n-ally plug-in to achieve internationalization. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template