web_translate_it gem v 1.7.2.0 released
By Edouard on 10 mars 2011
I just released a new version of the synchronisation client wti
for Web Translate It. wti
is a powerful command line tool to synchronise your local translation files with the Web Translate It service.
This is a somewhat important release . It includes several new features, and deprecates a few commands.
New features
Hooks
The before_pull
and after_pull
hooks now work within wti pull
. Prior to this version they were only used by the synchronisation server.
There are also 2 new hooks: before_push
and after_push
, which are executed before and after pushing new translations.
These hooks can be defined in the configuration file.
Here’s an example:
api_key: sekret
# Optional: locales not to sync with Web Translate It.
# eg. [:en, :fr] or just 'en'
# ignore_locales: 'en'
# Optional hooks
before_pull: "say 'before pull'"
after_pull: "say 'after pull'"
before_push: "say 'before push'"
after_push: "say 'after push'"
Multi-locales push and pull
wti pull -l
and wti push -l
now accept several locales passed as an argument. So you can do:
$ wti pull -l "fr en ja kr"
Which will pull your language files for French, English, Japanese and Korean.
Better help
Under the hood, we replaced the option parser. The new parser gives better control over the accepted options. Each command now has its own help topic, by appending --help
. For instance you can type: wti pull --help
which gives:
Usage: wti <command> [options]+
The most commonly used wti commands are:
pull Pull target language file(s)
push Push master language file(s)
match Display matching of local files with File Manager
add Create and push a new master language file
addlocale Add a new locale to the project
server Start a synchronisation server
status Fetch and display project statistics
init Configure your project to sync
See `wti <command> --help` for more information on a specific command.
[options] are:
--config, -c: Path to a translation.yml file (default: .wti)
--version, -v: Print version and exit
--help, -h: Show this message
Colour!
wti
now use some colour and display successes in green, and failures in red.
Deprecations
wti autoconf
displays a deprecation warning. This command will be deprecated in a future version in favour ofwti init
.wti stats
displays a deprecation warning. This command will be deprecated in a future version in favour ofwti status
. A new aliaswti st
has also been created.wti push --ignore_missing
andwti push --low_priority
were replaced bywti push --ignore-missing
andwti push --low-priority
.
Upgrade
To upgrade to the latest version, type in a terminal: gem install web_translate_it
.