From 2a49460c7766d5868115689155e3b9595e5f36a2 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 13 Aug 2012 22:12:16 -0700 Subject: improvements in js localisation/translation --- include/plugin.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'include/plugin.php') diff --git a/include/plugin.php b/include/plugin.php index 2460e8ad6..9555268f7 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -485,3 +485,29 @@ function theme_include($file) { } return ''; } + + + +if(! function_exists('get_intltext_template')) { +function get_intltext_template($s) { + global $a; + + if(! isset($a->language)) + $a->language = 'en'; + + if(file_exists("view/{$a->language}/$s")) + return file_get_contents("view/{$a->language}/$s"); + elseif(file_exists("view/en/$s")) + return file_get_contents("view/en/$s"); + else + return file_get_contents("view/$s"); +}} + +if(! function_exists('get_markup_template')) { +function get_markup_template($s) { + + $x = theme_include($s); + if($x) + return file_get_contents($x); +}} + -- cgit v1.2.3