2017 © Pedro Peláez
 

project cli

Command-line tool to interact with Openl10n

image

openl10n/cli

Command-line tool to interact with Openl10n

  • Wednesday, March 2, 2016
  • by MattKetmo
  • Repository
  • 4 Watchers
  • 13 Stars
  • 368 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 12 Open issues
  • 6 Versions
  • 7 % Grown

The README.md

OpenLocalization CLI tool

Build status... Code quality... License MIT Packagist Dependency Status, (*1)

Install

Download the last PHAR file from the releases panel and add it to your $PATH:, (*2)

VERSION=vX.X.X
curl -LO "https://github.com/openl10n/openl10n-cli/releases/download/${VERSION}/openl10n.phar"
chmod +x openl10n.phar
mv openl10n.phar /usr/local/bin/openl10n

Or clone the source and build it manually using Composer and Box Project., (*3)

git clone https://github.com/openl10n/openl10n-cli.git; cd openl10n-cli
composer install
box build
mv openl10n.phar /usr/local/bin/openl10n

You can also include it directly in a PHP project by adding it in your Composer dependencies:, (*4)

composer require openl10n/cli

Usage

Write a .openl10n.yml file on the root of your project:, (*5)

# Server configuration
server:
    hostname: openl10n.dev # Location of your openl10n instance
    port: 80               # Specify port if needed (optional)
    use_ssl: true          # If openl10n is protected by ssl (optional)
    username: user         # User credentials (login)
    password: userpass     # User credentials (password)

# Project identifier
project: foobar

# Path to the translation files
files:
    # Example of patterns for a standard Symfony application
    - pattern: app/Resources/translations/*.<locale>.*
    - pattern: src/*Bundle/Resources/translations/*.<locale>.*

If you use versionning with this configuration file then it's better to specify server credentials outside of the project., (*6)

You can use an alias in the .openl10n.yml file:, (*7)

# Server configuration
server: foobar

and reference the credentials for this alias into the $HOME/.openl10n/server.conf file:, (*8)

[foobar]
hostname: openl10n.dev
port: 80
use_ssl: true
username: user
password: userpass

Upload translations:, (*9)

openl10n push --locale=all

Download translations:, (*10)

openl10n pull --locale=all

Select files to upload

You can select the files you want to push to the server by adding a file name list at the end of the command:, (*11)

openl10n push --locale=all app/Resources/fr.yml config/translations/de.yml

Select files to download

Same thing here:, (*12)

openl10n pull --locale=all app/Resources/fr.yml config/translations/de.yml

License

OpenLocalization is released under the MIT License. See the bundled LICENSE file for details., (*13)

The Versions