iainbeeston / nickel

Nickel extracts date, time, and message information from naturally worded text.
MIT License
112 stars 17 forks source link

Internationalization #5

Open scanferla opened 10 years ago

scanferla commented 10 years ago

Hi!

Would be possible to use Nickel in another languages?

Thanks in advance!

iainbeeston commented 10 years ago

At present it only supports US English, but internationalisation is something I'd love to implement. I have no firm plans yet though, I'm afraid

scanferla commented 10 years ago

Can you point me in the right direction? I can translate it to Brazilian Portuguese.

What files do I have to edit in order to translate/interternationalize Nickel? And other any considerations too.

Thanks!

iainbeeston commented 10 years ago

I think internationalising the gem will take a lot of work and major restructuring. The main classes that would need to change would be query.rb and query_constants.rb, but there is no clean way of plugging in another language, so far as I'm aware.

I do plan on refactoring the code to allow different languages to plug in, and at that point I would gladly accept a pull request for brazilian portuguese (and other languages too), but I am not ready for that yet.

iainbeeston commented 10 years ago

I appreciate that you're keen to help internationalise the gem and I'll try to prioritise internationalisation, but there are structural issues I'd like to resolve first that will make it easier to add cool new features like this

scanferla commented 10 years ago

Hi @iainbeeston, thank you for your answers! I guess I'll try to fork and translate it "hard-coded" for now.

Please let me know if I can help you in any way, thanks again!

iainbeeston commented 10 years ago

I'm planning on moving a lot of the English language substitutions out to yaml files in a future release. That should make it easier to translate, although I suspect more work will be needed

scanferla commented 10 years ago

That would be awesome! Is there any way that I can help you?

iainbeeston commented 10 years ago

I'm planning on making each translation an independent gem, such that when the gem is loaded it registers itself with nickel, and then nickel can be switched to use any registered language.

I can't maintain languages that I don't understand, so hopefully this will help. You'd be more than welcome to help me test this design out with a Brazilian Portuguese translation gem, once I have the infrastructure in-place.

scanferla commented 10 years ago

Great! I will certainly help you with the Brazilian Portuguese gem and I can start as soon as you have the infrastructure in-place.