An open API service indexing awesome lists of open source software.

https://github.com/patrickgramatowski/habluhablu_gem

:earth_americas: HabluHablu is a CLI written in Ruby, which allows you to generate a language file (for I18n) with translations of the most useful phrases.
https://github.com/patrickgramatowski/habluhablu_gem

cli gem i18n ruby ruby-gem ruby-on-rails translations

Last synced: 9 months ago
JSON representation

:earth_americas: HabluHablu is a CLI written in Ruby, which allows you to generate a language file (for I18n) with translations of the most useful phrases.

Awesome Lists containing this project

README

          

[![Gem Version](https://badge.fury.io/rb/habluhablu.svg)](https://badge.fury.io/rb/habluhablu)
[![Build Status](https://travis-ci.org/patrickgramatowski/habluhablu_gem.svg?branch=master)](https://travis-ci.org/patrickgramatowski/habluhablu_gem)

# HabluHablu

:earth_americas: HabluHablu is a CLI written in Ruby, which allows you to generate a language file (for I18n) with translations of the most useful phrases. :closed_book:

:dart: The main goal for me is to create a library of translations for the most of languages and maybe even for the most popular dialects.
What about ancient languages? :scroll:

## Supported languages

- English
- Spanish
- German
- French
- Italian
- Japanese
- Russian
- Korean
- Portuguese
- Turkish
- Polish
- Hungarian
- Thai (th - symbol)
- Chinese (zh - symbol)
- Arabic
- Hebrew
- If you want to help me out and add your language, don't hesitate!
- In progress...

### Installation

**Important!**
To be able to use the gem:
- Install [I18n gem](https://github.com/ruby-i18n/i18n)

Add this line to your application's Gemfile:

```ruby
gem 'habluhablu'
```

And then execute:

$ bundle install

Or install it yourself as:

$ gem install habluhablu

### Usage

[List of symbols](https://www.w3.org/International/O-charset-lang.html)
Generate file for a specific language using `habluhablu -l ` command.

Generate an example language file using `habluhablu -l example` command (it generates empty file with keywords to fill).

Generate files for a more languages using `habluhablu -m (separated by '_')` command.

To generate a keyword for all languages files use: `habluhablu -k ` command.

To translate a phrase/word use: `habluhablu -t hello_world -f en -o es`, where the command translates 'hello there' to spanish (-o flag).

**Important!** to use translator you will have to create an account [Google API](https://rapidapi.com/googlecloud/api/google-translate1) and set the api key as ENV variable - `ENV['HABLUHABLU_API_KEY']`

If you want to generate your own sample for languages files, You can do it by:
- creating your own sample.yml file in config/locales directory
- using `habluhablu -s (separated by '_')` command

Generate a json file of the languages you want, use `habluhablu -j (separated by '_')` command.

`habluhablu --help`

There is also an option to add countries flag using bootstrap (for more informations go to languages/Countries_Flags.md).

### Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/patrickgramatowski/habluhablu_gem.

### License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).