{{ t('pagesInStorybook') }}
6 |7 | {{ t('localizationMsg') }} 8 |
9 | {{ t('navigating') }} 10 |├── packages
├── core
│ ├── test
│ │ └── .gitkeep
│ ├── api-extractor.json
│ └── src
│ │ ├── index.ts
│ │ └── runtime.ts
├── vue-i18n-core
│ ├── src
│ │ ├── plugin
│ │ │ ├── index.ts
│ │ │ ├── types.ts
│ │ │ └── next.ts
│ │ ├── components
│ │ │ └── index.ts
│ │ ├── types.ts
│ │ ├── warnings.ts
│ │ ├── symbols.ts
│ │ └── vue.d.ts
│ ├── README.md
│ ├── test
│ │ ├── errors.test.ts
│ │ ├── schema.ts
│ │ ├── components
│ │ │ └── components.test-d.tsx
│ │ ├── plugin.test.ts
│ │ └── __snapshots__
│ │ │ ├── issues.test.ts.snap
│ │ │ ├── composer.test.ts.snap
│ │ │ └── i18n.test.ts.snap
│ ├── api-extractor.json
│ └── api-extractor-petite.json
├── core-base
│ ├── src
│ │ ├── types
│ │ │ └── index.ts
│ │ ├── intl.ts
│ │ ├── misc.ts
│ │ └── index.ts
│ ├── README.md
│ ├── test
│ │ ├── errors.test.ts
│ │ ├── warnings.test.ts
│ │ ├── schema.ts
│ │ ├── helper.ts
│ │ └── number.test-d.ts
│ └── api-extractor.json
├── format-explorer
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── main.ts
│ │ ├── assets
│ │ │ └── favicon.ico
│ │ ├── shims-vue.d.ts
│ │ ├── components
│ │ │ └── Navigation.vue
│ │ └── utils.ts
│ ├── public
│ │ └── favicon.ico
│ ├── index.html
│ ├── README.md
│ ├── package.json
│ └── vite.config.ts
├── shared
│ ├── src
│ │ ├── error.ts
│ │ ├── index.ts
│ │ └── warn.ts
│ ├── test
│ │ └── __snapshots__
│ │ │ └── utils.test.ts.snap
│ ├── api-extractor.json
│ └── README.md
├── devtools-types
│ ├── README.md
│ └── api-extractor.json
├── message-compiler
│ ├── README.md
│ ├── api-extractor.json
│ ├── src
│ │ ├── index.ts
│ │ ├── helpers.ts
│ │ └── location.ts
│ └── test
│ │ ├── transformer.test.ts
│ │ ├── helper.ts
│ │ ├── __snapshots__
│ │ ├── mangler.test.ts.snap
│ │ └── minifier.test.ts.snap
│ │ └── mangler.test.ts
├── size-check-core
│ ├── README.md
│ ├── src
│ │ └── main.ts
│ ├── index.html
│ ├── package.json
│ ├── scripts
│ │ └── size.mjs
│ └── vite.config.ts
├── size-check-vue-i18n
│ ├── README.md
│ ├── src
│ │ ├── shims-vue.d.ts
│ │ └── App.vue
│ ├── index.html
│ ├── package.json
│ └── scripts
│ │ └── size.mjs
├── size-check-petite-vue-i18n
│ ├── README.md
│ ├── src
│ │ ├── shims-vue.d.ts
│ │ └── App.vue
│ ├── index.html
│ ├── package.json
│ └── scripts
│ │ └── size.mjs
├── vue-i18n
│ ├── api-extractor.json
│ └── vetur
│ │ └── tags.json
├── petite-vue-i18n
│ └── api-extractor.json
└── global.d.ts
├── examples
├── lazy-loading
│ ├── vite
│ │ ├── public
│ │ │ └── .gitkeep
│ │ ├── src
│ │ │ ├── assets
│ │ │ │ └── .gitkeep
│ │ │ ├── components
│ │ │ │ └── .gitkeep
│ │ │ ├── index.css
│ │ │ ├── pages
│ │ │ │ ├── Home.vue
│ │ │ │ └── About.vue
│ │ │ ├── locales
│ │ │ │ ├── ja.json
│ │ │ │ └── en.json
│ │ │ ├── shims-vue.d.ts
│ │ │ ├── vue-i18n.d.ts
│ │ │ └── main.ts
│ │ ├── tsconfig.json
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── vite.config.ts
│ │ ├── tsconfig.app.json
│ │ ├── package.json
│ │ └── tsconfig.node.json
│ └── webpack
│ │ ├── src
│ │ ├── components
│ │ │ └── .gitkeep
│ │ ├── pages
│ │ │ ├── Home.vue
│ │ │ └── About.vue
│ │ ├── index.css
│ │ ├── locales
│ │ │ ├── ja.json
│ │ │ └── en.json
│ │ └── main.js
│ │ ├── index.html
│ │ ├── README.md
│ │ └── package.json
├── web-components
│ ├── src
│ │ ├── assets
│ │ │ └── .gitkeep
│ │ ├── vite-env.d.ts
│ │ ├── components
│ │ │ ├── HelloI18n.ce.vue
│ │ │ └── HelloBlock.ce.vue
│ │ ├── shims-vue.d.ts
│ │ ├── main.ts
│ │ └── App.vue
│ ├── README.md
│ ├── public
│ │ └── favicon.ico
│ ├── tsconfig.json
│ ├── index.html
│ ├── tsconfig.app.json
│ ├── vite.config.ts
│ ├── package.json
│ └── tsconfig.node.json
├── storybook
│ ├── .gitattributes
│ ├── env.d.ts
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── main.ts
│ │ ├── assets
│ │ │ ├── logo.svg
│ │ │ └── main.css
│ │ ├── components
│ │ │ ├── icons
│ │ │ │ ├── IconSupport.vue
│ │ │ │ ├── IconTooling.vue
│ │ │ │ └── IconCommunity.vue
│ │ │ └── HelloWorld.vue
│ │ ├── stories
│ │ │ ├── header.css
│ │ │ ├── button.css
│ │ │ ├── LocalizedPage.vue
│ │ │ └── LocalizedPage.stories.ts
│ │ └── App.vue
│ ├── tsconfig.json
│ ├── .editorconfig
│ ├── tsconfig.app.json
│ ├── .storybook
│ │ └── main.ts
│ ├── index.html
│ ├── vite.config.ts
│ ├── .gitignore
│ ├── tsconfig.node.json
│ ├── eslint.config.ts
│ └── README.md
├── backend
│ ├── db
│ │ ├── en.json
│ │ ├── ja.json
│ │ └── message.d.ts
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── constants.ts
│ │ ├── env.d.ts
│ │ ├── App.vue
│ │ └── main.ts
│ ├── tsconfig.json
│ ├── index.html
│ ├── tsconfig.app.json
│ ├── scripts
│ │ └── server.ts
│ ├── tsconfig.node.json
│ ├── package.json
│ └── README.md
├── tsx
│ ├── README.md
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── shims-vue.d.ts
│ │ ├── main.ts
│ │ ├── App.vue
│ │ └── components
│ │ │ └── HelloWorld.vue
│ ├── public
│ │ └── favicon.ico
│ ├── tsconfig.json
│ ├── vite.config.ts
│ ├── index.html
│ ├── tsconfig.app.json
│ ├── package.json
│ └── tsconfig.node.json
├── ssr
│ ├── vite
│ │ ├── dep-import-type
│ │ │ ├── deep
│ │ │ │ └── index.d.ts
│ │ │ └── package.json
│ │ ├── src
│ │ │ ├── components
│ │ │ │ ├── foo.css
│ │ │ │ ├── ImportType.vue
│ │ │ │ └── Foo.jsx
│ │ │ ├── assets
│ │ │ │ ├── logo.png
│ │ │ │ └── fonts
│ │ │ │ │ ├── Inter-Italic.woff
│ │ │ │ │ └── Inter-Italic.woff2
│ │ │ ├── entry-client.js
│ │ │ ├── pages
│ │ │ │ ├── External.vue
│ │ │ │ ├── About.vue
│ │ │ │ └── Home.vue
│ │ │ ├── locales
│ │ │ │ ├── ja.json
│ │ │ │ └── en.json
│ │ │ ├── i18n.js
│ │ │ ├── main.js
│ │ │ └── router.js
│ │ ├── example-external-component
│ │ │ ├── index.js
│ │ │ ├── package.json
│ │ │ └── ExampleExternalComponent.vue
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── vite.config.noexternal.js
│ │ └── vite.config.js
│ └── vitepress
│ │ ├── README.md
│ │ ├── .vitepress
│ │ ├── theme
│ │ │ └── index.ts
│ │ └── config.ts
│ │ ├── package.json
│ │ ├── tsconfig.json
│ │ ├── index.md
│ │ └── api-examples.md
├── message-format
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── components
│ │ │ └── HelloWorld.vue
│ │ ├── App.vue
│ │ ├── main.ts
│ │ └── compilation.ts
│ ├── README.md
│ ├── tsconfig.json
│ ├── vite.config.ts
│ ├── index.html
│ ├── tsconfig.app.json
│ ├── package.json
│ └── tsconfig.node.json
├── type-safe
│ ├── type-annotation
│ │ ├── src
│ │ │ ├── locales
│ │ │ │ ├── en-US.json
│ │ │ │ └── schema.ts
│ │ │ ├── components
│ │ │ │ ├── en-US.json
│ │ │ │ ├── GlobalScope.vue
│ │ │ │ └── LocalScope.vue
│ │ │ ├── assets
│ │ │ │ └── logo.png
│ │ │ ├── shims-vue.d.ts
│ │ │ ├── App.vue
│ │ │ └── main.ts
│ │ ├── public
│ │ │ └── favicon.ico
│ │ ├── tsconfig.json
│ │ ├── README.md
│ │ ├── vite.config.ts
│ │ ├── index.html
│ │ ├── tsconfig.app.json
│ │ ├── package.json
│ │ └── tsconfig.node.json
│ └── global-type-definition
│ │ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── locales
│ │ │ ├── ja-JP.json
│ │ │ └── en-US.json
│ │ ├── shims-vue.d.ts
│ │ ├── App.vue
│ │ ├── components
│ │ │ └── HelloWorld.vue
│ │ └── vue-i18n.d.ts
│ │ ├── public
│ │ └── favicon.ico
│ │ ├── tsconfig.json
│ │ ├── README.md
│ │ ├── vite.config.ts
│ │ ├── index.html
│ │ ├── tsconfig.app.json
│ │ ├── package.json
│ │ └── tsconfig.node.json
├── frameworks
│ └── nuxt3
│ │ ├── locales
│ │ ├── ja.json
│ │ ├── en.json
│ │ └── fr.json
│ │ ├── .gitignore
│ │ ├── tsconfig.json
│ │ ├── app.vue
│ │ ├── plugins
│ │ └── i18n.ts
│ │ ├── package.json
│ │ ├── nuxt.config.ts
│ │ └── README.md
├── composition
│ └── fallback
│ │ └── format.html
└── petite
│ └── fallback
│ ├── basic.html
│ └── format.html
├── .gitattributes
├── .githooks
└── pre-commit
├── .npmrc
├── docs
├── public
│ ├── _headers
│ ├── nuxt.png
│ ├── crowdin.png
│ ├── decibel.png
│ ├── locize.png
│ ├── scope.png
│ ├── RapidAPI.png
│ ├── Route4Me.png
│ ├── babeledit.png
│ ├── sendcloud.png
│ ├── microsoft.webp
│ ├── nuxt3-setup.png
│ ├── ts-support-1.png
│ ├── ts-support-2.png
│ ├── ts-support-3.gif
│ ├── vuemastery.png
│ ├── lifecycle2024.png
│ ├── lifecycle2025.png
│ ├── vue-i18n-logo.png
│ ├── zenarchitects.png
│ ├── lifecycle2025-1.png
│ ├── lifecycle2025-2.png
│ ├── nuxt3-pre-compile.png
│ ├── nuxt3-setup-i18n.gif
│ ├── vue-i18n-devtools-logo.png
│ └── nuxt3-reduce-bundle-size.png
├── ecosystem
│ └── integrations.md
├── .vitepress
│ └── theme
│ │ ├── integrations.ts
│ │ ├── sponsors.json
│ │ ├── components
│ │ ├── VoltaBoard.vue
│ │ ├── AsideSponsors.vue
│ │ └── Service.vue
│ │ ├── index.ts
│ │ └── integrations.json
├── guide
│ ├── migration
│ │ └── breaking12.md
│ └── maintenance.md
└── index.md
├── assets
└── vue-i18n-logo.png
├── scripts
├── build.sh
├── vitest.unit.globalSetup.ts
├── preinstall.js
├── playwright.ts
├── dist-tag.sh
├── vitest.setup.ts
├── deprecate.sh
├── release.sh
├── test-utils.ts
├── vitest.globalSetup.ts
├── postprocess.ts
└── aliases.ts
├── tsconfig.typedoc.json
├── .npmignore
├── .editorconfig
├── docsgen.config.js
├── e2e
├── hotfix.spec.ts
├── number.spec.ts
├── formatting
│ ├── list.spec.ts
│ ├── literal.spec.ts
│ ├── named.spec.ts
│ └── linked.spec.ts
├── functions
│ ├── list.spec.ts
│ ├── named.spec.ts
│ ├── plural.spec.ts
│ └── linked.spec.ts
├── components
│ ├── number-format.spec.ts
│ ├── datetime-format.spec.ts
│ └── translation.spec.ts
├── fallback
│ ├── component.spec.ts
│ ├── format.spec.ts
│ ├── option.spec.ts
│ ├── suppress.spec.ts
│ └── basic.spec.ts
├── started.spec.ts
├── plural
│ ├── basic.spec.ts
│ └── custom.spec.ts
├── datetime.spec.ts
├── missing
│ ├── option.spec.ts
│ ├── suppress.spec.ts
│ └── handler.spec.ts
└── scope
│ └── local.spec.ts
├── .prettierignore
├── .gitignore
├── vitest.e2e.config.ts
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ └── config.yml
└── workflows
│ ├── github-label-sync.yml
│ ├── reproduire.yml
│ └── nightly-release.yml
├── shim.d.ts
├── pnpm-workspace.yaml
├── vitest.unit.config.ts
├── BACKERS.md
├── .vscode
└── settings.json
├── renovate.json
├── benchmark
├── compile.mjs
├── index.mjs
└── utils.mjs
├── SECURITY.md
├── ARCHITECTURE.md
├── vitest.config.ts
└── LICENSE
/packages/core/test/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/lazy-loading/vite/public/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/web-components/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/lazy-loading/vite/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/lazy-loading/vite/src/components/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/lazy-loading/webpack/src/components/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.json linguist-language=JSON-with-Comments
--------------------------------------------------------------------------------
/examples/storybook/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto eol=lf
2 |
--------------------------------------------------------------------------------
/examples/backend/db/en.json:
--------------------------------------------------------------------------------
1 | {
2 | "hello": "hello!"
3 | }
4 |
--------------------------------------------------------------------------------
/examples/backend/db/ja.json:
--------------------------------------------------------------------------------
1 | {
2 | "hello": "こんにちは!"
3 | }
4 |
--------------------------------------------------------------------------------
/.githooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | npx --no-install lint-staged
3 |
--------------------------------------------------------------------------------
/examples/tsx/README.md:
--------------------------------------------------------------------------------
1 | # tsx
2 |
3 | This is an example for TSX
4 |
--------------------------------------------------------------------------------
/examples/storybook/env.d.ts:
--------------------------------------------------------------------------------
1 | /// {{ $t('pages.home') }}
3 |
4 |
--------------------------------------------------------------------------------
/examples/ssr/vitepress/README.md:
--------------------------------------------------------------------------------
1 | # virepress SSR build
2 |
3 | This is an example of vitepress SSR build (SSG).
4 |
--------------------------------------------------------------------------------
/examples/tsx/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/tsx/public/favicon.ico
--------------------------------------------------------------------------------
/scripts/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | pnpm build --withTypes
6 |
7 | tsx ./scripts/postprocess.ts
8 |
--------------------------------------------------------------------------------
/examples/backend/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/backend/public/favicon.ico
--------------------------------------------------------------------------------
/examples/lazy-loading/webpack/src/pages/About.vue:
--------------------------------------------------------------------------------
1 |
2 | {{ $t('pages.about') }}
3 |
4 |
--------------------------------------------------------------------------------
/docs/public/vue-i18n-devtools-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/docs/public/vue-i18n-devtools-logo.png
--------------------------------------------------------------------------------
/examples/backend/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/backend/src/assets/logo.png
--------------------------------------------------------------------------------
/examples/frameworks/nuxt3/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.log*
3 | .nuxt
4 | .nitro
5 | .cache
6 | .output
7 | .env
8 | dist
9 |
--------------------------------------------------------------------------------
/examples/ssr/vite/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/ssr/vite/src/assets/logo.png
--------------------------------------------------------------------------------
/examples/storybook/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/storybook/public/favicon.ico
--------------------------------------------------------------------------------
/examples/web-components/README.md:
--------------------------------------------------------------------------------
1 | # web-components
2 |
3 | This is an example of how to use vue-i18n with web-components.
4 |
--------------------------------------------------------------------------------
/docs/public/nuxt3-reduce-bundle-size.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/docs/public/nuxt3-reduce-bundle-size.png
--------------------------------------------------------------------------------
/examples/backend/db/message.d.ts:
--------------------------------------------------------------------------------
1 | import en from './en.json' with { type: 'json' }
2 |
3 | export type ResourceSchema = typeof en
4 |
--------------------------------------------------------------------------------
/scripts/vitest.unit.globalSetup.ts:
--------------------------------------------------------------------------------
1 | export function setup(): void {
2 | console.log('ICU version:', process.versions.icu)
3 | }
4 |
--------------------------------------------------------------------------------
/tsconfig.typedoc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "include": ["packages/global.d.ts", "packages/*/src"]
4 | }
5 |
--------------------------------------------------------------------------------
/examples/type-safe/type-annotation/src/components/en-US.json:
--------------------------------------------------------------------------------
1 | {
2 | "messages": {
3 | "hello": "Hello, {name}!"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/examples/web-components/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/web-components/public/favicon.ico
--------------------------------------------------------------------------------
/packages/format-explorer/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/packages/format-explorer/public/favicon.ico
--------------------------------------------------------------------------------
/examples/ssr/vite/dep-import-type/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dep-import-type",
3 | "version": "0.0.0",
4 | "main": "index.js"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/format-explorer/src/main.ts:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import App from './App.vue'
3 |
4 | createApp(App).mount('#app')
5 |
--------------------------------------------------------------------------------
/packages/devtools-types/README.md:
--------------------------------------------------------------------------------
1 | # @intlify/devtools-types
2 |
3 | ## :copyright: License
4 |
5 | [MIT](http://opensource.org/licenses/MIT)
6 |
--------------------------------------------------------------------------------
/packages/format-explorer/src/assets/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/packages/format-explorer/src/assets/favicon.ico
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .*
2 | *.log
3 | *.swp
4 | coverage
5 | test
6 | benchmark
7 | e2e
8 | temp
9 | docs
10 | types
11 | scripts
12 | .eslintcache
13 |
--------------------------------------------------------------------------------
/examples/message-format/README.md:
--------------------------------------------------------------------------------
1 | # custom message format
2 |
3 | This is an example for custom message compiler with using `intl-messageformat`
4 |
--------------------------------------------------------------------------------
/examples/backend/src/constants.ts:
--------------------------------------------------------------------------------
1 | // define locales
2 | export const locales = ['en', 'ja'] as const
3 | export type Locales = (typeof locales)[number]
4 |
--------------------------------------------------------------------------------
/examples/ssr/vite/src/assets/fonts/Inter-Italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/ssr/vite/src/assets/fonts/Inter-Italic.woff
--------------------------------------------------------------------------------
/examples/ssr/vite/src/assets/fonts/Inter-Italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/ssr/vite/src/assets/fonts/Inter-Italic.woff2
--------------------------------------------------------------------------------
/examples/type-safe/type-annotation/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/intlify/vue-i18n/HEAD/examples/type-safe/type-annotation/public/favicon.ico
--------------------------------------------------------------------------------
/examples/lazy-loading/webpack/index.html:
--------------------------------------------------------------------------------
1 |
2 |
{{ $t('components.ImportType') }}
3 | 4 | 5 | 9 | -------------------------------------------------------------------------------- /examples/web-components/src/components/HelloI18n.ce.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |{{ t('hello') }}
9 | 10 | -------------------------------------------------------------------------------- /packages/size-check-core/README.md: -------------------------------------------------------------------------------- 1 | # Size Check for @intlify/core 2 | 3 | This package is private and is used for checking the baseline runtime size after tree shaking (with only the bare minimal code required to render something to the screen). 4 | -------------------------------------------------------------------------------- /packages/size-check-vue-i18n/README.md: -------------------------------------------------------------------------------- 1 | # Size Check for vue-i18n 2 | 3 | This package is private and is used for checking the baseline runtime size after tree shaking (with only the bare minimal code required to render something to the screen). 4 | -------------------------------------------------------------------------------- /packages/size-check-petite-vue-i18n/README.md: -------------------------------------------------------------------------------- 1 | # Size Check for vue-i18n 2 | 3 | This package is private and is used for checking the baseline runtime size after tree shaking (with only the bare minimal code required to render something to the screen). 4 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/integrations.ts: -------------------------------------------------------------------------------- 1 | import data from './integrations.json' 2 | 3 | export interface Service { 4 | title: string 5 | link: string 6 | source: string 7 | description: string 8 | } 9 | 10 | export const integrations = data 11 | -------------------------------------------------------------------------------- /examples/ssr/vite/src/entry-client.js: -------------------------------------------------------------------------------- 1 | import { createApp } from './main' 2 | 3 | const { app, router } = createApp() 4 | 5 | // wait until router is ready before mounting to ensure hydration match 6 | router.isReady().then(() => { 7 | app.mount('#app') 8 | }) 9 | -------------------------------------------------------------------------------- /examples/tsx/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | import vueJsx from '@vitejs/plugin-vue-jsx' 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [vue(), vueJsx()] 8 | }) 9 | -------------------------------------------------------------------------------- /scripts/preinstall.js: -------------------------------------------------------------------------------- 1 | if (!/pnpm/.test(process.env.npm_execpath || '')) { 2 | console.warn( 3 | `\u001b[33mThis repository requires using pnpm as the package manager ` + 4 | ` for scripts to work properly.\u001b[39m\n` 5 | ) 6 | process.exit(1) 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/api-extractor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../api-extractor.json", 3 | "mainEntryPointFilePath": "./dist/packages/{{ t('world') }}
12 | 13 | 14 |
8 |
9 |
10 |
11 |
`t` resource key completion: {{ t('menu.login') }}
13 |`d` resource key completion: {{ d(new Date(), 'short') }}
14 |`n` resource key completion: {{ n(1000, 'currency') }}
15 | 16 | -------------------------------------------------------------------------------- /packages/core-base/src/misc.ts: -------------------------------------------------------------------------------- 1 | import { getGlobalThis } from '@intlify/shared' 2 | 3 | /** 4 | * This is only called in esm-bundler builds. 5 | * istanbul-ignore-next 6 | */ 7 | export function initFeatureFlags(): void { 8 | if (typeof __FEATURE_PROD_INTLIFY_DEVTOOLS__ !== 'boolean') { 9 | getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false 10 | } 11 | 12 | if (typeof __FEATURE_DROP_MESSAGE_COMPILER__ !== 'boolean') { 13 | getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/format-explorer/README.md: -------------------------------------------------------------------------------- 1 | # @intlify/message-format-explorer 2 | 3 | Intlify message format explorer 4 | 5 | https://format-explorer.netlify.app 6 | 7 | ## 🔨 develop the format explorer 8 | 9 | ```sh 10 | $ yarn dev:explorer 11 | ``` 12 | 13 | ## 📦 build the format explorer 14 | 15 | ```sh 16 | $ yarn build:explorer 17 | ``` 18 | 19 | ## 🏄 serve the format explorer 20 | 21 | ```sh 22 | $ yarn serve:explorer 23 | ``` 24 | 25 | ## ©️ License 26 | 27 | [MIT](http://opensource.org/licenses/MIT) 28 | -------------------------------------------------------------------------------- /examples/backend/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | 6 | /* Linting */ 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "erasableSyntaxOnly": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noUncheckedSideEffectImports": true 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 15 | } 16 | -------------------------------------------------------------------------------- /examples/frameworks/nuxt3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nuxt3", 3 | "private": true, 4 | "type": "module", 5 | "scripts": { 6 | "build": "nuxt build", 7 | "dev": "nuxt dev", 8 | "generate": "nuxt generate", 9 | "preview": "nuxt preview", 10 | "postinstall": "nuxt prepare" 11 | }, 12 | "devDependencies": { 13 | "@intlify/unplugin-vue-i18n": "^11.0.1", 14 | "nuxt": "^4.2.0", 15 | "vue": "^3.5.22", 16 | "vue-router": "^4.6.3", 17 | "vue-i18n": "11.1.12" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/message-format/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 |message: {{ t('world') }}
14 |currecy: {{ n(1000, 'currency') }}
15 | 16 | -------------------------------------------------------------------------------- /examples/web-components/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | 6 | /* Linting */ 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "erasableSyntaxOnly": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noUncheckedSideEffectImports": true 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 15 | } 16 | -------------------------------------------------------------------------------- /packages/message-compiler/src/helpers.ts: -------------------------------------------------------------------------------- 1 | export const enum HelperNameMap { 2 | LIST = 'list', 3 | NAMED = 'named', 4 | PLURAL = 'plural', 5 | LINKED = 'linked', 6 | MESSAGE = 'message', 7 | TYPE = 'type', 8 | INTERPOLATE = 'interpolate', 9 | NORMALIZE = 'normalize', 10 | VALUES = 'values' 11 | } 12 | 13 | // eslint-disable-next-line regexp/no-obscure-range -- FIXME: 14 | const RE_HTML_TAG = /<[\w\s=":;#-/]+>/ 15 | 16 | export const detectHtmlTag = (source: string): boolean => RE_HTML_TAG.test(source) 17 | -------------------------------------------------------------------------------- /examples/lazy-loading/vite/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | 6 | /* Linting */ 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "erasableSyntaxOnly": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noUncheckedSideEffectImports": true 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 15 | } 16 | -------------------------------------------------------------------------------- /examples/storybook/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node22/tsconfig.json", 3 | "include": [ 4 | "vite.config.*", 5 | "vitest.config.*", 6 | "cypress.config.*", 7 | "nightwatch.conf.*", 8 | "playwright.config.*", 9 | "eslint.config.*" 10 | ], 11 | "compilerOptions": { 12 | "noEmit": true, 13 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", 14 | 15 | "module": "ESNext", 16 | "moduleResolution": "Bundler", 17 | "types": ["node"] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/vue-i18n-core/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export { DatetimeFormat, I18nD } from './DatetimeFormat' 2 | export { I18nN, NumberFormat } from './NumberFormat' 3 | export { I18nT, Translation } from './Translation' 4 | 5 | export type { BaseFormatProps, ComponentI18nScope } from './base' 6 | export type { DatetimeFormatProps } from './DatetimeFormat' 7 | export type { FormattableProps } from './formatRenderer' 8 | export type { NumberFormatProps } from './NumberFormat' 9 | export type { TranslationProps } from './Translation' 10 | -------------------------------------------------------------------------------- /examples/type-safe/type-annotation/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | 6 | /* Linting */ 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "erasableSyntaxOnly": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noUncheckedSideEffectImports": true 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 15 | } 16 | -------------------------------------------------------------------------------- /packages/message-compiler/test/transformer.test.ts: -------------------------------------------------------------------------------- 1 | import { createParser } from '../src/parser' 2 | import { transform } from '../src/transformer' 3 | 4 | test('transform', () => { 5 | const parser = createParser() 6 | const ast = parser.parse( 7 | `@.upper:{'no apples'} | {0} apple | {count} apples` // eslint-disable-line no-irregular-whitespace 8 | ) // eslint-disable-line no-irregular-whitespace 9 | transform(ast) 10 | expect(ast.helpers).toMatchSnapshot('helpers') 11 | expect(ast).toMatchSnapshot('ast') 12 | }) 13 | -------------------------------------------------------------------------------- /examples/type-safe/global-type-definition/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@vue/tsconfig/tsconfig.dom.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", 5 | 6 | /* Linting */ 7 | "strict": true, 8 | "noUnusedLocals": true, 9 | "noUnusedParameters": true, 10 | "erasableSyntaxOnly": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noUncheckedSideEffectImports": true 13 | }, 14 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] 15 | } 16 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.json": "jsonc", 4 | ".fixpackrc": "json" 5 | }, 6 | "editor.defaultFormatter": "esbenp.prettier-vscode", 7 | "editor.formatOnSave": true, 8 | "editor.formatOnPaste": true, 9 | "editor.formatOnType": true, 10 | "editor.codeActionsOnSave": { 11 | "source.fixAll.eslint": "explicit", 12 | "source.organizeImports": "always" 13 | }, 14 | "eslint.useFlatConfig": true, 15 | "typescript.tsdk": "node_modules/typescript/lib", 16 | "volar.tsPlugin": true 17 | } 18 | -------------------------------------------------------------------------------- /examples/lazy-loading/webpack/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import './index.css' 4 | import { setupRouter } from './router' 5 | import { setupI18n } from './i18n' 6 | import en from './locales/en.json' 7 | 8 | const i18n = setupI18n({ 9 | globalInjection: true, 10 | locale: 'en', 11 | fallbackLocale: 'en', 12 | messages: { 13 | en 14 | } 15 | }) 16 | const router = setupRouter(i18n) 17 | 18 | const app = createApp(App) 19 | app.use(i18n) 20 | app.use(router) 21 | app.mount('#app') 22 | -------------------------------------------------------------------------------- /examples/type-safe/type-annotation/src/App.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 |+$123,456.79
+$123,456.79"`; 8 | 9 | exports[`issue #1365 1`] = `"Animal
"`; 10 | 11 | exports[`issue #1373 1`] = `"hello, kazupon!
6/5/2023
$100.00
"`; 12 | -------------------------------------------------------------------------------- /examples/storybook/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 |7 | {{ t('localizationMsg') }} 8 |
9 | {{ t('navigating') }} 10 |
4 |
5 |
{{ $t('pages.home.virtual', { msg: foo.msg }) }}
11 |{{ $t('pages.home.inter') }}
12 | 13 |message: {{ t('messages.hello', { name: 'kazupon' }) }}
43 |currecy: {{ n(1000, 'currency') }}
44 | 45 | -------------------------------------------------------------------------------- /examples/type-safe/global-type-definition/src/vue-i18n.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * global type definitions 3 | * using the typescript interface, you can define the i18n resources that is type-safed! 4 | */ 5 | 6 | /** 7 | * you need to import the some interfaces 8 | */ 9 | import { DefineLocaleMessage, DefineDateTimeFormat, DefineNumberFormat } from 'vue-i18n' 10 | 11 | declare module 'vue-i18n' { 12 | // define the locale messages schema 13 | export interface DefineLocaleMessage { 14 | hello: string 15 | menu: { 16 | login: string 17 | } 18 | errors: string[] 19 | } 20 | 21 | // define the datetime format schema 22 | export interface DefineDateTimeFormat { 23 | short: { 24 | hour: 'numeric' 25 | minute: 'numeric' 26 | second: 'numeric' 27 | timeZoneName: 'short' 28 | timezone: string 29 | } 30 | } 31 | 32 | // define the number format schema 33 | export interface DefineNumberFormat { 34 | currency: { 35 | style: 'currency' 36 | currencyDisplay: 'symbol' 37 | currency: string 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/size-check-core/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | 3 | export default defineConfig({ 4 | define: { 5 | __DEV__: false, 6 | // this is only used during tests 7 | __TEST__: false, 8 | // If the build is expected to run directly in the browser (global / esm builds) 9 | __BROWSER__: true, 10 | // is targeting bundlers? 11 | __BUNDLER__: false, 12 | __GLOBAL__: false, 13 | __RUNTIME__: true, 14 | // is targeting Node (SSR)? 15 | __NODE_JS__: false, 16 | __INTLIFY_DROP_MESSAGE_COMPILER__: false, 17 | __INTLIFY_PROD_DEVTOOLS__: false, 18 | 'process.env.NODE_ENV': JSON.stringify('production') 19 | }, 20 | resolve: { 21 | alias: { 22 | '@intlify/core': '@intlify/core/dist/core.esm-bundler.js' 23 | } 24 | }, 25 | build: { 26 | minify: false, 27 | rollupOptions: { 28 | output: { 29 | entryFileNames: `assets/[name].js`, 30 | chunkFileNames: `assets/[name].js`, 31 | assetFileNames: `assets/[name].[ext]` 32 | } 33 | } 34 | }, 35 | plugins: [] 36 | }) 37 | -------------------------------------------------------------------------------- /e2e/components/datetime-format.spec.ts: -------------------------------------------------------------------------------- 1 | import { getText, url } from '../helper' 2 | ;['composition'].forEach(pattern => { 3 | describe(`${pattern}`, () => { 4 | beforeAll(async () => { 5 | await page.goto(url(`/examples/${pattern}/components/datetime-format.html`)) 6 | }) 7 | 8 | test('rendering', async () => { 9 | console.log(new Date()) 10 | expect(await getText(page, '#app p.p1')).toMatch( 11 | /([1-9]|1[0-2])\/([1-9]|[12]\d|3[01])\/([12]\d{3})/ 12 | ) 13 | expect(await getText(page, '#app p.p2')).toMatch( 14 | /(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])\/([12]\d{3}), (0\d|1[0-2]):([0-5]\d):([0-5]\d)\u202f(AM|PM)/ 15 | ) 16 | expect(await getText(page, '#app p.p3')).toMatch( 17 | /令和([1-9]|1[0-2])年([1-9]|1[0-2])月([1-9]|[1-3]\d)日([月火水木金土日])曜日 (午前|午後)(\d|1[0-2]):([0-5]\d):([0-5]\d) 協定世界時/ 18 | ) 19 | expect(await getText(page, '#app span.p4')).toMatch( 20 | /([1-9]|1[0-2])年([1-9]|1[0-2])月([1-9]|[1-3]\d)日([月火水木金土日])曜日 (午前|午後)(\d|1[0-2]):([0-5]\d):([0-5]\d) 協定世界時/ 21 | ) 22 | }) 23 | }) 24 | }) 25 | -------------------------------------------------------------------------------- /e2e/missing/handler.spec.ts: -------------------------------------------------------------------------------- 1 | import { getText, url } from '../helper' 2 | ;['composition', 'petite'].forEach(pattern => { 3 | describe(`${pattern}`, () => { 4 | const warnings: string[] = [] 5 | beforeAll(async () => { 6 | page.on('console', msg => { 7 | if (msg.type() === 'warning') { 8 | const text = msg.text() 9 | if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) { 10 | warnings.push(msg.text()) 11 | } 12 | } 13 | }) 14 | await page.goto(url(`/examples/${pattern}/missing/handler.html`)) 15 | }) 16 | 17 | test('warning', () => { 18 | console.log() 19 | // missing handler warning 20 | expect(warnings[0]).toEqual(`detect 'message.hello' key missing in 'ja'`) 21 | // fallback warning 22 | expect(warnings[1]).toEqual( 23 | `[intlify] Fall back to translate 'message.hello' key with 'en' locale.` 24 | ) 25 | }) 26 | 27 | test('rendering', async () => { 28 | expect(await getText(page, '#app p')).toMatch('hello world!') 29 | }) 30 | }) 31 | }) 32 | -------------------------------------------------------------------------------- /examples/storybook/README.md: -------------------------------------------------------------------------------- 1 | # storybook 2 | 3 | This template should help get you started developing with Vue 3 in Vite. 4 | 5 | ## Recommended IDE Setup 6 | 7 | [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). 8 | 9 | ## Type Support for `.vue` Imports in TS 10 | 11 | TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. 12 | 13 | ## Customize configuration 14 | 15 | See [Vite Configuration Reference](https://vite.dev/config/). 16 | 17 | ## Project Setup 18 | 19 | ```sh 20 | pnpm install 21 | ``` 22 | 23 | ### Compile and Hot-Reload for Development 24 | 25 | ```sh 26 | pnpm dev 27 | ``` 28 | 29 | ### Type-Check, Compile and Minify for Production 30 | 31 | ```sh 32 | pnpm build 33 | ``` 34 | 35 | ### Lint with [ESLint](https://eslint.org/) 36 | 37 | ```sh 38 | pnpm lint 39 | ``` 40 | -------------------------------------------------------------------------------- /examples/storybook/src/components/icons/IconCommunity.vue: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /packages/vue-i18n-core/src/vue.d.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { Composer } from './composer' 3 | import type { I18n, I18nInternal } from './i18n' 4 | 5 | declare module 'vue' { 6 | // eslint-disable-next-line 7 | export interface Apphello!
hello!
hello!
hello!
i18n-t inside of slothello!
こんにちは!
こんにちは!
こんにちは!
こんにちは!
i18n-t inside of slotこんにちは!
{{ description }}
36 |{{ t("hello, {name}!", { name: 'kazupon' }) }}
12 |{{ t("message.hello") }}
12 |{{ theme }}
23 |
24 | ### Page Data
25 |
26 | {{ page }}
27 |
28 | ### Page Frontmatter
29 |
30 | {{ frontmatter }}
31 | ```
32 |
33 |
38 |
39 | ## Results
40 |
41 | ### Theme Data
42 |
43 | {{ theme }}
44 |
45 | ### Page Data
46 |
47 | {{ page }}
48 |
49 | ### Page Frontmatter
50 |
51 | {{ frontmatter }}
52 |
53 | ## More
54 |
55 | Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
56 |
--------------------------------------------------------------------------------
/examples/petite/fallback/format.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{ t("hello, {name}!", { name: 'kazupon' }) }}
12 |