Installation
Installing the gem is fairly easy. In your Gemfile
:
gem "mi_hermano"
Usage
To use Mi Hermano, you’ll have to create an empty Google Spreadsheet and use its key (found in its URL) when calling setup
:
MiHermano.setup({
:username => "[email protected]",
:password => "my_secret_password",
:spreadsheet_key => "nxBFQGKpnzObbVyyIkGtajktMFAhDRGFiEdM66Vacmjz",
})
After that, you can use translate
to translate strings:
MiHermano.translate("Hello, my friends!", :en, :fr)
Options
You can define a default source language and a default target language when initializing Mi Hermano. These settings will be used if you do not specify a source or a target when calling translate
.
MiHermano.setup({
:username => "[email protected]",
:password => "my_secret_password",
:spreadsheet_key => "nxBFQGKpnzObbVyyIkGtajktMFAhDRGFiEdM66Vacmjz",
:default_source => :en,
:default_target => :es
})
MiHermano.translate("Hello, my friends!")
License
Mi Hermano is © 2012 Rémi Prévost and may be freely distributed under the MIT license. See the LICENSE
file.