Because i'm french, i would have the great gallery zenphoto in french.
So i made some changes to the core application to enable multilang support, and to fix some bugs.
http://jtam.free.fr/gallerie/zenphoto-0.9-superdevy.zipIt would be nice to see a similar feature in next release triweb
Here, the list of my changes :
----------------------------------------------------------------------
New file : /zen/index.php (this folder may not be clearly visible)
<?php
header("Location:admin.php");
?>
----------------------------------------------------------------------
Implementation of multilanguage:
1. New param in config.php line 24:
$conf['lang'] = "fr";
2. New function in "functions.php" line 15-25:
// Load language file
if (isset($conf['lang'])) {
if ($conf['lang']!='en') {
include("lang/" . $conf['lang'] . ".php");
}
}
// For language translation
function lang($txt='') {
global $lang_text;
return isset($lang_text[$txt]) ? $lang_text[$txt] : $txt;
}
3. New folder named "lang" with the first language file "fr.php".
4. In "admin.php" and in each theme file, every visible text is remplaced :
`
english text`
become
`
<?=lang('english text')?>`
TODO: enable translation for template ajax functions.
----------------------------------------------------------------------
Bug fixed with mod_rewrite desactivate for admin.php:
1. New var line 12:
$adminpath = "http://" . $_SERVER['HTTP_HOST'] . WEBPATH . (zp_conf('mod_rewrite') ? "/admin/" : "/zen/admin.php");
2. Change
header("Location: http://" . $_SERVER['HTTP_HOST'] . WEBPATH . "/admin/?page=edit");
to
header("Location: " . $adminpath . "?page=edit");
TODO: $adminpath could be a constant.
Comments
Celles-ci sont bien générées dans /cache mais ne s'affichent pas !! Une idée ?