From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.90.79.9 with SMTP id c9cs11735agb; Mon, 2 Nov 2009 16:01:35 -0800 (PST) Received: by 10.224.52.94 with SMTP id h30mr3229226qag.348.1257206494041; Mon, 02 Nov 2009 16:01:34 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id 11si8022744qyk.112.2009.11.02.16.01.33; Mon, 02 Nov 2009 16:01:34 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id AC3B2159807F; Mon, 2 Nov 2009 19:01:33 -0500 (EST) Received: from SRV-HS3.netsons.net (srv-hs3.netsons.net [94.198.98.103]) by rubyforge.org (Postfix) with ESMTP id B5ED91588065 for ; Mon, 2 Nov 2009 19:01:23 -0500 (EST) Received: from [94.161.1.8] (helo=localhost) by SRV-HS3.netsons.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1N56pn-0004sp-FX for sup-talk@rubyforge.org; Tue, 03 Nov 2009 01:01:21 +0100 From: Fabio Riga To: sup-talk In-reply-to: <1257169884-sup-2615@tilus.net> References: <1254353101-sup-1021@thinkpad-ubuntu> <1254415145-sup-635@masanjin.net> <1254420802-sup-3742@thinkpad-ubuntu> <1254421405-sup-8083@masanjin.net> <1254442420-sup-3771@thinkpad-ubuntu> <1254487575-sup-5468@thinkpad-ubuntu> <1256280223-sup-736@tilus.net> <1256295847-sup-9437@viajero> <1257163780-sup-1357@masanjin.net> <1257169884-sup-2615@tilus.net> Date: Tue, 03 Nov 2009 01:01:08 +0100 Message-Id: <1257202138-sup-5711@viajero> User-Agent: Sup/git X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - SRV-HS3.netsons.net X-AntiAbuse: Original Domain - rubyforge.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - comunicattiva.it Subject: Re: [sup-talk] i18n? X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org 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