# vuei18n-po

> transform gettext .po files for vue-i18n

Latest version **1.4.0** (published 2022-07-22) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install vuei18n-po
pnpm add vuei18n-po
yarn add vuei18n-po
bun add vuei18n-po
```

Provides the command `vuei18n-po`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2022-07-22 |
| First published | 2019-03-01 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Maintainers | pavelstudeny |
| Keywords | vue, vue-i18n, gettext, po, locale, localization, translation |

## Links

- npm: https://www.npmjs.com/package/vuei18n-po
- Repository: https://github.com/avast/vuei18n-po
- Homepage: https://github.com/avast/vuei18n-po#readme
- Issues: https://github.com/avast/vuei18n-po/issues
- npm.io page: https://npm.io/package/vuei18n-po

## Dependencies (5)

- [glob](https://npm.io/package/glob.md) ^7.1.3
- [pofile](https://npm.io/package/pofile.md) ^1.0.11
- [chokidar](https://npm.io/package/chokidar.md) ^3.4.0
- [make-dir](https://npm.io/package/make-dir.md) ^2.0.0
- [minimist](https://npm.io/package/minimist.md) ^1.2.0

## Alternatives

- [messageformat](https://npm.io/package/messageformat.md) — 329.7K weekly downloads
- [@mintlify/scraping](https://npm.io/package/@mintlify/scraping.md) — 294.8K weekly downloads
- [@mintlify/previewing](https://npm.io/package/@mintlify/previewing.md) — 209.5K weekly downloads
- [@mintlify/prebuild](https://npm.io/package/@mintlify/prebuild.md) — 209.5K weekly downloads
- [@mintlify/link-rot](https://npm.io/package/@mintlify/link-rot.md) — 206.3K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2022-07-22
- 1.3.0 — 2020-05-13
- 1.2.0 — 2020-01-02
- 1.1.0 — 2019-03-08
- 1.0.5 — 2019-03-07
- 1.0.4 — 2019-03-05
- 1.0.3 — 2019-03-04
- 1.0.1 — 2019-03-01
- 1.0.0 — 2019-03-01

## README

vuei18n-po
==========

Transform gettext .po files for vue-i18n.

When it comes to plural support, the best data format nowadays is MessageFormat. Unfortunatelly, it isn't well supported neither by Vue nor by translation services.
This modules takes gettext translations (that have a good support among translators) and transforms both the messages and plural rules to be consumable by VueI18n.

man vuei18n-po
--------------
```
  Usage:
    vuei18n-po [OPTIONS]  GLOB_OR_FILE.po ...

  Options:
    --pluralRules=FILE.js
      language plural rules to be imported for VueI18n pluralizationRules

    --messagesFile=FILE.json
      a single file containing all the translation strings, language as a key

    --messagesDir=DIRECTORY
      directory where translations go split by a language

    --whiteList=GLOB
      files that are tested for presence of the message keys;
      the unnused keys are filtered out
```

Usage
-----
```javascript
const vuei18nPo = require('vuei18n-po');

await vuei18nPo({
    po: [ 'en.po', 'translations/**/*.po' ],
    pluralRules: 'spec/data/out/choices.js',
    messagesFile: 'generated/allInOne.json',
    messagesDir: 'generated',
    whiteList: 'src/**/*.vue'
});
```

Plug it in
----------

```javascript
new VueI18n({
      locale: 'en',
      messages: {
        en: require('./generated/en.json'),
        ja: require('./generated/ja.json')
      },
      pluralizationRules: require('./generated/choices.js')
});
```

---
_Source: https://npm.io/package/vuei18n-po · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
