Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Fabio Riga <usul@aruba.it>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] i18n?
Date: Tue, 03 Nov 2009 01:01:08 +0100	[thread overview]
Message-ID: <1257202138-sup-5711@viajero> (raw)
In-Reply-To: <1257169884-sup-2615@tilus.net>

Excerpts from Tero Tilus's message of lun nov 02 14:58:09 +0100 2009:
> William Morgan, 2009-11-02 14:12:
> > Tero's comment wasn't about gettext, as far as I understand it.
> 
> You had me right.  I was talking about the approach to i18n in general.

Sorry, I think the problem here is my English. I understood Tero's
comment wasn't about gettext, I was the one suggesting: "everybody's
using gettext, why don't we?"

> > There are Ruby gettext bindings but they look like a pain in the ass
> > to use, and it's pretty trivial to replace it a language like Ruby.
> 
> Also they are pretty trivial to wrap behind nice interface in a
> language like Ruby.  "Been there, done that!".t  :)

And you both answered that question... I'm just a hobbyist ruby
programmer, never used gettext. I transleted a program that use it (my
previous mail client :D) so I can read a .po file (I don't understand
why this is a problem, though). I thought it was an easy, ready-made
thing to implement, if I'm wrong, no problem, there is always a better
solution.

> > I believe he was thinking about something like git grep. You see a
> > weird message displayed by Sup, you want to find the code that's
> > generating it, you can git grep the source for the message directly.
> 
> That was exactly what I was thinking.
> 
> Having weird keys in code imo also slows down development.  If I want
> to (write code to) display a simple message to user, with "original
> language as key" approac i just write "my message".t (or whatever the
> l10n interface is) instead of modifying some yaml file somewhere and
> then copy-pasting the key from there to code. I just plain code and
> let somebody else figure out the translation later or.
> 
Sorry, I don't understand what you mean. The idea is to (1) have a branch
for every language? Translators directly write in the code? Or (2)  "original
language as key" means a way to substitute "on the fly" the original
string with another one in the current locale? In this way you always need a
yaml file, or a ruby hash, or a .po file (you can implement it in another
way, but is the gettext approach...).

So, I played a little with irb... do you mean something like:

class String
  def t
    l10n_hash[self] || self
  end
end

Sounds good to me...

"bye bye".t
=> "ciao ciao"
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


  parent reply	other threads:[~2009-11-03  0:01 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 23:30 Christopher Bertels
2009-10-01 16:44 ` William Morgan
2009-10-01 18:15   ` Christopher Bertels
2009-10-01 18:24     ` William Morgan
2009-10-02  0:19       ` Christopher Bertels
2009-10-02 12:52         ` Christopher Bertels
2009-10-05 16:00           ` Christopher Bertels
2009-10-06 15:38             ` William Morgan
2009-10-06 20:35               ` Christopher Bertels
2009-10-06 21:56                 ` Christopher Bertels
2009-10-20 12:33                   ` Christopher Bertels
2009-10-21 12:29                     ` Fabio Riga
2009-10-21 16:41                       ` Guillaume Quintard
2009-10-21 18:37                       ` Christopher Bertels
2009-10-23  7:00           ` Tero Tilus
2009-10-23 11:23             ` Fabio Riga
2009-11-02 12:12               ` William Morgan
2009-11-02 13:58                 ` Tero Tilus
2009-11-02 14:59                   ` William Morgan
2009-11-03  0:01                   ` Fabio Riga [this message]
2009-11-03  1:22                     ` Tero Tilus
2009-11-02 12:13             ` William Morgan
2009-11-03 14:05               ` Christopher Bertels
2009-11-03 15:08                 ` Tero Tilus
2009-11-03 15:13                   ` William Morgan
2009-11-03 15:23                     ` Christopher Bertels
2009-10-01 18:21   ` Christopher Bertels
2009-10-01 18:33   ` Christopher Bertels
2009-10-01 18:47     ` Rich Lane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257202138-sup-5711@viajero \
    --to=usul@aruba.it \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox