readme.md in web_translate_it-1.7.3.0 vs readme.md in web_translate_it-1.7.3.1

- old
+ new

@@ -1,9 +1,10 @@ -# Web Translate It +Web Translate It +================ [Homepage](https://webtranslateit.com) | -[RDocs](http://yardoc.org/docs/AtelierConvivialite-webtranslateit) | +[RDoc](http://yardoc.org/docs/AtelierConvivialite-webtranslateit) | [Example app](http://github.com/AtelierConvivialite/rails_example_app) | [Report a bug](http://github.com/AtelierConvivialite/webtranslateit/issues) | [Support](http://help.webtranslateit.com) `web_translate_it` is a rubygem providing tools to sync your language files with [Web Translate It](https://webtranslateit.com), a web-based computer-aided translation tool. @@ -14,30 +15,33 @@ * a command-line executable `wti`, to sync your files between your computer/server and WebTranslateIt.com, * a synchronisation server to help your translation team update your language files from a web interface, * a rack middleware you can use within your Rails app to automatically fetch new translations from Web Translate It. -## Installation +Installation +------------ These instructions are for Linux and Mac OS X system. Follow [these instructions](http://help.webtranslateit.com/kb/tips/how-to-install-wti-on-windows) if you’re using Microsoft Windows. gem install web_translate_it At this point you should have the `wti` executable working. -## Configuration +Configuration +------------- Now that the tool is installed, you’ll have to configure your project: wti init The tool will prompt for: * your Web Translate It API key (you can find it in your project settings), * where to save the configuration file (by default in `config/translations.yml`). -## Usage +Usage +----- Execute `wti --help` to see the usage: wti is a command line tool to sync your local translation files with the WebTranslateIt.com service. @@ -72,93 +76,110 @@ --merge, -m: Force WTI to merge this file --ignore-missing, -i: Force WTI to not obsolete missing strings --label, -b <s>: Apply a label to the changes --help, -h: Show this message -## Web Translate It Synchronisation Console +Sample Commands +--------------- +<table> + <tr> + <th>Command</th> + <th>Action</th> + </tr> + <tr> + <td>wti add path/to/master/file.po</td> + <td>Upload a new master language file</td> + </tr> + <tr> + <td>wti add file1.po file2.po file3.xml</td> + <td>Create several master language files at once, by specifying each file</td> + </tr> + <tr> + <td>wti add *.po</td> + <td>Create several master language files at once, by specifying an extension</td> + </tr> + <tr> + <td>wti push</td> + <td>Update a master language file</td> + </tr> + <tr> + <td>wti push -l fr</td> + <td>Update a target (French) language file</td> + </tr> + <tr> + <td>wti push -l "fr en da sv"</td> + <td>Update several target language files at once (French, English, Danish, Swedish)</td> + </tr> + <tr> + <td>wti push --all</td> + <td>Update all language files at once</td> + </tr> + <tr> + <td>wti pull</td> + <td>Download target language files</td> + </tr> + <tr> + <td>wti pull -l fr</td> + <td>Download a specific language file (French)</td> + </tr> + <tr> + <td>wti pull --all</td> + <td>Download all language files, including source</td> + </tr> + <tr> + <td>wti pull --force</td> + <td>Force pull (to bypass Web Translate It’s HTTP caching)</td> + </tr> + <tr> + <td>wti addlocale fr</td> + <td>Add a new locale to the project</td> + </tr> + <tr> + <td>wti addlocale fr da sv</td> + <td>Add several locales at once</td> + </tr> + <tr> + <td>wti status</td> + <td>View project statistics</td> + </tr> +</table> + +Hooks +----- + +It is sometimes useful to hook a command or a script before or after a push or a pull. One use-case would be to launch a build after pulling language files. You can do that by implementing hooks in your `translation.yml` file. + +There are 4 hooks: + +* `before_pull` +* `after_pull` +* `before_push` +* `after_push` + +Check the [sample `translation.yml`](https://github.com/AtelierConvivialite/webtranslateit/blob/master/examples/translation.yml#L9..L13) file for implementation. + +Web Translate It Synchronisation Console +---------------------------------------- + ![Web Translate It](http://s3.amazonaws.com:80/edouard.baconfile.com/web_translate_it%2Fadmin_console2.png) -The `wti` gem integrates since its version 1.7.0 a sinatra app that provides you with a friendly web interface to sync your translations. It allows a translation team to refresh the language files on a staging server without asking the developers to manually `wti pull`. +`wti` contains a server you can use to run a friendly web interface to sync your translations. It allows a translation team to refresh the language files on a staging server without asking the developers to manually `wti pull`. To get started, go to the directory of the application you want to sync and do: wti server By default, it starts an application on localhost on the port 4000. You will find the tool on `http://localhost:4000`. Should you need to use another host or port, you can use the `-h` and `-p` options. For example: `wti server -p 1234`. -You may want to run some commands before or after syncing translations. To do so, add in the `translation.yml` file the following: +You may want to run some commands before or after syncing translations. You can use the hooks to do so. For instance, you could add the following in your `translation.yml` file: before_pull: "echo 'some unix command'" after_pull: "touch tmp/restart.txt" `before_pull` and `after_pull` are respectively executed before and after pulling language files. - -## Use Cases - -Here are some example commands for the most common scenarios. - -### Upload a new master language file - - wti add path/to/master/file.po - -Create several master language files at once: - - wti add file1.po file2.po file3.xml - -Or: - - wti add *.po - -After receiving your master language files, Web Translate It will automatically create the corresponding target files. If you have already some translations for these files, use `wti push --all` to synchronise them to Web Translate It. - -### Update a master language file - - wti push - -### Update a target language file - -Update the french language file: - - wti push -l fr - -Or several languages at once: - - wti push -l "fr en da sv" - -### Update all language files at once - - wti push --all - -### Download target language files - - wti pull - -### Download a specific language file - - wti pull -l fr - -### Download all language files, including source - - wti pull --all - -### Force pull (to bypass Web Translate It’s HTTP caching) - - wti pull --force - -### Add a new locale to the project - - wti addlocale fr - -Or add several locales at once: - - wti addlocale fr da sv - -### View project stats - - wti status # License Copyright (c) 2009-2011 Atelier Convivialité, released under the MIT License.