Skip to content

jshmrtn/vue3-gettext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3c7ced5 · Jun 12, 2024
Dec 19, 2023
Nov 9, 2021
Jun 12, 2024
Jun 3, 2024
Jun 12, 2024
Jun 3, 2024
Dec 19, 2023
Feb 2, 2022
Oct 19, 2021
Jul 19, 2023
Feb 24, 2023
Oct 12, 2020
Jun 3, 2024
Nov 9, 2021
Jan 19, 2023
Jan 19, 2023
Apr 4, 2023
Jun 12, 2024
Jun 12, 2024
Jun 3, 2024
Jun 12, 2024
Aug 17, 2022

Repository files navigation


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