diff options
-rw-r--r-- | font.c | 5 | ||||
-rw-r--r-- | i18n.c | 14 | ||||
-rw-r--r-- | status.c | 5 | ||||
-rw-r--r-- | text2skin.c | 4 |
4 files changed, 28 insertions, 0 deletions
@@ -31,8 +31,13 @@ const cFont *cText2SkinFont::Load(const std::string &Path, const std::string &Fi const cFont *res = NULL; #ifdef HAVE_FREETYPE char *cachename; +#if VDRVERSNUM >= 10507 + asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, I18nCurrentLanguage()); + if (mFontCache.Load(Path + "/" + Filename, cachename, Size, I18nCurrentLanguage(), Width)) +#else asprintf(&cachename, "%s_%d_%d_%d", Filename.c_str(), Size, Width, Setup.OSDLanguage); if (mFontCache.Load(Path + "/" + Filename, cachename, Size, Setup.OSDLanguage, Width)) +#endif res = mFontCache.GetFont(cachename); else esyslog("ERROR: Text2Skin: Couldn't load font %s:%d", Filename.c_str(), Size); @@ -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; @@ -109,8 +109,13 @@ void cText2SkinStatus::Recording(const cDevice *Device, const char *Name, void cText2SkinStatus::OsdClear(void) { +#if VDRVERSNUM >= 10507 + if (I18nCurrentLanguage() != mLastLanguage) { + mLastLanguage = I18nCurrentLanguage(); +#else if (Setup.OSDLanguage != mLastLanguage) { mLastLanguage = Setup.OSDLanguage; +#endif cxString::Reparse(); } } diff --git a/text2skin.c b/text2skin.c index be63af4..1fd407e 100644 --- a/text2skin.c +++ b/text2skin.c @@ -25,7 +25,11 @@ cText2SkinPlugin::~cText2SkinPlugin() { bool cText2SkinPlugin::Start(void) { RegisterI18n(Phrases); +#if VDRVERSNUM >= 10507 + Text2SkinStatus.SetLanguage(I18nCurrentLanguage()); +#else Text2SkinStatus.SetLanguage(Setup.OSDLanguage); +#endif cText2SkinLoader::Start(); return true; } |