Message ID | 46CEDEBE.1060800@cadsoft.de |
---|---|
State | New |
Headers |
Received: from raven.cadsoft.de ([217.7.101.211]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from <Klaus.Schmidinger@cadsoft.de>) id 1IOZKR-0008C1-Jz for vdr@linuxtv.org; Fri, 24 Aug 2007 15:35:59 +0200 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.13.3/8.13.3) with ESMTP id l7ODZwH1004668 for <vdr@linuxtv.org>; Fri, 24 Aug 2007 15:35:58 +0200 Message-ID: <46CEDEBE.1060800@cadsoft.de> Date: Fri, 24 Aug 2007 15:35:58 +0200 From: Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de> Organization: CadSoft Computer GmbH User-Agent: Thunderbird 1.5.0.12 (X11/20060911) MIME-Version: 1.0 To: vdr@linuxtv.org References: <514f4b0e0708190558w723d26c9q503304951af4a231@mail.gmail.com> In-Reply-To: <514f4b0e0708190558w723d26c9q503304951af4a231@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (raven.cadsoft.de [192.168.1.1]); Fri, 24 Aug 2007 15:35:59 +0200 (CEST) Subject: Re: [vdr] VDR-core's texts in plugin's .pot files X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Fri, 24 Aug 2007 13:35:59 -0000 Status: O X-Status: X-Keywords: X-UID: 13917 |
Commit Message
Klaus Schmidinger
Aug. 24, 2007, 1:35 p.m. UTC
On 08/19/07 14:58, Matthias Becker wrote: > Hi, > > plugins can re-use VDR-core translations. With the old "i18n.c" method > plugin authors just did not provide a plugin specific translation for > these texts. > With the new translation method identifying these text got harder for > plugin translators. xgettext puts all texts into the .pot file - also > the texts for which the VDR-core translation should be used. A > translator now cannot see which texts he has to translate and which > not. > > Can this be improved? > > One way of doing this would be to introduce a new macro similar to > trNOOP( ). A plugin author would then tag the vdr-core texts with this > new macro and xgettext would ignore these texts. > > What do you think? You're certainly right. How about this: Klaus
Comments
On 08/24/07 15:35, Klaus Schmidinger wrote: > On 08/19/07 14:58, Matthias Becker wrote: >> ... >> One way of doing this would be to introduce a new macro similar to >> trNOOP( ). A plugin author would then tag the vdr-core texts with this >> new macro and xgettext would ignore these texts. >> >> What do you think? > > You're certainly right. > > How about this: > > --- i18n.h 2007/08/19 14:07:17 1.23 > +++ i18n.h 2007/08/24 13:33:50 > @@ -80,6 +80,7 @@ > > #ifdef PLUGIN_NAME_I18N > #define tr(s) I18nTranslate(s, "vdr-" PLUGIN_NAME_I18N) > +#define trVDR(s) I18nTranslate(s) // to use a text that's in the VDR core's translation file > #else > #define tr(s) I18nTranslate(s) > #endif One more thing: this also reduces I18nTranslate() to const char *I18nTranslate(const char *s, const char *Plugin) { if (s && CurrentLanguage) { const char *t = Plugin ? dgettext(Plugin, s) : gettext(s); if (t != s) return t; } return SkipContext(s); } Klaus
On 08/24/07 16:00, Klaus Schmidinger wrote: > ... > One more thing: this also reduces I18nTranslate() to > > > const char *I18nTranslate(const char *s, const char *Plugin) > { > if (s && CurrentLanguage) { > const char *t = Plugin ? dgettext(Plugin, s) : gettext(s); > if (t != s) > return t; > } > return SkipContext(s); > } Well, actually const char *I18nTranslate(const char *s, const char *Plugin) { if (!s) return s; if (CurrentLanguage) { const char *t = Plugin ? dgettext(Plugin, s) : gettext(s); if (t != s) return t; } return SkipContext(s); } Guess I was a little too enthusiastic when minimizing this code ,-) Klaus
--- i18n.h 2007/08/19 14:07:17 1.23 +++ i18n.h 2007/08/24 13:33:50 @@ -80,6 +80,7 @@ #ifdef PLUGIN_NAME_I18N #define tr(s) I18nTranslate(s, "vdr-" PLUGIN_NAME_I18N) +#define trVDR(s) I18nTranslate(s) // to use a text that's in the VDR core's translation file #else #define tr(s) I18nTranslate(s) #endif