From patchwork Thu Aug 23 11:48:22 2007 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Wieninger X-Patchwork-Id: 12511 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1IOBBq-00046f-8q for vdr@linuxtv.org; Thu, 23 Aug 2007 13:49:30 +0200 Received: (qmail invoked by alias); 23 Aug 2007 11:48:59 -0000 Received: from pD95F37E6.dip0.t-ipconnect.de (EHLO [192.168.0.106]) [217.95.55.230] by mail.gmx.net (mp053) with SMTP; 23 Aug 2007 13:48:59 +0200 X-Authenticated: #2425893 X-Provags-ID: V01U2FsdGVkX1+V4BwyRt6V0Ln1nan9XtAlI39NRJW5LtmUGP3/EZ HeB7WepLl8HK7E Message-ID: <46CD7406.3060003@gmx.de> Date: Thu, 23 Aug 2007 13:48:22 +0200 From: Christian Wieninger User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: "vdr@linuxtv.org" X-Y-GMX-Trusted: 0 Subject: [vdr] translation context handling in vdr >= 1.5.7 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Aug 2007 11:49:30 -0000 Status: O X-Status: X-Keywords: X-UID: 13896 Hi, I just noticed a small change in the context handling of translations since vdr-1.5.7. Till now it was possible to have e.g. const char AllowedChars[] = trNOOP("$ abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&"); Note the 2 '$'. The first one only helps to have the second one in the translation and not to be interpreted as context. Previous implementations of I18nTranslate did only cut the context of the english version. So the translation could look like this in i18n.c or the po-files: // The allowed characters in strings: { "$ abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&", " aäbcdefghijklmnoöpqrsßtuüvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&", " abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&", ... The current implementation cuts the translations too which results in "[]|()*+?{}/:%@&" Is this intended? If so, one could add the dummy '$' also at the beginning of the translation, but has to handle this again for backwards compatibility. If it's not intended the following patch should give the previous behaviour: BR, Christian --- vdr-1.5.8/i18n.c 2007-08-19 16:10:46.000000000 +0200 +++ vdr-1.5.8-patched/i18n.c 2007-08-23 12:47:48.000000000 +0200 @@ -208,10 +208,10 @@ t = dgettext(Plugin, s); if (t == s) t = gettext(s); - s = t; + return t; } - const char *p = strchr(s, '$'); - return p ? p + 1 : s; + else + return SkipContext(s); } const char *I18nLocale(int Language)