Commit a0869fb0 authored by Adrien Dorsaz's avatar Adrien Dorsaz

[themeswitcher] ajout du support i18n pour le français et l'anglais

parent ce0808b6
{
"P_THEMESWITCHER_SWITCH_THEME":"Switch theme",
"P_THEMESWITCHER_SAVE":"Save",
"P_THEMESWITCHER_NOWRITE_ERROR":"It seems you don't have permission to write the constant.php file. Please, run the command <code>chmod 664 constant.php</code>",
"P_THEMESWITCHER_CONNECTION_ERROR":"You have to be logged to do this action"
}
{
"P_THEMESWITCHER_SWITCH_THEME":"Changer de thème",
"P_THEMESWITCHER_SAVE":"Enregistrer",
"P_THEMESWITCHER_NOWRITE_ERROR":"Vous ne devez pas avoir les droits d'écriture sur le fichier constant.php. Effectuez un <code>chmod 664 constant.php</code>",
"P_THEMESWITCHER_CONNECTION_ERROR":"Vous devez être connecté pour cette action"
}
......@@ -9,7 +9,7 @@
*/
function themeswitcher_plugin_AddLink_and_Save(){
echo '<li><a class="toggle" href="#themeSwitcher">Changer de thème</a></li>';
echo '<li><a class="toggle" href="#themeSwitcher">'._t('P_THEMESWITCHER_SWITCH_THEME').'</a></li>';
if(isset($_POST['themeSelected'])){
themeswitcher_plugin_change();
}
......@@ -20,14 +20,14 @@ function themeswitcher_plugin_AddForm(){
echo '
<section class="themeSwitcher" id="themeSwitcher" name="themeSwitcher">
<form action="settings.php" method="post">
<h2>Changer de thème :</h2>
<h2>'._t('P_THEMESWITCHER_SWITCH_THEME').'</h2>
<select name="themeSelected" id="themeSelected">';
foreach($themes as $theme){
echo '<option value="'.$theme.'">'.$theme.'</option>';
}
echo '
</select>
<button class="buttonThemeSwitcher" type="submit">Enregistrer</button>
<button class="buttonThemeSwitcher" type="submit">'._t('P_THEMESWITCHER_SAVE').'</button>
</form>
</section>
';
......@@ -40,7 +40,7 @@ function themeswitcher_plugin_change(){
$result = preg_replace("/'DEFAULT_THEME',(.?)'(.*)'/", "'DEFAULT_THEME','".$_POST['themeSelected']."'", $file);
$put = file_put_contents($fileName, $result);
if(!$put){
echo "Vous ne devez pas avoir les droits d'écriture sur le fichier constant.php. Effectuez un <code>chmod 664 constant.php</code>";
echo _t('P_THEMESWITCHER_NOWRITE_ERROR');
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment