Project

ripl-i18n

0.0
No commit activity in last 3 years
No release in over 3 years
A ripl plugin that translates ripl to your preferred language. Current supported languages: spanish, chinese, german, portuguese, japanese.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.1.0

Runtime

>= 0.5.0
 Project Readme

Description¶ ↑

A ripl plugin that translates ripl to your preferred language. Current supported languages: spanish, chinese, german, portuguese, japanese.

Usage¶ ↑

Add to your ~/.riplrc:

require 'ripl/i18n'

If a locale exists for your language and is set via your shell variable $LANG, this plugin automatically uses it. Otherwise, explicitly set your language with:

# :es maps to es.yml
Ripl.config[:i18n_locale] = :es

If you want to load and use your own locale:

Ripl::I18n.load 'path/to/my_lang.yml'
Ripl.config[:i18n_locale] = :my_lang

Once you’ve configured a locale, all messages, errors and even help will print in that locale’s language. For example, ripl’s help in german:

$ LANG=de ripl -h
Benutzung: ripl [BEFEHL] [ARGUMENTE] [OPTIONEN]

Optionen:
  -f                  Unterdrücke Laden von ~/.irbrc
  -F                  Unterdrücke Laden von ~/.riplrc
  -d, --debug         Setze $DEBUG auf wahr (wie `ruby -d')
  -I PATH             Pfad an den Anfang des $LOAD_PATH hinzufügen. Begrenze mehrfache Pfade mit ':'
  -r, --require FILE  Lade Datei mittels "require" (wie `ruby -r')
  -v, --version       Gib Version aus
  -h, --help          Gib Hilfe aus

Contribute Your Language¶ ↑

As I would like to make ripl available in as many languages as possible, please add your own! Here’s all you have to do:

  • Fork this project.

  • Create a .yml file under lib/ripl/i18n/locales/ for your language. If you’re not sure what locale to use for your language, see some examples.

  • Be sure to translate all the keys in lib/ripl/i18n/locales/en.yml.

Credits¶ ↑

  • janlelis for auto locale + german translation

  • godfat for chinese translation

  • mephistobooks for japanese translation

Inspiration¶ ↑

yugui.jp/articles/863