Skip to content

Added docs about CLI #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions components/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Command line interface
======================

If you do not want to "pollute" your application with a lot of dependencies you may
install our CLI tool. It is basically the Symfony Translation bundle packed down in
a single PHAR.

The CLI support extracting, syncing and downloading translations. It does also run
the WebUI so you can edit translations in a nice user interface.

Download
--------

.. code-block:: bash

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


Configuration
-------------

Every time you run the CLI it looks for a configuration file named "translation.yml"
that should be located in the same directory that you execute the command. The
configuration will be exact the same as for the TranslationBundle. Example:

.. code-block:: yaml

# translation.yml
translation:
locales: ["en", "sv"]
configs:
app:
dirs: ["%kernel.project_dir%/app/Resources/views", "%kernel.project_dir%/src"]
output_dir: "%kernel.project_dir%/app/Resources/translations"
excluded_names: ["*TestCase.php", "*Test.php"]
excluded_dirs: [cache, data, logs]


Other translation bundles installed
-----------------------------------

The CLI tool does also have a few other translation bundles installed. They are installed
by default to give you the possibility to configure different kind of remote storages.

* Loco Adapter
* Flysystem Adapter
* Phraseapp Adapter
1 change: 1 addition & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ start by looking at the :doc:`overview`.
Common <components/common>
Extractor <components/extractor>
Translator <components/translator>
CLI <components/cli>


.. toctree::
Expand Down
2 changes: 2 additions & 0 deletions spelling_word_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ hotfix
Jonge
Nikic
organisation
Phraseapp
practises
profiler
php
Expand All @@ -29,3 +30,4 @@ wiki
Withlock
workflow
Xliff
yml