2017 © Pedro Peláez
 

project cli

image

php-translation/cli

  • Sunday, August 20, 2017
  • by Nyholm
  • Repository
  • 1 Watchers
  • 3 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

CLI support for translation

Latest Version Build Status Code Coverage Quality Score, (*1)

CLI support for translation. It allows you use the TranslationBundle without installing it in your application. You can use the WebUI and sync translations with remote storages., (*2)

Use

To use the CLI you need to fetch the binary and add your configuration file., (*3)

wget https://php-translation.github.io/cli/downloads/translation.phar
chmod +x translation.phar
touch translation.yml

Example configuration is the same as for the TranslationBundle., (*4)

# translation.yml
translation:
  locales: ["en", "sv"]
  configs:
    app:
      project_root: "%translation.project_root%" # This line is important for the CLI config. 
      dirs: ["%translation.project_root%/app/Resources/views", "%translation.project_root%/src"]
      output_dir: "%translation.project_root%/app/Resources/translations"
      excluded_names: ["*TestCase.php", "*Test.php"]
      excluded_dirs: [cache, data, logs]

Note: "%translation.project_root%" will be your cwd() from where you execute the command., (*5)

You may now run the same commands as you do with the TranslationBundle but without the "translation:" prefix, (*6)

  • download
  • extract
  • sync
  • etc

``` bash php translation.phar download, (*7)


You may also run PHP's web server with the WebUI with: ``` bash php translation.phar webui

Build

To build a phar make sure you have Box project installed and phar.readonly = 0 in your php.ini., (*8)

Read more at: https://moquet.net/blog/distributing-php-cli/, (*9)

make build

The Versions