Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support ja #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To use, press `F1` then type `Open Vue Docs` then press `Enter`, select the desi
+ By default, the VS Code interface language will be selected for the docks. This can be changed in the settings:

> File -> Preferences -> Settings -> Vue docs configuration ->
> ` "vueDocs.lang": "ru | en | zh" `
> ` "vueDocs.lang": "ru | en | zh | ja" `

+ It is also possible to add custom links to sites that interest you.
> File -> Preferences -> Settings -> Vue docs configuration ->
Expand All @@ -37,7 +37,7 @@ To use, press `F1` then type `Open Vue Docs` then press `Enter`, select the desi
+ Поумолчанию, для доков будет выбран язык интерфейса VS Code. Это можно изменить в настройках:

> Параметры -> Vue docs configuration ->
> ` "vueDocs.lang": "ru | en | zh" `
> ` "vueDocs.lang": "ru | en | zh | ja" `

+ Также есть возможность добавить пользовательские ссылки на интересующие вас сайты.
> Параметры -> Vue docs configuration ->
Expand Down
12 changes: 10 additions & 2 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getWebviewContent = (uri) => {
};

const getLang = () => {
const supportedLangs = ['ru', 'en', 'zh'];
const supportedLangs = ['ru', 'en', 'zh', 'ja'];
const configLang = vscode.workspace.getConfiguration().vueDocs.lang;
/* eslint "no-nested-ternary": 0 */
const interfaceLang = vscode.env.language.includes('ru')
Expand All @@ -38,7 +38,9 @@ const getLang = () => {
? 'en'
: vscode.env.language.includes('zh')
? 'zh'
: null;
: vscode.env.language.includes('ja')
? 'ja'
: null;

// console.log(interfaceLang);
if (configLang !== '') {
Expand All @@ -62,31 +64,37 @@ const getURIof = (item = '', lang = 'en') => {
en: 'https://vuejs.org/v2/guide/',
ru: 'https://ru.vuejs.org/v2/guide/',
zh: 'https://cn.vuejs.org/v2/guide/',
ja: 'https://jp.vuejs.org/v2/guide/',
},
Vuex: {
en: 'https://vuex.vuejs.org/en/',
ru: 'https://vuex.vuejs.org/ru/',
zh: 'https://vuex.vuejs.org/zh/',
ja: 'https://vuex.vuejs.org/ja/',
},
'Vue Router': {
en: 'https://router.vuejs.org/en/',
ru: 'https://router.vuejs.org/ru/',
zh: 'https://router.vuejs.org/zh/',
ja: 'https://router.vuejs.org/ja/',
},
'Vue SSR': {
en: 'https://ssr.vuejs.org/en/',
ru: 'https://ssr.vuejs.org/ru/',
zh: 'https://ssr.vuejs.org/zh/',
ja: 'https://ssr.vuejs.org/ja/',
},
'Nuxt.js': {
en: 'https://nuxtjs.org/guide',
ru: 'https://ru.nuxtjs.org/guide',
zh: 'https://zh.nuxtjs.org/guide',
ja: 'https://ja.nuxtjs.org/guide',
},
VuePress: {
en: 'https://vuepress.vuejs.org/guide/',
ru: 'https://vuepress-lrouuhpdsl.now.sh/ru/guide/', // FIXME: когда выйдет перевод на оф сайте
zh: 'https://vuepress.vuejs.org/zh/guide/',
ja: 'https://vuepress.vuejs.org/guide/', // FIXME: doesn't support ja
},
};

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"enum": [
"ru",
"en",
"zh"
"zh",
"ja"
],
"default": "",
"description": "предпочтительный язык для документации. поумолчанию, будет выбран язык интерфейса vs code.\n preferred language for documentation. By default, the interface language vs code"
Expand Down