summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlap-in <klapinklapin@gmail.com>2013-08-02 13:38:31 +0200
committerKlap-in <klapinklapin@gmail.com>2013-08-02 13:38:31 +0200
commite8ec13b9a448dc4c0be4aa459d1586165aed6044 (patch)
tree8e1eb3b76c264a0fcaf6c72f7d5bdd848750edc0
parent4f93eef69523dad1ba27c5ac5465b037c598ff18 (diff)
downloadrpg-e8ec13b9a448dc4c0be4aa459d1586165aed6044.tar.gz
rpg-e8ec13b9a448dc4c0be4aa459d1586165aed6044.tar.bz2
localized texts for templates
-rw-r--r--inc/template.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/inc/template.php b/inc/template.php
index bb5f2cd53..33b886927 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -1193,6 +1193,39 @@ function tpl_getLang($id) {
}
/**
+ * locale_xhtml($id)
+ *
+ * retrieve a language dependent file and pass to xhtml renderer for display
+ * template equivalent of p_locale_xhtml()
+ *
+ * @param string $id id of language dependent wiki page
+ * @return string parsed contents of the wiki page in xhtml format
+ */
+function tpl_locale_xhtml($id) {
+ return p_cached_output(tpl_localFN($id));
+}
+
+/**
+ * localFN($id)
+ *
+ * prepends appropriate path for a language dependent filename
+ * template equivalent of localFN()
+ */
+function tpl_localFN($id) {
+ $path = tpl_incdir().'lang/';
+ global $conf;
+ $file = DOKU_CONF.'/template_lang/'.$conf['template'].'/'.$conf['lang'].'/'.$id.'.txt';
+ if (!@file_exists($file)){
+ $file = $path.$conf['lang'].'/'.$id.'.txt';
+ if(!@file_exists($file)){
+ //fall back to english
+ $file = $path.'en/'.$id.'.txt';
+ }
+ }
+ return $file;
+}
+
+/**
* prints the "main content" in the mediamanger popup
*
* Depending on the user's actions this may be a list of