vue3-gettext
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-beta.4 • Public • Published

Vue 3 Gettext 💬


Translate Vue 3 applications with gettext.


Getting started | Demo | Documentation | 中文


Basic usage

In templates:

<span>
  {{ $gettext("I'm %{age} years old!", { age: 32 }) }}
</span>

In code:

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.

License

MIT

Package Sidebar

Install

npm i vue3-gettext

Weekly Downloads

3,777

Version

3.0.0-beta.4

License

MIT

Unpacked Size

109 kB

Total Files

8

Last publish

Collaborators

  • lzurbriggen