From a056f044df6abf32ce5fb663cf5ad302acbe46b8 Mon Sep 17 00:00:00 2001 From: Stone Date: Sat, 3 Jan 2009 21:50:31 +0200 Subject: Make compatible with VDR >= 1.5.7. --- i18n.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'i18n.c') diff --git a/i18n.c b/i18n.c index c8a0fdc..4079f2a 100644 --- a/i18n.c +++ b/i18n.c @@ -166,7 +166,11 @@ cText2SkinI18n::cText2SkinI18n(const char *Skin): cText2SkinFile(Skin) { cText2SkinI18n::~cText2SkinI18n() { for (int i = 0; mPhrases[i][0]; ++i) { +#if VDRVERSNUM >= 10507 + for (int j = 0; j < I18nLanguages()->Size(); ++j) +#else for (int j = 0; j < I18nNumLanguages; ++j) +#endif free((void*)mPhrases[i][j]); } free(mPhrases); @@ -182,7 +186,11 @@ bool cText2SkinI18n::Parse(const char *Text) { memset(&p, 0, sizeof(tI18nPhrase)); Text += 17; +#if VDRVERSNUM >= 10507 + for (i = 0; i < I18nLanguages()->Size(); ++i) { +#else for (i = 0; i < I18nNumLanguages; ++i) { +#endif char *langs = strdup(I18nLanguageCode(i)); char *ptr = langs, *ep; std::string text; @@ -200,7 +208,11 @@ bool cText2SkinI18n::Parse(const char *Text) { } int idx = mNumPhrases++; +#if VDRVERSNUM >= 10507 + for (i = 0; i < I18nLanguages()->Size(); ++i) +#else for (i = 0; i < I18nNumLanguages; ++i) +#endif if (!p[i]) p[i] = ""; mPhrases = (tI18nPhrase*)realloc(mPhrases, (mNumPhrases + 1) * sizeof(tI18nPhrase)); memcpy(mPhrases[idx], p, sizeof(tI18nPhrase)); @@ -214,7 +226,9 @@ bool cText2SkinI18n::Parse(const char *Text) { bool cText2SkinI18n::Load(const std::string &Filename) { if (cText2SkinFile::Load(Filename)) { +#if VDRVERSNUM <= 10506 I18nRegister(mPhrases, mIdentity.c_str()); +#endif return true; } return false; -- cgit v1.2.3