summaryrefslogtreecommitdiff
path: root/libtemplate/templateview.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-01-14 11:28:38 +0100
committerlouis <louis.braun@gmx.de>2015-01-14 11:28:38 +0100
commit645f625d79f8181e043fffc5bcbf4ad2a86f036a (patch)
tree5abf27808e9b32a7ac16b3fb26f43fd3e5d52540 /libtemplate/templateview.c
parent8c6a83b72aab225ae1b446590ccb44ff475742cc (diff)
downloadvdr-plugin-skindesigner-645f625d79f8181e043fffc5bcbf4ad2a86f036a.tar.gz
vdr-plugin-skindesigner-645f625d79f8181e043fffc5bcbf4ad2a86f036a.tar.bz2
added further weather templates and translation
Diffstat (limited to 'libtemplate/templateview.c')
-rw-r--r--libtemplate/templateview.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c
index 8410b66..2db31d9 100644
--- a/libtemplate/templateview.c
+++ b/libtemplate/templateview.c
@@ -265,6 +265,21 @@ void cTemplateView::Translate(void) {
func->SetTranslatedText(translation);
}
}
+ if (func->GetType() == ftLoop) {
+ cTemplateLoopFunction *funcsLoop = dynamic_cast<cTemplateLoopFunction*>(func);
+ funcsLoop->InitIterator();
+ cTemplateFunction *loopFunc = NULL;
+ while(loopFunc = funcsLoop->GetNextFunction()) {
+ if (loopFunc->GetType() == ftDrawText || loopFunc->GetType() == ftDrawTextBox) {
+ string text = loopFunc->GetParameter(ptText);
+ string translation;
+ bool translated = globals->Translate(text, translation);
+ if (translated) {
+ loopFunc->SetTranslatedText(translation);
+ }
+ }
+ }
+ }
}
}
}
@@ -346,6 +361,32 @@ void cTemplateView::Translate(void) {
func->SetTranslatedText(translation);
}
}
+ if (func->GetType() == ftLoop) {
+ cTemplateLoopFunction *funcsLoop = dynamic_cast<cTemplateLoopFunction*>(func);
+ funcsLoop->InitIterator();
+ cTemplateFunction *loopFunc = NULL;
+ while(loopFunc = funcsLoop->GetNextFunction()) {
+ if (loopFunc->GetType() == ftDrawText || loopFunc->GetType() == ftDrawTextBox) {
+ string text = loopFunc->GetParameter(ptText);
+ string translation;
+ bool translated = globals->Translate(text, translation);
+ if (translated) {
+ loopFunc->SetTranslatedText(translation);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //Translate Plugin Views
+ for (map < string, map< int, cTemplateView*> >::iterator it = pluginViews.begin(); it != pluginViews.end(); it++) {
+ esyslog("skindesigner: translating plugin %s", (it->first).c_str());
+ map< int, cTemplateView*> plugViews = it->second;
+ for (map< int, cTemplateView*>::iterator it2 = plugViews.begin(); it2 != plugViews.end(); it2++) {
+ esyslog("skindesigner: translating view %d", (int)it2->first);
+ cTemplateView *pluginView = it2->second;
+ pluginView->Translate();
}
}