Coder Social home page Coder Social logo

torzech / twig-gettext-extractor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unit27/twig-gettext-extractor

0.0 2.0 0.0 44 KB

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

License: Other

PHP 97.51% HTML 2.49%

twig-gettext-extractor's Introduction

unit27: Twig Gettext Extractor (PHP)

The Twig Gettext Extractor is Poedit friendly tool which extracts translations from twig templates.

Installation

The recommended way to install Twig Gettext Extractor is through composer.

{
    "require": {
        "unit27/twig-gettext-extractor": "1.1.*"
    }
}

Setup

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

  • Language: Twig
  • List of extensions: *.twig
  • Invocation:
    • Parser command: <project>/vendor/bin/twig-gettext-extractor --sort-output --force-po -o %o %C %K -L PHP --files %F
    • An item in keyword list: -k%k
    • An item in input file list: %f
    • Source code charset: --from-code=%c

Now you can update your catalog and Poedit will synchronize it with your twig templates.

Tests

To run the test suite, you need composer and PHPUnit.

$ composer install --dev
$ phpunit

License

Twig Gettext Extractor is licensed under the MIT license.

twig-gettext-extractor's People

Contributors

jasny avatar torzech avatar umpirsky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.