From stephanwehner at gmail.com Mon Sep 24 12:31:17 2007 From: stephanwehner at gmail.com (Stephan Wehner) Date: Mon, 24 Sep 2007 09:31:17 -0700 Subject: [gettext-u-en] contexts Message-ID: I looked through the documentation of Ruby gettext - I couldn't see whether contexts are supported in the Ruby package. The GNU manual has a section at http://www.gnu.org/software/gettext/manual/gettext.html#Contexts Did I overlook it, or is it not possible in the Ruby version? The website search doesn't bring it up http://www.yotabanana.com/hiki/?c=search&key=context Thanks a lot! Stephan -- Stephan Wehner -> http://stephan.sugarmotor.org -> http://www.thrackle.org -> http://www.buckmaster.ca -> http://www.trafficlife.com -> http://stephansmap.org From mutoh at highway.ne.jp Mon Sep 24 12:46:02 2007 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Tue, 25 Sep 2007 01:46:02 +0900 Subject: [gettext-u-en] contexts In-Reply-To: References: Message-ID: <20070925014602.55662b95.mutoh@highway.ne.jp> Hi, s_() or sgettext() ? http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.s_%28msgid%2C+div+%3D+%22%7C%22%29 On Mon, 24 Sep 2007 09:31:17 -0700 "Stephan Wehner" wrote: > I looked through the documentation of Ruby gettext - I couldn't see > whether contexts are supported in the Ruby package. The GNU manual has > a section at > > http://www.gnu.org/software/gettext/manual/gettext.html#Contexts > > Did I overlook it, or is it not possible in the Ruby version? The > website search doesn't bring it up > > http://www.yotabanana.com/hiki/?c=search&key=context > > > Thanks a lot! > > > Stephan > > > -- > Stephan Wehner > > -> http://stephan.sugarmotor.org > -> http://www.thrackle.org > -> http://www.buckmaster.ca > -> http://www.trafficlife.com > -> http://stephansmap.org > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- .:% Masao Mutoh From stephanwehner at gmail.com Mon Sep 24 14:42:12 2007 From: stephanwehner at gmail.com (Stephan Wehner) Date: Mon, 24 Sep 2007 11:42:12 -0700 Subject: [gettext-u-en] Keeping extra translations in the po files? Message-ID: How does one get to keep translations of extra strings with running rake updatepo as at http://www.suite75.net/blog/dev/tutorial-gettext-for-rails-in-8-steps.html That is, for example you have Rails views with references to strings constructed like this _("Entity_#{code}") Since you know the values of code that occur range between 01,02,03,...,20 you put translations of msgid "Entity_01" msgstr "Flowers" msgid "Entity_02" msgstr "Radishes" : : : etc. in the po files. Then running rake makemo will result in the translations working out fine. But rerunning rake updatepo will remove those translations again. Is there a way to prevent that? Stephan -- Stephan Wehner -> http://stephan.sugarmotor.org -> http://www.thrackle.org -> http://www.buckmaster.ca -> http://www.trafficlife.com -> http://stephansmap.org From stephanwehner at gmail.com Mon Sep 24 14:43:16 2007 From: stephanwehner at gmail.com (Stephan Wehner) Date: Mon, 24 Sep 2007 11:43:16 -0700 Subject: [gettext-u-en] contexts In-Reply-To: <20070925014602.55662b95.mutoh@highway.ne.jp> References: <20070925014602.55662b95.mutoh@highway.ne.jp> Message-ID: On 9/24/07, Masao Mutoh wrote: > Hi, > > s_() or sgettext() ? > Yes, ok, that makes sense. Thanks. Stephan http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.s_%28msgid%2C+div+%3D+%22%7C%22%29 > > On Mon, 24 Sep 2007 09:31:17 -0700 > "Stephan Wehner" wrote: > > > I looked through the documentation of Ruby gettext - I couldn't see > > whether contexts are supported in the Ruby package. The GNU manual has > > a section at > > > > http://www.gnu.org/software/gettext/manual/gettext.html#Contexts > > > > Did I overlook it, or is it not possible in the Ruby version? The > > website search doesn't bring it up > > > > http://www.yotabanana.com/hiki/?c=search&key=context > > > > > > Thanks a lot! > > > > > > Stephan > > > > > > -- > > Stephan Wehner > > > > -> http://stephan.sugarmotor.org > > -> http://www.thrackle.org > > -> http://www.buckmaster.ca > > -> http://www.trafficlife.com > > -> http://stephansmap.org > > _______________________________________________ > > gettext-users-en mailing list > > gettext-users-en at rubyforge.org > > http://rubyforge.org/mailman/listinfo/gettext-users-en > > > > > -- > .:% Masao Mutoh > > _______________________________________________ > gettext-users-en mailing list > gettext-users-en at rubyforge.org > http://rubyforge.org/mailman/listinfo/gettext-users-en > -- Stephan Wehner -> http://stephan.sugarmotor.org -> http://www.thrackle.org -> http://www.buckmaster.ca -> http://www.trafficlife.com -> http://stephansmap.org From mutoh at highway.ne.jp Mon Sep 24 20:00:06 2007 From: mutoh at highway.ne.jp (Masao Mutoh) Date: Tue, 25 Sep 2007 09:00:06 +0900 Subject: [gettext-u-en] Keeping extra translations in the po files? In-Reply-To: References: Message-ID: <20070925090006.f1bca947.mutoh@highway.ne.jp> Hi, On Mon, 24 Sep 2007 11:42:12 -0700 "Stephan Wehner" wrote: > How does one get to keep translations of extra strings with running > > rake updatepo > > as at > > http://www.suite75.net/blog/dev/tutorial-gettext-for-rails-in-8-steps.html > > > That is, for example you have Rails views with references to strings > constructed like this > > _("Entity_#{code}") > > Since you know the values of code that occur range between > 01,02,03,...,20 you put translations of > > msgid "Entity_01" > msgstr "Flowers" > > msgid "Entity_02" > msgstr "Radishes" > : > : > : > etc. in the po files. Then running rake makemo will result in the > translations working out fine. > > But rerunning rake updatepo will remove those translations again. Is > there a way to prevent that? In this case, there are 2 solutions. 1. Use N_() entities = [N_("Entity_01"), N_("Entity_02"), ..., N_("Entity_20")] _(entities(code)) http://www.yotabanana.com/hiki/ruby-gettext-howto.html#How+to+use+GetText.N_%28msgid%29 2. Write your own parser to add these strings. See http://www.yotabanana.com/hiki/ruby-gettext-howto-poparser.html BTW, Ruby-GetText-Package is the library to translate messages. I don't recommand to use these *meaningless* strings as the msgids. > msgid "Entity_01" > msgstr "Flowers" > > msgid "Entity_02" > msgstr "Radishes" How can the translators know "Entity_02" means "Radishes" unless to read the source code or any other documentations? I think the code below is the better way to represent your "Entities". entities = [N_("Flowers"), N_("Radishes"), ..., N_("Fishes")] _(entities(code)) -- .:% Masao Mutoh