vdr-1.5.3 - issue with translations out of plugins
Commit Message
On 06/13/07 12:50, Matthias Becker wrote:
> Hi everbody,
>
> I also tried both patches together and this did also not fix the
> problem with the
> translation of "Volume " out of lcdproc-Plugin.
Please try the attached patch (against plain VDR 1.5.3).
There was still a problem in cCharSetConv::Convert() in case
an empty string was given.
Klaus
Comments
Am Freitag, 15. Juni 2007 14:58 schrieb Klaus Schmidinger:
> Please try the attached patch (against plain VDR 1.5.3).
> There was still a problem in cCharSetConv::Convert() in case
> an empty string was given.
Yes! It work's.
THX
Oleg Roitburd
@@ -753,7 +753,7 @@
const char *cCharSetConv::Convert(const char *From, char *To, size_t ToLength)
{
- if (cd != (iconv_t)-1) {
+ if (cd != (iconv_t)-1 && From && *From) {
char *FromPtr = (char *)From;
size_t FromLength = strlen(From);
char *ToPtr = To;
@@ -6820,7 +6820,7 @@
*Converted = new tI18nPhrase[NumPhrases + 1];
memset(*Converted, 0, sizeof(tI18nPhrase) * (NumPhrases + 1));
}
- if (!(*Converted)[NrPhrase][NrLanguage]) {
+ if (!(*Converted)[NrPhrase][NrLanguage] && Original[NrPhrase][NrLanguage]) {
cCharSetConv csc(Phrases[1][NrLanguage], cCharSetConv::SystemCharacterTable());
(*Converted)[NrPhrase][NrLanguage] = strdup(csc.Convert(Original[NrPhrase][NrLanguage]));
}
@@ -6851,7 +6851,8 @@
return t;
}
}
- p = Phrases;
+ p = OriginalPhrases = Phrases;
+ ConvertedPhrases = &Converted;
}
esyslog("%s%sno translation found for '%s' in language %d (%s)", Plugin ? Plugin : "", Plugin ? ": " : "", s, Setup.OSDLanguage, Phrases[0][Setup.OSDLanguage]);
}