hybridgroup / kidsruby

KidsRuby is a Ruby programming environment meant for kids to learn and have fun!
http://kidsruby.com
Other
333 stars 104 forks source link

Improving the translation system #119

Open fnando opened 10 years ago

fnando commented 10 years ago

Hi there!

I want to contribute to the kidsruby project. It's awesome and I'm really excited to get my kid started. That said, I want to propose a change.

I'm from Brazil and decided to translate it to pt-BR (Brazilian Portuguese). I noticed that the translation consists basically in duplicating HTML files and changing their contents. Is that right?

If so, I want to extract all translations into YAML files and create an eRB template system that uses these YAML files (which will be backed by the I18n gem).

The main advantage is that we stop duplicating HTML files, which makes harder when/if you need to change the HTML structure, but also eases the translation process, since you don't have to touch the HTML tags.

What do you think?

hunterboerner commented 10 years ago

I like this idea a lot but I think @deadprogram chose to use html and duplicate it because it would be easier for more people to contribute. I've actually bugged him a few times with this idea but he keeps running away from me.. err... I mean, he's busy (good luck now). If we do something like this would haml be a better choice?

fnando commented 10 years ago

@hunterboerner I like eRB because you don't add yet another abstraction (non-Ruby people) can tweak the HTML and contribute without having to learn too much.

One thing that may help the translation/contribution process is to always wrap YAML strings as multiline blocks. That way you can't go wrong with syntax error.

en:
  keyboard_shortcuts: |
    Default Keyboard Shortcuts

  back_main: |
    Back to main

Makes sense?

fnando commented 10 years ago

Also, we can set up some web interface for I18n. I remember that Thoughtbot open-sourced a web app for that some time ago, but there are other alternatives.

So will be just filling up inputs. ;)

hunterboerner commented 10 years ago

I can imagine: The first tools that localizes the localizer

deadprogram commented 10 years ago

It has been nice to have everything in "plain old HTML", since some of our contributors have not been Ruby programmers, but just know how to edit the HTML files. That said, anything that makes it easier/better for translations is a good thing.

A tool sounds particularly interesting for the installers...

gcapizzi commented 10 years ago

How about just using the i18n gem? It's the one used in Rails and supports Gettext, which is very widespread.

fnando commented 10 years ago

@gcapizzi that's what I proposed:

If so, I want to extract all translations into YAML files and create an eRB template system that uses these YAML files (which will be backed by the I18n gem).

gcapizzi commented 10 years ago

@gcapizzi that's what I proposed:

Whoops, missed that bit :neutral_face: