Skip to content

Commit 996a825

Browse files
authored
Add custom keywords, and Chinese translation (#35)
* feat: support custom extract keyword; add zh-CN * useGettext * feat: custom global properties; add zh translations * fix lint * self review code * line number * docs: add translation notes * docs: update readme links * docs: fix header level Co-authored-by: youthlin <[email protected]>
1 parent ec404d9 commit 996a825

36 files changed

+999
-59
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<p align="center">
1+
<h1 align="center">
22
<a href="https://www.npmjs.com/package/vue3-gettext" target="_blank">
3-
<h1>Vue 3 Gettext 💬</h1>
3+
Vue 3 Gettext 💬
44
</a>
5-
</p>
5+
</h1>
66
<br/>
77

88
Translate [Vue 3](http://vuejs.org) applications with [gettext](https://en.wikipedia.org/wiki/Gettext).
99

1010
<br>
1111
<p align="center">
12-
<a href="https://jshmrtn.github.io/vue3-gettext/">Getting started</a> | <a href="https://jshmrtn.github.io/vue3-gettext/demo.html">Demo</a> | <a href="https://jshmrtn.github.io/vue3-gettext/setup.html">Documentation</a>
12+
<a href="https://jshmrtn.github.io/vue3-gettext/">Getting started</a> | <a href="https://jshmrtn.github.io/vue3-gettext/demo.html">Demo</a> | <a href="https://jshmrtn.github.io/vue3-gettext/setup.html">Documentation</a> | <a href="README_zh.md">中文</a>
1313
</p>
1414
<br>
1515

README_zh.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<h1 align="center">
2+
<a href="https://www.npmjs.com/package/vue3-gettext" target="_blank">Vue 3 Gettext 💬</a>
3+
</h1>
4+
<br/>
5+
6+
使用 [gettext](https://en.wikipedia.org/wiki/Gettext) 国际化 [Vue 3](http://vuejs.org) 应用程序。
7+
8+
<br>
9+
<p align="center">
10+
<a href="https://jshmrtn.github.io/vue3-gettext/zh/">快速上手</a> | <a href="https://jshmrtn.github.io/vue3-gettext/zh/demo.html">在线演示</a> | <a href="https://jshmrtn.github.io/vue3-gettext/zh/setup.html">使用文档</a> | <a href="README.md">English</a>
11+
</p>
12+
<br>
13+
14+
## 基本用法
15+
16+
模版:
17+
18+
```jsx
19+
<span>
20+
{{ $gettext("I'm %{age} years old!", { age: 32 }) }}
21+
</span>
22+
```
23+
24+
代码:
25+
26+
```ts
27+
const { $gettext } = useGettext();
28+
29+
console.log($gettext("Hello World!"));
30+
```
31+
32+
## 特性
33+
34+
- 简单、符合人体工学的 API 接口
35+
- 支持响应式翻译(Vue 模板和 TypeScript/JavaScript 代码)
36+
- 提供 CLI 工具自动从代码文件中提取翻译文本
37+
- 支持复数和上下文翻译
38+
39+
## 贡献
40+
41+
提交 PR 前请确保代码已经格式化(项目中已有 `prettier` 配置),而且测试(`npm run test`)已通过。
42+
43+
并且写清楚改了什么以及为什么要这样改。
44+
45+
46+
## 致谢
47+
本项目在很大程度上依赖于 [`vue-gettext`](https://github.com/Polyconseil/vue-gettext/) 所做的工作.
48+
49+
## License
50+
51+
[MIT](http://opensource.org/licenses/MIT)

dev/App.vue

+11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import DemoIf from "./components/DemoIf.vue";
4444
import DemoMultilines from "./components/DemoMultilines.vue";
4545
import DemoPlural from "./components/DemoPlural.vue";
4646
import LanguageSelect from "./components/LanguageSelect.vue";
47+
import { useGettext } from "/@gettext/";
4748
4849
export default {
4950
name: "App",
@@ -57,6 +58,16 @@ export default {
5758
DemoPlural,
5859
LanguageSelect,
5960
},
61+
props: {
62+
lang: {
63+
type: String,
64+
default: 'en_GB',
65+
}
66+
},
67+
mounted() {
68+
const gettext = useGettext();
69+
gettext.current = this.lang;
70+
},
6071
};
6172
</script>
6273

dev/components/DemoAlert.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default {
2121
}),
2222
methods: {
2323
alert() {
24-
const msg = this.$gettext("Good bye!");
24+
const msg = this.__("Good bye!");// use jsExtractorOpts in gettext.config.js to extract custom keywords
2525
return window.alert(msg);
2626
},
2727
decrease() {
@@ -32,7 +32,7 @@ export default {
3232
this.n += 1;
3333
},
3434
alertPlural(n) {
35-
const msg = this.$ngettext("%{ n } car", "%{ n } cars", n, { n });
35+
const msg = this._n("%{ n } car", "%{ n } cars", n, { n });
3636
return window.alert(msg);
3737
},
3838
},

dev/components/DemoDateFormat.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
<script>
88
import { useGettext } from "/@gettext/";
9-
import { format, subDays } from "date-fns";
9+
import { format } from "date-fns";
1010
import en from "date-fns/locale/en-US";
1111
import fr from "date-fns/locale/fr";
1212
import it from "date-fns/locale/it";
13+
import zh from "date-fns/locale/zh-CN";
1314
1415
export default {
1516
data: () => ({
@@ -18,7 +19,7 @@ export default {
1819
methods: {
1920
dateFormat: (value, formatString) => {
2021
const gettext = useGettext();
21-
const locales = { en, fr, it };
22+
const locales = { en, fr, it, zh };
2223
const locale = locales[gettext.current.toLowerCase().split("_")[0]];
2324
return format(value, formatString ? formatString : "EEEE d LLLL HH:mm:ss", { locale });
2425
},

dev/i18n.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import translations from "./language/translations.json";
2+
import { createGettext } from "/@gettext/";
3+
4+
const gettext = createGettext({
5+
availableLanguages: {
6+
en_GB: "British English",
7+
fr_FR: "Français",
8+
it_IT: "Italiano",
9+
zh_CN: "简体中文",
10+
},
11+
defaultLanguage: "en_GB",
12+
translations: translations,
13+
setGlobalProperties: true,
14+
globalProperties: { // custom global properties name
15+
gettext: ['$gettext', '__'],
16+
ngettext: ['$ngettext', '_n'],
17+
},
18+
});
19+
20+
export { gettext };

dev/language/LINGUAS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
en_GB fr_FR it_IT
1+
en_GB fr_FR it_IT zh_CN

dev/language/en_GB/app.po

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ msgstr ""
5656
"Forgotten your password? Enter your \"email address\" below,\n"
5757
" and we'll email instructions for setting a new one."
5858

59+
#. use jsExtractorOpts in gettext.config.js to extract custom keywords
5960
#: dev/components/DemoAlert.vue:24
6061
msgid "Good bye!"
6162
msgstr ""
@@ -105,6 +106,6 @@ msgstr ""
105106
"Use default singular or plural form when there is no translation. This is "
106107
"left untranslated on purpose."
107108

108-
#: dev/components/DemoIf.vue:5
109+
#: dev/components/DemoIf.vue:4 dev/components/DemoIf.vue:5
109110
msgid "Welcome %{ name }"
110111
msgstr "Welcome %{ name }"

dev/language/fr_FR/app.po

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ msgstr ""
6161
"Mot de passe perdu ? Saisissez votre \"adresse électronique\" ci-dessous\n"
6262
"et nous vous enverrons les instructions pour en créer un nouveau."
6363

64+
#. use jsExtractorOpts in gettext.config.js to extract custom keywords
6465
#: dev/components/DemoAlert.vue:24
6566
msgid "Good bye!"
6667
msgstr "Au revoir !"
@@ -108,6 +109,6 @@ msgid ""
108109
"left untranslated on purpose."
109110
msgstr ""
110111

111-
#: dev/components/DemoIf.vue:5
112+
#: dev/components/DemoIf.vue:4 dev/components/DemoIf.vue:5
112113
msgid "Welcome %{ name }"
113114
msgstr "Bienvenue %{ name }"

dev/language/it_IT/app.po

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ msgstr ""
6161
"Password dimenticata? Inserisci il tuo \"indirizzo email\" qui\n"
6262
"sotto, e ti invieremo istruzioni per impostarne una nuova."
6363

64+
#. use jsExtractorOpts in gettext.config.js to extract custom keywords
6465
#: dev/components/DemoAlert.vue:24
6566
msgid "Good bye!"
6667
msgstr "Arriverdeci!"
@@ -108,6 +109,6 @@ msgid ""
108109
"left untranslated on purpose."
109110
msgstr ""
110111

111-
#: dev/components/DemoIf.vue:5
112+
#: dev/components/DemoIf.vue:4 dev/components/DemoIf.vue:5
112113
msgid "Welcome %{ name }"
113114
msgstr "Benvenuto %{ name }"

dev/language/messages.pot

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ msgstr ""
4040
msgid "Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one."
4141
msgstr ""
4242

43+
#. use jsExtractorOpts in gettext.config.js to extract custom keywords
4344
#: dev/components/DemoAlert.vue:24
4445
msgid "Good bye!"
4546
msgstr ""
@@ -86,6 +87,7 @@ msgstr ""
8687
msgid "Use default singular or plural form when there is no translation. This is left untranslated on purpose."
8788
msgstr ""
8889

90+
#: dev/components/DemoIf.vue:4
8991
#: dev/components/DemoIf.vue:5
9092
msgid "Welcome %{ name }"
9193
msgstr ""

dev/language/translations.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"en_GB":{"%{ countForUntranslated } item. This is left untranslated on purpose.":["%{ countForUntranslated } item. This is left untranslated on purpose.","%{ countForUntranslated } items. This is left untranslated on purpose."],"%{ n } book":["%{ n } book","%{ n } books"],"%{ nComputed } book":["%{ nComputed } book","%{ nComputed } books"],"<strong>%{ count }</strong> apple":["<strong>%{ count }</strong> apple","<strong>%{ count }</strong> apples"],"A <b>random</b> number: <i>%{ random }</i>":"A <b>random</b> number: <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"Forgotten your password? Enter your \"email address\" below,\n and we'll email instructions for setting a new one.","Headline 1":"Headline 1","Headline 2":"Headline 2","Headline 3":"Headline 3","Headline 4":"Headline 4","Hello <strong>%{ name }</strong>":"Hello <strong>%{ name }</strong>","In English, '0' (zero) is always plural.":"In English, '0' (zero) is always plural.","Paragraph":"Paragraph","Select your language:":"Select your language:","This is %{ obj.name }":"This is %{ obj.name }","Use default singular or plural form when there is no translation. This is left untranslated on purpose.":"Use default singular or plural form when there is no translation. This is left untranslated on purpose.","Welcome %{ name }":"Welcome %{ name }"},"fr_FR":{"%{ n } book":["%{ n } livre","%{ n } livres"],"%{ n } car":["%{ n } voiture","%{ n } voitures"],"%{ nComputed } book":["%{ nComputed } livre","%{ nComputed } livres"],"<strong>%{ count }</strong> apple":["<strong>%{ count }</strong> pomme","<strong>%{ count }</strong> pommes"],"A <b>random</b> number: <i>%{ random }</i>":"Un <b>nombre</b> aléatoire : <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"Mot de passe perdu ? Saisissez votre \"adresse électronique\" ci-dessous\net nous vous enverrons les instructions pour en créer un nouveau.","Good bye!":"Au revoir !","Headline 1":"Titre 1","Headline 2":"Titre 2","Headline 3":"Titre 3","Headline 4":"Titre 4","Hello <strong>%{ name }</strong>":"Bonjour <strong>%{ name }</strong>","In English, '0' (zero) is always plural.":"En anglais, '0' (zero) prend toujours le pluriel.","Paragraph":"Paragraphe","Select your language:":"Sélectionner votre langage","This is %{ obj.name }":"C'est %{ obj.name }","Welcome %{ name }":"Bienvenue %{ name }"},"it_IT":{"%{ n } book":["%{ n } libbra","%{ n } libri"],"%{ n } car":["%{ n } auto","%{ n } auto"],"%{ nComputed } book":["%{ nComputed } libbra","%{ nComputed } libri"],"<strong>%{ count }</strong> apple":["<strong>%{ count }</strong> mela","<strong>%{ count }</strong> mele"],"A <b>random</b> number: <i>%{ random }</i>":"Un <b>numero</b> casuale: <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"Password dimenticata? Inserisci il tuo \"indirizzo email\" qui\nsotto, e ti invieremo istruzioni per impostarne una nuova.","Good bye!":"Arriverdeci!","Headline 1":"Titolo 1","Headline 2":"Titolo 2","Headline 3":"Titolo 3","Headline 4":"Titolo 4","Hello <strong>%{ name }</strong>":"Buongiorno <strong>%{ name }</strong>","In English, '0' (zero) is always plural.":"In inglese, '0' (zero) è sempre al plurale.","Paragraph":"Paragrafo","Select your language:":"Seleziona la tua lingua:","This is %{ obj.name }":"Questo è %{ obj.name }","Welcome %{ name }":"Benvenuto %{ name }"}}
1+
{"zh_CN":{"%{ n } book":"%{ n } 本书","%{ n } car":"%{ n } 辆车","%{ nComputed } book":"%{ nComputed } 本书","<strong>%{ count }</strong> apple":"<strong>%{ count }</strong> 个苹果","A <b>random</b> number: <i>%{ random }</i>":"一个<b>随机</b>数: <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"忘记密码了吗?请在下面输入你的「电子邮件地址」,我们将通过电子邮件发送设置新密码的说明。","Good bye!":"再见","Headline 1":"一级标题","Headline 2":"二级标题","Headline 3":"三级标题","Headline 4":"四级标题","Hello <strong>%{ name }</strong>":"<strong>%{ name }</strong> 你好","In English, '0' (zero) is always plural.":"在英语中,0(零)总是复数。","Paragraph":"段落","Select your language:":"请选择语言","This is %{ obj.name }":"这是 %{ obj.name }","Welcome %{ name }":"欢迎 %{ name }"},"en_GB":{"%{ countForUntranslated } item. This is left untranslated on purpose.":["%{ countForUntranslated } item. This is left untranslated on purpose.","%{ countForUntranslated } items. This is left untranslated on purpose."],"%{ n } book":["%{ n } book","%{ n } books"],"%{ nComputed } book":["%{ nComputed } book","%{ nComputed } books"],"<strong>%{ count }</strong> apple":["<strong>%{ count }</strong> apple","<strong>%{ count }</strong> apples"],"A <b>random</b> number: <i>%{ random }</i>":"A <b>random</b> number: <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"Forgotten your password? Enter your \"email address\" below,\n and we'll email instructions for setting a new one.","Headline 1":"Headline 1","Headline 2":"Headline 2","Headline 3":"Headline 3","Headline 4":"Headline 4","Hello <strong>%{ name }</strong>":"Hello <strong>%{ name }</strong>","In English, '0' (zero) is always plural.":"In English, '0' (zero) is always plural.","Paragraph":"Paragraph","Select your language:":"Select your language:","This is %{ obj.name }":"This is %{ obj.name }","Use default singular or plural form when there is no translation. This is left untranslated on purpose.":"Use default singular or plural form when there is no translation. This is left untranslated on purpose.","Welcome %{ name }":"Welcome %{ name }"},"fr_FR":{"%{ n } book":["%{ n } livre","%{ n } livres"],"%{ n } car":["%{ n } voiture","%{ n } voitures"],"%{ nComputed } book":["%{ nComputed } livre","%{ nComputed } livres"],"<strong>%{ count }</strong> apple":["<strong>%{ count }</strong> pomme","<strong>%{ count }</strong> pommes"],"A <b>random</b> number: <i>%{ random }</i>":"Un <b>nombre</b> aléatoire : <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"Mot de passe perdu ? Saisissez votre \"adresse électronique\" ci-dessous\net nous vous enverrons les instructions pour en créer un nouveau.","Good bye!":"Au revoir !","Headline 1":"Titre 1","Headline 2":"Titre 2","Headline 3":"Titre 3","Headline 4":"Titre 4","Hello <strong>%{ name }</strong>":"Bonjour <strong>%{ name }</strong>","In English, '0' (zero) is always plural.":"En anglais, '0' (zero) prend toujours le pluriel.","Paragraph":"Paragraphe","Select your language:":"Sélectionner votre langage","This is %{ obj.name }":"C'est %{ obj.name }","Welcome %{ name }":"Bienvenue %{ name }"},"it_IT":{"%{ n } book":["%{ n } libbra","%{ n } libri"],"%{ n } car":["%{ n } auto","%{ n } auto"],"%{ nComputed } book":["%{ nComputed } libbra","%{ nComputed } libri"],"<strong>%{ count }</strong> apple":["<strong>%{ count }</strong> mela","<strong>%{ count }</strong> mele"],"A <b>random</b> number: <i>%{ random }</i>":"Un <b>numero</b> casuale: <i>%{ random }</i>","Forgotten your password? Enter your \"email address\" below, and we'll email instructions for setting a new one.":"Password dimenticata? Inserisci il tuo \"indirizzo email\" qui\nsotto, e ti invieremo istruzioni per impostarne una nuova.","Good bye!":"Arriverdeci!","Headline 1":"Titolo 1","Headline 2":"Titolo 2","Headline 3":"Titolo 3","Headline 4":"Titolo 4","Hello <strong>%{ name }</strong>":"Buongiorno <strong>%{ name }</strong>","In English, '0' (zero) is always plural.":"In inglese, '0' (zero) è sempre al plurale.","Paragraph":"Paragrafo","Select your language:":"Seleziona la tua lingua:","This is %{ obj.name }":"Questo è %{ obj.name }","Welcome %{ name }":"Benvenuto %{ name }"}}

dev/language/zh_CN/app.po

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
msgid ""
2+
msgstr ""
3+
"Project-Id-Version: vue 3-gettext\n"
4+
"Last-Translator: Automatically generated\n"
5+
"Language-Team: none\n"
6+
"Language: zh_CN\n"
7+
"MIME-Version: 1.0\n"
8+
"Content-Type: text/plain; charset=UTF-8\n"
9+
"Content-Transfer-Encoding: 8bit\n"
10+
"Plural-Forms: nplurals=1; plural=0;\n"
11+
12+
#: dev/components/DemoPlural.vue:28
13+
msgid "%{ countForUntranslated } item. This is left untranslated on purpose."
14+
msgid_plural ""
15+
"%{ countForUntranslated } items. This is left untranslated on purpose."
16+
msgstr[0] ""
17+
18+
#: dev/components/DemoPlural.vue:13
19+
msgid "%{ n } book"
20+
msgid_plural "%{ n } books"
21+
msgstr[0] "%{ n } 本书"
22+
23+
#: dev/components/DemoAlert.vue:35
24+
msgid "%{ n } car"
25+
msgid_plural "%{ n } cars"
26+
msgstr[0] "%{ n } 辆车"
27+
28+
#: dev/components/DemoPlural.vue:17
29+
msgid "%{ nComputed } book"
30+
msgid_plural "%{ nComputed } books"
31+
msgstr[0] "%{ nComputed } 本书"
32+
33+
#: dev/components/DemoDirective.vue:15
34+
msgid "<strong>%{ count }</strong> apple"
35+
msgid_plural "<strong>%{ count }</strong> apples"
36+
msgstr[0] "<strong>%{ count }</strong> 个苹果"
37+
38+
#: dev/components/DemoDirective.vue:4
39+
msgid "A <b>random</b> number: <i>%{ random }</i>"
40+
msgstr "一个<b>随机</b>数: <i>%{ random }</i>"
41+
42+
#: dev/components/DemoMultilines.vue:3
43+
msgid ""
44+
"Forgotten your password? Enter your \"email address\" below, and we'll email "
45+
"instructions for setting a new one."
46+
msgstr ""
47+
"忘记密码了吗?请在下面输入你的「电子邮件地址」,我们将通过电子邮件发送设置新"
48+
"密码的说明。"
49+
50+
#. use jsExtractorOpts in gettext.config.js to extract custom keywords
51+
#: dev/components/DemoAlert.vue:24
52+
msgid "Good bye!"
53+
msgstr "再见"
54+
55+
#: dev/components/DemoCustomTags.vue:3
56+
msgid "Headline 1"
57+
msgstr "一级标题"
58+
59+
#: dev/components/DemoCustomTags.vue:4
60+
msgid "Headline 2"
61+
msgstr "二级标题"
62+
63+
#: dev/components/DemoCustomTags.vue:5
64+
msgid "Headline 3"
65+
msgstr "三级标题"
66+
67+
#: dev/components/DemoCustomTags.vue:6
68+
msgid "Headline 4"
69+
msgstr "四级标题"
70+
71+
#: dev/components/DemoDirective.vue:9
72+
msgid "Hello <strong>%{ name }</strong>"
73+
msgstr "<strong>%{ name }</strong> 你好"
74+
75+
#: dev/components/DemoPlural.vue:4
76+
msgid "In English, '0' (zero) is always plural."
77+
msgstr "在英语中,0(零)总是复数。"
78+
79+
#: dev/components/DemoCustomTags.vue:7
80+
msgid "Paragraph"
81+
msgstr "段落"
82+
83+
#: dev/components/LanguageSelect.vue:4
84+
msgid "Select your language:"
85+
msgstr "请选择语言"
86+
87+
#: dev/components/DemoIf.vue:14 dev/components/DemoIf.vue:15
88+
#: dev/components/DemoIf.vue:16
89+
msgid "This is %{ obj.name }"
90+
msgstr "这是 %{ obj.name }"
91+
92+
#: dev/components/DemoPlural.vue:23
93+
msgid ""
94+
"Use default singular or plural form when there is no translation. This is "
95+
"left untranslated on purpose."
96+
msgstr ""
97+
98+
#: dev/components/DemoIf.vue:4 dev/components/DemoIf.vue:5
99+
msgid "Welcome %{ name }"
100+
msgstr "欢迎 %{ name }"

dev/main.ts

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
1-
import { createApp, computed } from "vue";
1+
import { createApp } from "vue";
22
import App from "./App.vue";
3-
import "./index.css";
4-
import { createGettext } from "/@gettext/";
5-
import translations from "./language/translations.json";
3+
import { gettext } from "./i18n";
64

75
const app = createApp(App);
86

9-
const gettext = createGettext({
10-
availableLanguages: {
11-
en_GB: "British English",
12-
fr_FR: "Français",
13-
it_IT: "Italiano",
14-
},
15-
defaultLanguage: "en_GB",
16-
translations: translations,
17-
setGlobalProperties: true,
18-
});
19-
207
app.use(gettext);
218

229
app.mount("#app");

docs/.vuepress/client.ts

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
import { defineClientConfig } from "@vuepress/client";
2-
import { createGettext } from "../../src";
3-
4-
import translations from "../../dev/language/translations.json";
5-
62
import Demo from "../../dev/App.vue";
7-
8-
const gettext = createGettext({
9-
availableLanguages: {
10-
en_GB: "British English",
11-
fr_FR: "Français",
12-
it_IT: "Italiano",
13-
},
14-
defaultLanguage: "en_GB",
15-
translations: translations,
16-
});
3+
import { gettext } from "../../dev/i18n";
174

185
export default defineClientConfig({
196
enhance({ app }) {

0 commit comments

Comments
 (0)