Extract translatable strings from Vue files

Overview

gettext-vue

Extract translatable strings from Vue files. By default, looks for the keywords $t, $gettext, and $ngettext.

Installation

npm install -g gettext-vue

Usage

xgettext-vue [OPTION] [INPUTFILE]...

Options

Input file location:
  -f, --files-from  get list of input files from FILE
  -D, --directory   add DIRECTORY to list for input files search[default: ["."]]

Output file location:
  -o, --output  write output to specified file          [default: "messages.po"]

Input file interpretation:
  --from-code  encoding of input files                        [default: "ascii"]

Operation mode:
  -j, --join-existing  join messages with existing file         [default: false]

Output details:
  --force-po     write PO file even if empty                    [default: false]
  --no-location  do not write '#: filename:line' lines          [default: false]

Informative output:
  -h, --help     display this help and exit                            [boolean]
  -V, --version  output version information and exit                   [boolean]

API

new Parser(keywordspec)

Creates a new parser.

The keywordspec parameter is optional, with the default being:

{
  '$t': [0],
  '$gettext': [0],
  '$ngettext': [0, 1]
}

Each keyword (key) requires array of argument number(s) (value). When multiple argument numbers are specified, expressions using this keyword are treaded as single-plural.

.parse(template)

Parses the template string for Swig expressions using the keywordspec.

It returns an object with this structure:

{
  msgid1: {
    line: [1, 3]
  },
  msgid2: {
    line: [2],
    plural: 'msgid_plural'
  }
}

Credits

Largely based on gettext-ejs and xgettext-template

You might also like...
🛠️Vue kit of useful Vue Composition API functions
🛠️Vue kit of useful Vue Composition API functions

🛠️ Vue kit of useful Vue Composition API functions.

Vue Json Pretty - A Vue component for rendering JSON data as a tree structure.
Vue Json Pretty - A Vue component for rendering JSON data as a tree structure.

Vue Json Pretty A Vue component for rendering JSON data as a tree structure. Now it supports Vue3 at least. If you still use Vue2, see 1.x. English |

:boom: Vue plugin for work with local storage, session storage and memory storage from Vue context
:boom: Vue plugin for work with local storage, session storage and memory storage from Vue context

vue-ls Vue plugin for work with local storage, session storage and memory storage from Vue context jsFiddle Example Vue 1.x Vue 2.x Install CDN Recomm

Vue directive for conditional rendering element on screen smaller than breakpoints
Vue directive for conditional rendering element on screen smaller than breakpoints

vue-not-visible Vue directive for conditional rendering (like v-if) element on screen smaller than breakpoints; 📺 Demo Install $ npm install --save v

Provides reactivity window size properties for Vue.js

vue-window-size Provides reactivity window size properties for Vue.js. Install for Vue v3 The following command installs vue-window-size v1. $ yarn ad

↔ Vue component that scales its child node in relation to its parent node's width
↔ Vue component that scales its child node in relation to its parent node's width

vue-responsive-text Vue component that scales its child node in relation to its parent node's width Installation Install the package from npm by runni

simple vue plugin to implement underscore

vue-underscore You know Underscore.js is a utility-belt library for JavaScript that provides support for the usual functional suspects (each, map, red

Vue composition-api composable components. i18n, validation, pagination, fetch, etc. +50 different composables

vue-composable Out-of-the-box ready to use composables 🌴 TreeShakable 🧙‍♂️ Fully Typescript 💚 Vue 3 and 2 support 🔨 Vue Devtools support Introduct

🕶 Vue Composition API for automatic fetch data when condition has been changed
🕶 Vue Composition API for automatic fetch data when condition has been changed

vue-condition-watcher 🕶 Introduction Vue Composition API for automatic fetch data when condition has been changed Features ✔ Auto fetch data when con

Comments
  • Bump minimatch from 3.0.4 to 3.1.2

    Bump minimatch from 3.0.4 to 3.1.2

    Bumps minimatch from 3.0.4 to 3.1.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
Pitcher AG
Pitcher AG
Simple VueJS component to parse XLS/CSV files with validation

Simple Vue XLS/CSV parser Description This npm package is based on https://github.com/victorboissiere/vue-xls-csv-parser The objective for this librar

Dan Groza 0 Nov 27, 2018
Internationalization plugin for Vue.js - fluent-vue is Vue.js integration for Fluent.js

Internationalization plugin for Vue.js - fluent-vue is Vue.js integration for Fluent.js

Ivan Demchuk 164 Dec 28, 2022
Vue Use Utilities build on top of vue-demi & @vue/compostion-api

Vue Use Utilities Vue Use Utilities build on top of vue-demi & @vue/compostion-api. It works both for Vue 2 & 3. ✨ Features ?? Composable Utilities ??

Vue Blocks 28 Dec 12, 2022
Collection of essential Vue Composition Utilities for Vue 2 and 3

Collection of essential Vue Composition Utilities ?? Features ?? Interactive docs & demos ?? Seamless migration: Works for both Vue 3 and 2 ⚡ Fully tr

VueUse 96 Dec 23, 2022
Transforms Vue.js 2.0 SFCs to Vue.js 3.0 Composition API syntax.

vue2-migration-helper Transforms Vue.js SFCs to composition api syntax. Install npm i vue2-migration-helper CLI # convert all .vue files in source dir

Muhammad Ubaid Raza 26 Nov 1, 2022
🤲 Use Vue 3's Fragment feature in Vue 2 to return multiple root elements

?? Vue 2 fragment directive to return multiple root elements

hiroki osame 180 Dec 22, 2022
The word highlighter library for Vue 2 and Vue 3.

The word highlighter library for Vue 2 and Vue 3.

ryo 122 Jan 3, 2023
Leon L. 4 Nov 8, 2022
JSX for Vue 3 - Babel Plugin JSX for Vue 3.0

JSX for Vue 3 - Babel Plugin JSX for Vue 3.0

vuejs 1.5k Jan 3, 2023
Paystack module for Vue that supports Vue 2 & 3.

Vue-Paystack2 is a Paystack payment gateway integration for Vue which provides Universal support for Vue 2 & 3 Table of Contents ✨ Install ✨ Usage ??

Enoch Chejieh 12 Dec 3, 2022