Skip to content

friendly tool which extracts translations from YAML files.

License

Notifications You must be signed in to change notification settings

ModelTech/yml-gettext-extractor

Repository files navigation

YAML Gettext Extractor Build Status

The YAML Gettext Extractor is Poedit friendly tool which extracts translations from YAML file.

Installation

Manual

Local

Download the yml-gettext-extractor.phar file and store it somewhere on your computer.

Global

You can run these commands to easily access yml-gettext-extractor from anywhere on your system:

$ sudo wget https://github.com/ModelTech/YAML-Gettext-Extractor/releases/download/1.0.0/yml-gettext-extractor.phar -O /usr/local/bin/yml-gettext-extractor
$ sudo chmod a+x /usr/local/bin/yml-gettext-extractor

Then, just run yml-gettext-extractor.

Composer

Local

$ composer require ModelTech/yml-gettext-extractor

Global

$ composer global require ModelTech/yml-gettext-extractor

Make sure you have ~/.composer/vendor/bin in your PATH and you're good to go:

$ export PATH="$PATH:$HOME/.composer/vendor/bin"

Don't forget to add this line in your .bashrc file if you want to keep this change after reboot.

Setup

By default, Poedit does not have the ability to parse YML files. This can be resolved by adding an additional parser (Edit > Preferences > Parsers) with the following options:

  • Language: YAML
  • List of extensions: *.yml
  • Invocation:
    • Parser command: <project>/vendor/bin/yml-gettext-extractor --out %o --keys %K --files %F (replace <project> with absolute path to your project)
    • An item in keyword list: -k%k
    • An item in input file list: %f

Now you can update your catalog and Poedit will synchronize it with your yml config files.

About

friendly tool which extracts translations from YAML files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages