aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/friendica_smarty.php21
-rwxr-xr-xinclude/plugin.php27
2 files changed, 25 insertions, 23 deletions
diff --git a/include/friendica_smarty.php b/include/friendica_smarty.php
index d242a6a42..e34fac003 100755
--- a/include/friendica_smarty.php
+++ b/include/friendica_smarty.php
@@ -86,4 +86,25 @@ class FriendicaSmartyEngine implements ITemplateEngine {
}
return "";
}
+
+ public function get_intltext_template($file, $root='') {
+ $a = get_app();
+
+ if(file_exists("view/{$a->language}/$s"))
+ $template_file = "view/{$a->language}/$s";
+ elseif(file_exists("view/en/$s"))
+ $template_file = "view/en/$s";
+ else
+ $template_file = theme_include($file,$root);
+ if($template_file) {
+ $template = new FriendicaSmarty();
+ $template->filename = $template_file;
+
+ return $template;
+ }
+ return "";
+ }
+
+
+
}
diff --git a/include/plugin.php b/include/plugin.php
index 8406c45e5..b65ca6e98 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -540,30 +540,11 @@ function theme_include($file, $root = '') {
function get_intltext_template($s) {
- global $a;
-
- if(! isset($a->language))
- $a->language = 'en';
-
- $engine = '';
- if($a->get_template_engine() === 'smarty3')
- $engine = "/smarty3";
-
- $file = '';
- if(file_exists("view/{$a->language}$engine/$s"))
- $file = "view/{$a->language}$engine/$s";
- elseif(file_exists("view/en$engine/$s"))
- $file = "view/en$engine/$s";
- else
- $file = "view/tpl/$engine/$s";
- if($engine === '/smarty3') {
- $template = new FriendicaSmarty();
- $template->filename = $file;
+ $a = get_app();
+ $t = $a->template_engine();
- return $template;
- }
- else
- return file_get_contents($file);
+ $template = $t->get_intltext_template($s, $root);
+ return $template;
}