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

Documentation improvemation #1104

Merged
merged 24 commits into from
Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9c6e444
initial translate at config page
lucasferreiralimax Jan 10, 2021
eda3bec
docs translate in Portuguese
lucasferreiralimax Jan 13, 2021
38ffb98
adjustment spacing and translate save
lucasferreiralimax Jan 13, 2021
6be3422
Merge remote-tracking branch 'vue-i18n/v8.x' into v8.x
lucasferreiralimax Jan 15, 2021
0875de7
reduce svg sendcloud and improvement viewBox
lucasferreiralimax Jan 15, 2021
bb79adf
improvement img alt, size and reflect information languages
lucasferreiralimax Jan 15, 2021
1d30341
docs: installation reflect information to languages
lucasferreiralimax Jan 15, 2021
f56507b
docs: legacy, api reflect information to languages
lucasferreiralimax Jan 15, 2021
4ff034b
Merge remote-tracking branch 'vue-i18n/v8.x' into v8.x
lucasferreiralimax Jan 17, 2021
d94b193
Adjustment clean of the patreon occurrences
lucasferreiralimax Jan 17, 2021
3c91f9f
docs: guide compoment page reflect information in languages
lucasferreiralimax Jan 17, 2021
f1a0aaf
docs: guide datetime page reflect information in languages
lucasferreiralimax Jan 17, 2021
4bc9654
docs: guide directive page reflect information in languages
lucasferreiralimax Jan 17, 2021
877a0ee
docs: guide fallback page reflect information in languages
lucasferreiralimax Jan 17, 2021
6d7f0e4
docs: guide hot-reload page reflect information in languages
lucasferreiralimax Jan 17, 2021
5719519
docs: guide interpolation page reflect information in languages
lucasferreiralimax Jan 17, 2021
40d6fee
docs: guide lazy-loading page reflect information in languages
lucasferreiralimax Jan 17, 2021
41dc62e
docs: guide locale page reflect information in languages
lucasferreiralimax Jan 17, 2021
ce3f091
docs: guide messages page reflect information in languages
lucasferreiralimax Jan 17, 2021
aee8893
docs: guide number page reflect information in languages
lucasferreiralimax Jan 17, 2021
fc000a6
docs: guide pluralization page reflect information in languages
lucasferreiralimax Jan 17, 2021
b20995b
adjustment link for default pluralization
lucasferreiralimax Jan 17, 2021
3a61903
docs: guide sfc adjustment example scoped style and reflect informati…
lucasferreiralimax Jan 17, 2021
a5a0bbd
docs: guide tooling page reflect information in languages
lucasferreiralimax Jan 17, 2021
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
2 changes: 1 addition & 1 deletion vuepress/pt/guide/lazy-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Lazy loading (carregamento lento) ou carregamento assíncrono de arquivos de tra
Suponde que temos um diretório de projeto com a seguinte estrutura:

```
our-cool-project
nosso-projeto-legal
-dist
-src
--routes
Expand Down
2 changes: 1 addition & 1 deletion vuepress/ru/guide/lazy-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Предположим, что у нас есть каталог проекта следующей структуры:

```
our-cool-project
наш-проект-отлично
-dist
-src
--routes
Expand Down
27 changes: 17 additions & 10 deletions vuepress/zh/guide/lazy-loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,25 @@ function setI18nLanguage (lang) {
return lang
}

export function loadLanguageAsync (lang) {
if (i18n.locale !== lang) {
if (!loadedLanguages.includes(lang)) {
return import(/* webpackChunkName: "lang-[request]" */ `@/lang/${lang}`).then(msgs => {
i18n.setLocaleMessage(lang, msgs.default)
loadedLanguages.push(lang)
return setI18nLanguage(lang)
})
}
export function loadLanguageAsync(lang) {
// 如果语言相同
lucasferreiralimax marked this conversation as resolved.
Show resolved Hide resolved
if (i18n.locale === lang) {
return Promise.resolve(setI18nLanguage(lang))
}

// 如果语言已经加载
if (loadedLanguages.includes(lang)) {
return Promise.resolve(setI18nLanguage(lang))
}
return Promise.resolve(lang)

// 如果尚未加载语言
return import(/* webpackChunkName: "lang-[request]" */ `@/i18n/messages/${lang}.js`).then(
messages => {
i18n.setLocaleMessage(lang, messages.default)
loadedLanguages.push(lang)
return setI18nLanguage(lang)
}
)
}
```

Expand Down