Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Vue Element Admin | 83,947 | 4 | 16 days ago | 7 | August 08, 2020 | 1,309 | mit | Vue | ||
:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin | ||||||||||
Gin Vue Admin | 18,369 | 12 hours ago | 31 | February 25, 2023 | 41 | apache-2.0 | Go | |||
基于vite+vue3+gin搭建的开发基础平台(支持TS,JS混用),集成jwt鉴权,权限管理,动态路由,显隐可控组件,分页封装,多点登录拦截,资源权限,上传下载,代码生成器,表单生成器,chatGPT自动查表等开发必备功能。 | ||||||||||
D2 Admin | 12,300 | 3 | 12 days ago | 134 | August 02, 2023 | 17 | mit | JavaScript | ||
An elegant dashboard | ||||||||||
Vitesse | 8,031 | 8 days ago | 20 | mit | TypeScript | |||||
🏕 Opinionated Vite + Vue Starter Template | ||||||||||
Vue I18n | 7,002 | 2 | 3 months ago | 4 | May 11, 2022 | 237 | mit | JavaScript | ||
:globe_with_meridians: Internationalization plugin for Vue.js | ||||||||||
I18n Ally | 3,099 | 2 days ago | 196 | mit | TypeScript | |||||
🌍 All in one i18n extension for VS Code | ||||||||||
Vuesion | 2,689 | 18 days ago | 3 | mit | Vue | |||||
Vuesion is a boilerplate that helps product teams build faster than ever with fewer headaches and modern best practices across engineering & design. | ||||||||||
Heyui | 2,525 | 9 | 15 | 4 months ago | 494 | March 27, 2022 | 60 | mit | Vue | |
🎉UI Toolkit for Web, Vue3.0 | ||||||||||
Nx Admin | 2,517 | 3 years ago | 84 | August 22, 2023 | 2 | mit | Vue | |||
👍 A magical 🐮 ⚔ vue admin,记得star | ||||||||||
Typesafe I18n | 1,847 | 13 | a day ago | 265 | August 25, 2023 | 16 | mit | TypeScript | ||
A fully type-safe and lightweight internationalization library for all your TypeScript and JavaScript projects. |
vue-i18n-extract
is built to work with your Vue.js projects using the library vue-i18n. It runs static analysis on your Vue.js source code looking for any vue-i18n
usage, in order to:
Run from the command line:
npx vue-i18n-extract report --vueFiles './path/to/source-files/**/*.?(js|vue)' --languageFiles './path/to/language-files/*.?(json|yml|yaml)'
Install the package in your project:
npm install --save-dev vue-i18n-extract
Use it via an npm script in your package.json
file:
{
"scripts": {
"vue-i18n-extract": "vue-i18n-extract report --vueFiles './path/to/source-files/**/*.?(js|vue)' --languageFiles './path/to/language-files/*.?(json|yml|yaml|js)'"
}
}
Finally, run:
npm run vue-i18n-extract
This will print out a table of missing keys in your language files, as well as unused keys in your language files.
Install the package in your project:
npm install --save-dev vue-i18n-extract
Import the module and use it like this:
const VueI18NExtract = require('vue-i18n-extract');
const report = VueI18NExtract.createI18NReport({
vueFiles: './path/to/vue-files/**/*.?(js|vue)',
languageFiles: './path/to/language-files/*.?(json|yml|yaml|js)',
});
You can use the following configuration options via the vue-i18n-extract command line utility or a vue-i18n-extract.config.js
configuration file.
You can generate a default configuration file using npx vue-i18n-extract init
(it uses the following options: vue-i18n-extract.config.ts
). Once you have a configuration file, you can run npx vue-i18n-extract
.
vueFiles
vueFiles
--vue-files
, --vueFiles
string
./path/to/source-files/**/*.?(js|vue)
./tests/fixtures/**/*.?(vue|js)
languageFiles
languageFiles
--language-files
, --languageFiles
string
./path/to/language-files/*.?(json|yml|yaml)
./tests/fixtures/lang/**/*.json
output
output
--output
string
output.json
add
add
--add
false
boolean
remove
remove
--remove
false
boolean
ci
ci
--ci
false
boolean
separator
separator
--separator
'.'
string
exclude
exclude
--exclude
[]
string
or array of string
scompany.meta
in company.meta.motto
), the entire node of the object indicated by the sub segment will be excluded.exclude: ['translation_key_1', 'translation_key_2']
--exclude translation_key_1 --exclude translation_key_2
detect
detect
--detect
['missing', 'unused', 'dynamic']
string
or array of string
sdetect: ['missing', 'unused']
--detect missing --detect unused
noEmptyTranslation
noEmptyTranslation
--no-empty-translation
, --noEmptyTranslation
''
string
'*'
: Generate empty default translation for all locales.'en'
: Generate empty default translation for locale 'en'
.'en-US'
: Generate empty default translation for locale 'en-US'
.missingTranslationString
missingTranslationString
--missing-translation-string
, --missingTranslationString
''
string
or null
'Translation missing'
: Use "Translation missing" as default key.null
: Add the translation key to the file, but don't add a default translation. This will trigger vue-i18n
's the missingHandler.vue-i18n
Formats// Single or double quote, and template literals
$t('key.static') $t("key.static") $t(`key.static`)
// Without dollar sign
t('key.static') t("key.static") t(`key.static`)
// $tc Support for use with plurals
$tc('key.static', 0) $tc("key.static", 1) $tc(`key.static`, 2)
// Without dollar sign
tc('key.static', 0) tc("key.static", 1) tc(`key.static`, 2)
<i18n path="key.component"></i18n>
<i18n-t keypath="key.component"></i18n-t>
<Translate keypath="key.component"></Translate>
Note: As of right now there is no support for binding in a path like
:path="condition ? 'string1' : 'string2'"
there is just support for strings as shown above.
const TranslationComponentInCode = h(Translation, {
keypath: 'Translation component in code.',
tag: 'p',
});
<p v-t="'key.directive'"></p>
<p v-t.preserve="'key.directive'"></p>
Note: As of right now there is no object support to reference a path from component data.
Setting up a Vue.js app with internationalization (i18n) support is easy nowadays: Once you have installed the plugin and injected into the Vue instance, you can just put $t('Hello World')
inside Vue.js component templates to use the plugin.
However, in our personal experience we found it very difficult to keep the language files and the .vue
files in sync.
That's why we wrote vue-i18n-extract
. We needed a way to analyze and compare our language files to our Vue.js source files, then report the result in a useful way.
Please make sure to read the Contributing Guide before making a pull request.