https://github.com/jshmrtn/vue3-gettext
Translate Vue 3 applications with gettext.
https://github.com/jshmrtn/vue3-gettext
gettext i18n internationalization l10n localization translation vue vue3
Last synced: 23 days ago
JSON representation
Translate Vue 3 applications with gettext.
- Host: GitHub
- URL: https://github.com/jshmrtn/vue3-gettext
- Owner: jshmrtn
- License: mit
- Created: 2020-08-25T12:23:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T12:39:14.000Z (8 months ago)
- Last Synced: 2025-03-29T22:05:06.101Z (30 days ago)
- Topics: gettext, i18n, internationalization, l10n, localization, translation, vue, vue3
- Language: TypeScript
- Homepage: https://jshmrtn.github.io/vue3-gettext/
- Size: 3.25 MB
- Stars: 79
- Watchers: 7
- Forks: 25
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Vue 3 Gettext π¬
Translate [Vue 3](http://vuejs.org) applications with [gettext](https://en.wikipedia.org/wiki/Gettext).
Getting started | Demo | Documentation | δΈζ
## Basic usage
In templates:
```jsx
{{ $gettext("I'm %{age} years old!", { age: 32 }) }}
```In code:
```ts
const { $gettext } = useGettext();console.log($gettext("Hello World!"));
```## Features
- simple, ergonomic API
- reactive translations in Vue templates and TypeScript/JavaScript code
- CLI to automatically extract messages from code files
- support for pluralization and message contexts## Contribute
Please make sure your code is properly formatted (the project contains a `prettier` config) and all the tests run successfully (`npm run test`) when opening a pull request.
Please specify clearly what you changed and why.
## Credits
This plugin relies heavily on the work of the original [`vue-gettext`](https://github.com/Polyconseil/vue-gettext/).
## License
[MIT](http://opensource.org/licenses/MIT)