首次上传
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 kazuya kawaguchi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
# vue-i18n
|
||||
|
||||
Internationalization plugin for Vue.js
|
||||
|
||||
## Which dist file to use?
|
||||
|
||||
### From CDN or without a Bundler
|
||||
|
||||
- **`vue-i18n(.runtime).global(.prod).js`**:
|
||||
|
||||
- For direct use via `<script src="...">` in the browser. Exposes the `VueI18n` global
|
||||
- Note that global builds are not [UMD](https://github.com/umdjs/umd) builds. They are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE) and is only meant for direct use via `<script src="...">`
|
||||
- In-browser locale messages compilation:
|
||||
- **`vue-i18n.global.js`** is the "full" build that includes both the compiler and the runtime so it supports compiling locale messages on the fly
|
||||
- **`vue-i18n.runtime.global.js`** contains only the runtime and requires locale messages to be pre-compiled during a build step
|
||||
- Inlines internal the bellow packages - i.e. it’s a single file with no dependencies on other files. This means you **must** import everything from this file and this file only to ensure you are getting the same instance of code
|
||||
- `@intlify/shared`
|
||||
- `@intlify/message-resolver`
|
||||
- `@intlify/message-compiler`
|
||||
- `@intlify/core`
|
||||
- Contains hard-coded prod/dev branches, and the prod build is pre-minified. Use the `*.prod.js` files for production
|
||||
|
||||
- **`vue-i18n(.runtime).esm-browser(.prod).js`**:
|
||||
- For usage via native ES modules imports (in browser via `<script type="module">`)
|
||||
- Shares the same runtime compilation, dependency inlining and hard-coded prod/dev behavior with the global build
|
||||
|
||||
### With a Bundler
|
||||
|
||||
- **`vue-i18n(.runtime).esm-bundler.js`**:
|
||||
- For use with bundlers like `webpack`, `rollup` and `parcel`
|
||||
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (must be replaced by bundler)
|
||||
- Does not ship minified builds (to be done together with the rest of the code after bundling)
|
||||
- Imports dependencies (e.g. `@intlify/core-base`, `@intlify/message-compiler`)
|
||||
- Imported dependencies are also `esm-bundler` builds and will in turn import their dependencies (e.g. `@intlify/message-compiler` imports `@intlify/shared`)
|
||||
- This means you **can** install/import these deps individually without ending up with different instances of these dependencies, but you must make sure they all resolve to the same version
|
||||
- In-browser locale messages compilation:
|
||||
- **`vue-i18n.runtime.esm-bundler.js` (default)** is runtime only, and requires all locale messages to be pre-compiled. This is the default entry for bundlers (via `module` field in `package.json`) because when using a bundler templates are typically pre-compiled (e.g. in `*.json` files)
|
||||
- **`vue-i18n.esm-bundler.js`**: includes the runtime compiler. Use this if you are using a bundler but still want locale messages compilation (e.g. templates via inline JavaScript strings)
|
||||
|
||||
### For Node.js (Server-Side)
|
||||
|
||||
- **`vue-i18n.cjs(.prod).js`**:
|
||||
- For use in Node.js via `require()`
|
||||
- If you bundle your app with webpack with `target: 'node'` and properly externalize `vue-i18n`, this is the build that will be loaded
|
||||
- The dev/prod files are pre-built, but the appropriate file is automatically required based on `process.env.NODE_ENV`
|
||||
|
||||
## For Bundler feature flags
|
||||
|
||||
### Build Feature Flags
|
||||
|
||||
The `esm-bundler` builds now exposes global feature flags that can be overwritten at compile time:
|
||||
|
||||
- `__VUE_I18N_FULL_INSTALL__` (enable/disable, in addition to vue-i18n APIs, components and directives all fully support installation: `true`)
|
||||
- `__VUE_I18N_LEGACY_API__` (enable/disable vue-i18n legacy style APIs support, default: `true`)
|
||||
- `__VUE_I18N_PROD_DEVTOOLS__` (enable/disable vue-devtools support in production, default: `false`)
|
||||
- `__INTLIFY_PROD_DEVTOOLS__` (enable/disable `@intlify/devtools` support in production, default: `false`)
|
||||
|
||||
> NOTE: `__INTLIFY_PROD_DEVTOOLS__` flag is experimental, and `@intlify/devtools` is WIP yet.
|
||||
|
||||
The build will work without configuring these flags, however it is **strongly recommended** to properly configure them in order to get proper tree shaking in the final bundle. To configure these flags:
|
||||
|
||||
- webpack: use [DefinePlugin](https://webpack.js.org/plugins/define-plugin/)
|
||||
- Rollup: use [@rollup/plugin-replace](https://github.com/rollup/plugins/tree/master/packages/replace)
|
||||
- Vite: configured by default, but can be overwritten using the [`define` option](https://github.com/vitejs/vite/blob/a4133c073e640b17276b2de6e91a6857bdf382e1/src/node/config.ts#L72-L76)
|
||||
|
||||
Note: the replacement value **must be boolean literals** and cannot be strings, otherwise the bundler/minifier will not be able to properly evaluate the conditions.
|
||||
|
||||
## Other Feature Flags
|
||||
|
||||
- `__FEATURE_ESM_BUNDLER_WARN__` (Suppress / Not suppress feature flags recommended warnings in build for `esm-bulder`)
|
||||
|
||||
## :copyright: License
|
||||
|
||||
[MIT](http://opensource.org/licenses/MIT)
|
||||
+1814
File diff suppressed because it is too large
Load Diff
+1698
File diff suppressed because it is too large
Load Diff
+3302
File diff suppressed because it is too large
Load Diff
+5060
File diff suppressed because it is too large
Load Diff
+6
File diff suppressed because one or more lines are too long
+2239
File diff suppressed because it is too large
Load Diff
+5073
File diff suppressed because it is too large
Load Diff
+6
File diff suppressed because one or more lines are too long
+3737
File diff suppressed because it is too large
Load Diff
+6
File diff suppressed because one or more lines are too long
+2237
File diff suppressed because it is too large
Load Diff
+3750
File diff suppressed because it is too large
Load Diff
+6
File diff suppressed because one or more lines are too long
+7
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./dist/vue-i18n.cjs.prod.js')
|
||||
} else {
|
||||
module.exports = require('./dist/vue-i18n.cjs.js')
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "vue-i18n",
|
||||
"version": "9.1.9",
|
||||
"description": "Internationalization plugin for Vue.js",
|
||||
"keywords": [
|
||||
"i18n",
|
||||
"internationalization",
|
||||
"intlify",
|
||||
"plugin",
|
||||
"vue",
|
||||
"vue.js"
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
"name": "kazuya kawaguchi",
|
||||
"email": "kawakazu80@gmail.com"
|
||||
},
|
||||
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/vue-i18n#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/intlify/vue-i18n-next.git",
|
||||
"directory": "packages/vue-i18n"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/intlify/vue-i18n-next/issues"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist",
|
||||
"vetur"
|
||||
],
|
||||
"main": "index.js",
|
||||
"module": "dist/vue-i18n.esm-bundler.js",
|
||||
"unpkg": "dist/vue-i18n.global.js",
|
||||
"jsdelivr": "dist/vue-i18n.global.js",
|
||||
"types": "dist/vue-i18n.d.ts",
|
||||
"dependencies": {
|
||||
"@intlify/core-base": "9.1.9",
|
||||
"@intlify/shared": "9.1.9",
|
||||
"@intlify/vue-devtools": "9.1.9",
|
||||
"@vue/devtools-api": "^6.0.0-beta.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@intlify/devtools-if": "9.1.9"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
},
|
||||
"buildOptions": {
|
||||
"name": "VueI18n",
|
||||
"formats": [
|
||||
"esm-bundler",
|
||||
"esm-bundler-runtime",
|
||||
"esm-browser",
|
||||
"esm-browser-runtime",
|
||||
"cjs",
|
||||
"global",
|
||||
"global-runtime"
|
||||
]
|
||||
},
|
||||
"sideEffects": false,
|
||||
"vetur": {
|
||||
"tags": "vetur/tags.json",
|
||||
"attributes": "vetur/attributes.json"
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"i18n-t/keypath": {
|
||||
"description": "[required]\nThe locale message key can be specified prop",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-t/plural": {
|
||||
"description": "[optional]\nThe Plural Choosing the message number prop",
|
||||
"type": "number|string"
|
||||
},
|
||||
"i18n-t/locale": {
|
||||
"description": "[optional]\nThe locale to be used for the component",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-t/scope": {
|
||||
"description": "[optional]\tThe scope to be used in the target component.\nYou can specify either `global` or `parent`",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-t/tag": {
|
||||
"description": "[optional]\nUsed to wrap the content that is distribute in the slot.\nIf omitted, the slot content is treated as Fragments",
|
||||
"type": "string|object"
|
||||
},
|
||||
"i18n-d/value": {
|
||||
"description": "[required]\nThe value specified for the target component",
|
||||
"type": "number|date"
|
||||
},
|
||||
"i18n-d/format": {
|
||||
"description": "[optional]\nThe format to use in the target component",
|
||||
"type": "string|object"
|
||||
},
|
||||
"i18n-d/locale": {
|
||||
"description": "[optional]\nThe locale to be used for the component",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-d/scope": {
|
||||
"description": "[optional]\tThe scope to be used in the target component.\nYou can specify either `global` or `parent`",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-d/tag": {
|
||||
"description": "[optional]\nUsed to wrap the content that is distribute in the slot.\nIf omitted, the slot content is treated as Fragments",
|
||||
"type": "string|object"
|
||||
},
|
||||
"i18n-n/value": {
|
||||
"description": "[required]\nThe value specified for the target component",
|
||||
"type": "number"
|
||||
},
|
||||
"i18n-n/format": {
|
||||
"description": "[optional]\nThe format to use in the target component",
|
||||
"type": "string|object"
|
||||
},
|
||||
"i18n-n/locale": {
|
||||
"description": "[optional]\nThe locale to be used for the component",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-n/scope": {
|
||||
"description": "[optional]\tThe scope to be used in the target component.\nYou can specify either `global` or `parent`",
|
||||
"type": "string"
|
||||
},
|
||||
"i18n-n/tag": {
|
||||
"description": "[optional]\nUsed to wrap the content that is distribute in the slot.\nIf omitted, the slot content is treated as Fragments",
|
||||
"type": "string|object"
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"i18n-t": {
|
||||
"attributes": ["keypath", "locale", "tag", "plural", "scope"],
|
||||
"description": "This is Translation component that can be used when HTML interpolation is needed.\n\nhttps://vue-i18n.intlify.dev/guide/advanced/component.html#basic-usage"
|
||||
},
|
||||
"i18n-d": {
|
||||
"attributes": ["value", "format", "locale", "tag", "scope"],
|
||||
"description": "This is Datetime Format component provides a way to use HTML interpolation in pair with number formatting.\n\nhttps://vue-i18n.intlify.dev/guide/essentials/datetime.html#custom-formatting"
|
||||
},
|
||||
"i18n-n": {
|
||||
"attributes": ["value", "format", "locale", "tag", "scope"],
|
||||
"description": "This is Number Format component provides a way to use HTML interpolation in pair with number formatting.\n\nhttps://vue-i18n.intlify.dev/guide/essentials/number.html#custom-formatting"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user