Skip to content
Snippets Groups Projects
Commit 9e027a0a authored by Szymon Olewniczak's avatar Szymon Olewniczak Committed by Andreas Gohr
Browse files

change DokuWiki_Plugin:localFN signature

parent ac596a06
No related branches found
No related tags found
No related merge requests found
...@@ -106,17 +106,18 @@ class DokuWiki_Plugin { ...@@ -106,17 +106,18 @@ class DokuWiki_Plugin {
* plugin equivalent of localFN() * plugin equivalent of localFN()
* *
* @param string $id id of localization file * @param string $id id of localization file
* @param string $ext The file extension (usually txt)
* @return string wiki text * @return string wiki text
*/ */
public function localFN($id) { public function localFN($id,$ext='txt') {
global $conf; global $conf;
$plugin = $this->getPluginName(); $plugin = $this->getPluginName();
$file = DOKU_CONF.'plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.txt'; $file = DOKU_CONF.'plugin_lang/'.$plugin.'/'.$conf['lang'].'/'.$id.'.'.$ext;
if (!file_exists($file)){ if (!file_exists($file)){
$file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.txt'; $file = DOKU_PLUGIN.$plugin.'/lang/'.$conf['lang'].'/'.$id.'.'.$ext;
if(!file_exists($file)){ if(!file_exists($file)){
//fall back to english //fall back to english
$file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.txt'; $file = DOKU_PLUGIN.$plugin.'/lang/en/'.$id.'.'.$ext;
} }
} }
return $file; return $file;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment