Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Using standard Ruby i18n library #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Using standard Ruby i18n library #355

wants to merge 1 commit into from

Conversation

tbjers
Copy link

@tbjers tbjers commented Jun 5, 2016

During today’s National Day of Civic Hacking in Charlotte, Jim van Fleet (co-captain for Code for Charlotte) showed off the NC Balance project to me and a few other new people. He was asked the question how it works with different languages, and we looked at the code and noticed the somewhat primitive if/else clauses in the message generator. We figured that we could make this better by using the Ruby i18n package instead.

This change does not change the messages in any way other than using I18n.t to translate them with. New languages can easily be added by adding a new case statement to the language assignment in MessageGenerator.initialize as well as a file in config/locales.

Added support for internationalization to alleviate if/else bloat.
Loading locales into Sinatra on initialization.
Updated specs to work with i18n and sinatra/i18n.
Updated message_generator.rb with I18n.t usage.

Added support for internationalization to alleviate if/else bloat.
Loading locales into Sinatra on initialization.
Updated specs to work with `i18n` and `sinatra/i18n`.
Updated `message_generator.rb` with `I18n.t` usage.
@lippytak lippytak added the ready label Jun 5, 2016
@daguar daguar removed the ready label Jun 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants