Translatomatic

About Translatomatic

Translatomatic (TM) is a free and open source text translation utility written in ruby. It combines the translation quality of a chinese gadget’s instruction manual with the convenience and ease of use of a command line tool such as git.

The main use of Translatomatic is to translate a file to one or more languages. The following file formats are currently supported:

The following translation APIs can be used with Translatomatic:

Installation

Install the translatomatic gem with the following command:

$ gem install translatomatic

Usage

This gem provides an executable called translatomatic. The translatomatic command has a number of functions, not all of which are documented here. For help on available commands and options, execute:

$ translatomatic help

And for help on a command, execute:

$ translatomatic translate help
$ translatomatic translate help file

Setup

Check for available translation services and options with the services command:

$ translatomatic services

Options can be specified on the command line, in environment variables, or in translatomatic’s configuration file. The configuration file can be modified using translatomatic’s internal config command. To list all available configuration settings, use:

$ translatomatic config list
$ translatomatic config describe

See also the Configuration section below for more information.

Translating files

When translating files, translatomatic translates text one sentence or phrase at a time. If a file is re-translated, only sentences that have changed since the last translation are sent to the translator, and the rest are sourced from the local database.

To translate a Java properties file to German and French using the Google translator:

$ translatomatic translate file strings.properties de,fr --translator Google

This would create (or overwrite) strings_de.properties and strings_fr.properties with translated properties.

Displaying strings from a resource bundle

To read and display the store.description and store.name properties from local resource files in English, German, and French:

$ translatomatic display --locales=en,de,fr \
    resources/strings.properties store.description store.name

Extracting strings from source files

To extract strings from some source files, use the strings command, e.g.

$ translatomatic strings file.rb

Configuration

Translatomatic configuration examples

To set one or more translation services to use:

$ translatomatic config set translator Microsoft,Yandex

Secondary translators will only be used if a translation error occurs when using the first choice.

To set a default list of target locales:

$ translatomatic config set target_locales en,de,es,fr,it

With target_locales set, files can be translated without specifying target locales in the translate file command.

$ translatomatic translate file resources/strings.properties

To display the current configuration, execute

$ translatomatic config list

Database configuration

By default, translatomatic uses an sqlite3 database in $HOME/.translatomatic/translatomatic.sqlite3 to store translated strings.
To store translations in a database, you should have an appropriate database adapter installed, such as the sqlite3 gem. Translatomatic does not install database adapters automatically.
The database configuration can be changed by creating a database.yml file under $HOME/.translatomatic/database.yml for the production environment, e.g.

production:
  adapter: mysql2
  host: db.example.com
  database: translatomatic
  pool: 5
  encoding: utf8
  username: username
  password: password

License

The gem is available as open source under the terms of the MIT License.

vintage LCD Game collection

Not long ago, Smuggly Systems Intergalactic scientists created the vintage LCD Game framework, enabling the en-masse production of cheap LCD Games. At the current production rate of one game every two weeks, we will have created approximately 350 games by the year 2020. You could buy all of them for the low low cost of $346.50. For a list of currently available games, see the new Smuggly Systems Intergalactic apps page.

Exciting new website released

Regular readers of the rapidly paced Smuggly Systems Intergalactic blog may have detected a change in presentation recently. The reason? a new website has been released! The Smuggly Systems Intergalactic Interwebs division has been hard at work for the past 7 years, developing an awe inspiring and professional interwebs portal. Unfortunately due to recent budget cuts that development was scrapped and replaced with the version you see now, which was whipped up over the course of one weekend. Head Office has decreed that the new website be placed at the top of all search results immediately.

McGuire® 1.0 now available for immediate purchasing and downloading from the App Store

After months of development, testing, and almost imperceptible colour gamut tweaks, Smuggly Systems Intergalactic’s latest and greatest iOS game has been released to the app store. McGuire is an expansion and trading strategy game where the aim of the game is to win. Pit your corporation trading skills against those of three cavalierly programmed AI computer players. Acquire, sell, and trade corporations on a convenient 9×12 grid. Game features include:

  • three AI computer players
  • game center leaderboard
  • inappropriate sound effects

Now available for iPhone, iPad, and iPod touch.

Cricket Calculator 1.0.1 update released

An update to the highly successful Cricket Calculator iPhone application is now on the app store. A new green colour scheme featuring a grass background will convince you that you are actually at a cricket ground as you are performing all-important rain affected target calculations. If you are already at a cricket ground the new background will have no effect.

Cricket Calculator 1.0 now on sale

Smuggly Systems Intergalactic is proud to announce that Cricket Calculator is now available for iPhone, iPad, or iPod touch.
Have you ever been playing in a rain affected cricket match, but were unable to calculate revised targets due to lack of access to the Duckworth-Lewis data tables? this all-too-common dilemma will be no more after you install the Cricket Calculator application on your iPhone, iPad, or iPod touch.

Change to trademark

MEMO: Head office advises that effective immediately, the Smuggly Systems Intergalactic Inc. slogan: “You should buy our products soon” – is discontinued. The marketing department has developed a more compelling brand and the new slogan: “You must buy our products immediately” is now fully operational. All business cards, stationery, t-shirts, coffee mugs and other parephenalia bearing the old slogan are to be shredded and then incinerated.