Finished templates localization

This commit is contained in:
Simon DELAGE 2014-09-09 20:59:31 +02:00
parent aa260f2242
commit 1d8e1189ec
8 changed files with 17 additions and 23 deletions

View file

@ -23,7 +23,7 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
function init(&$event, $param) { function init(&$event, $param) {
global $conf; global $conf;
global $INFO; global $INFO;
global $uhpreplace; // global $uhpreplace;
// // CREATE AND LOAD LOCAL REPLACEMENT FILE IF IT DOESN'T EXIST YET // // CREATE AND LOAD LOCAL REPLACEMENT FILE IF IT DOESN'T EXIST YET
// if (!file_exists(DOKU_INC.'conf/userhomepage_replace.php')) { // if (!file_exists(DOKU_INC.'conf/userhomepage_replace.php')) {
// $content = io_readFile(DOKU_INC.'lib/plugins/userhomepage/userhomepage_replace.default', false); // $content = io_readFile(DOKU_INC.'lib/plugins/userhomepage/userhomepage_replace.default', false);
@ -38,7 +38,7 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
if (file_exists(DOKU_INC.$this->getConf('templatepath'))) { if (file_exists(DOKU_INC.$this->getConf('templatepath'))) {
$source_private = DOKU_INC.$this->getConf('templatepath'); $source_private = DOKU_INC.$this->getConf('templatepath');
} else { } else {
$source_private = DOKU_INC.'lib/plugins/userhomepage/userhomepage_private.default'; $source_private = DOKU_INC.'lib/plugins/userhomepage/lang/'.'/lang/'.$conf['lang'].'userhomepage_private.default';
} }
if (!copy($source_private, DOKU_INC.$this->getConf('templates_path').'/userhomepage_private.txt')) { if (!copy($source_private, DOKU_INC.$this->getConf('templates_path').'/userhomepage_private.txt')) {
// echo ' An error occured while attempting to copy userhomepage_private.default to '.DOKU_INC.$this->getConf('templates_path').'/userhomepage_private.txt'; // echo ' An error occured while attempting to copy userhomepage_private.default to '.DOKU_INC.$this->getConf('templates_path').'/userhomepage_private.txt';
@ -48,7 +48,7 @@ class action_plugin_userhomepage extends DokuWiki_Action_Plugin{
} }
// CREATE PUBLIC PAGE TEMPLATES IF NEEDED // CREATE PUBLIC PAGE TEMPLATES IF NEEDED
if (($this->getConf('create_public_page')) && (!file_exists(DOKU_INC.$this->getConf('templates_path').'/userhomepage_public.txt'))) { if (($this->getConf('create_public_page')) && (!file_exists(DOKU_INC.$this->getConf('templates_path').'/userhomepage_public.txt'))) {
if (!copy(DOKU_INC.'lib/plugins/userhomepage/userhomepage_public.default', DOKU_INC.$this->getConf('templates_path').'/userhomepage_public.txt')) { if (!copy(DOKU_INC.'lib/plugins/userhomepage/lang/'.$conf['lang'].'userhomepage_public.default', DOKU_INC.$this->getConf('templates_path').'/userhomepage_public.txt')) {
// echo ' An error occured while attempting to copy userhomepage_public.default to '.DOKU_INC.$this->getConf('templates_path').'/userhomepage_public.txt'; // echo ' An error occured while attempting to copy userhomepage_public.default to '.DOKU_INC.$this->getConf('templates_path').'/userhomepage_public.txt';
// } else { // } else {
// echo ' Successfully copied public template.'; // echo ' Successfully copied public template.';

View file

@ -1,9 +1,9 @@
====== @NAME@ (@USER@) - Espace Privé ====== ====== @NAME@ (@USER@) - Espace Privé ======
Cet espace de nom (@TARGETPRIVATENS@) et son contenu (pages, images, ...) vous est réservé et **vous seul y avez accès** (ainsi que l'administrateur)... This namespace (@TARGETPRIVATENS@) and it's content (pages, images, ...) is **reserved for your own usage**...
* Pour créer une page au sein de cet espace réservé (et donc protégée), utiliser la syntaxe de lien __sans aucun espace de nom__ : * To create a page inside this private space, simply use the standard link syntax __without any namespace__ :
<code>[[page exemple 1]] <code>[[exemple page 1]]
[[exemple2|Ma page exemple2]]</code> [[exemple2|My example page2]]</code>
* Pour créer un sous espace de nom, le créer sous l'espace __@TARGETPRIVATENS@__ : * To create a sub-namespace, simply indicate it's full position :
<code>[[@TARGETPRIVATENS@:<sous_espace>:exemple3]]</code> <code>[[@TARGETPRIVATENS@:<sub-namespace_to_create>:exemple3]]</code>
Vous pouvez évidement supprimer ce paragraphe... Feel free to delete this paragraph...
A vos claviers! :-D Now write something! :-D

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* English language file for Namespaced template * French language file for Namespaced template
* @author Simon DELAGE <simon.geekitude@gmail.com> * @author Simon DELAGE <simon.geekitude@gmail.com>
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
*/ */

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* English settings file for Userhomepage plugin * French settings file for Userhomepage plugin
* Previous authors: James GuanFeng Lin, Mikhail I. Izmestev, Daniel Stonier * Previous authors: James GuanFeng Lin, Mikhail I. Izmestev, Daniel Stonier
* @author: Simon Delage <simon.geekitude@gmail.com> * @author: Simon Delage <simon.geekitude@gmail.com>
* @license: CC Attribution-Share Alike 3.0 Unported <http://creativecommons.org/licenses/by-sa/3.0/> * @license: CC Attribution-Share Alike 3.0 Unported <http://creativecommons.org/licenses/by-sa/3.0/>

View file

@ -1,9 +1,9 @@
====== @NAME@ (@USER@) - Espace Privé ====== ====== @NAME@ (@USER@) - Espace Privé ======
Cet espace de nom (@TARGETPRIVATENS@) et son contenu (pages, images, ...) vous est réservé et **vous seul y avez accès** (ainsi que l'administrateur)... Cet espace de nom (@TARGETPRIVATENS@) et son contenu (pages, images, ...) **vous est réservé**...
* Pour créer une page au sein de cet espace réservé (et donc protégée), utiliser la syntaxe de lien __sans aucun espace de nom__ : * Pour créer une page au sein de cet espace réservé, utilisez simplement la syntaxe de lien __sans aucun espace de nom__ :
<code>[[page exemple 1]] <code>[[page exemple 1]]
[[exemple2|Ma page exemple2]]</code> [[exemple2|Ma page exemple2]]</code>
* Pour créer un sous espace de nom, le créer sous l'espace __@TARGETPRIVATENS@__ : * Pour créer un sous-espace de nom, il suffit d'indiquer son emplacement complet :
<code>[[@TARGETPRIVATENS@:<sous_espace>:exemple3]]</code> <code>[[@TARGETPRIVATENS@:<sous-espace_à_créer>:exemple3]]</code>
Vous pouvez évidement supprimer ce paragraphe... Vous pouvez évidement supprimer ce paragraphe...
A vos claviers! :-D A vos claviers! :-D

View file

@ -1 +0,0 @@
====== @NAME@ (@USER@) - @PRIVATENAMESPACE@ ======

View file

@ -1 +0,0 @@
====== @NAME@ (@USER@) - @PUBLICPAGE@ ======

View file

@ -1,4 +0,0 @@
<?php
$uhpreplace['@PRIVATENAMESPACE@'] = 'privatenamespace';
$uhpreplace['@PUBLICPAGE@'] = 'publicpage';