Commit 45d5e47b authored by  JosephK's avatar JosephK

Plugin i18n + localisation des plugins tags_advanced et recovery

parent 0404f0e4
......@@ -127,11 +127,12 @@ function create_account($account, $password, $email) {
$GLOBALS['title'] = 'MyFrama';
$GLOBALS['config']['ENABLE_UPDATECHECK'] = false;
$GLOBALS['config']['ENABLED_PLUGINS'] = array(
0 => 'qrcode',
1 => 'addlink_toolbar',
2 => 'markdown',
3 => 'recovery',
4 => 'tags_advanced'
0 => 'i18n',
1 => 'qrcode',
2 => 'addlink_toolbar',
3 => 'markdown',
4 => 'recovery',
5 => 'tags_advanced'
);
writeConfig($GLOBALS, true, $account_path . '/data/config.php');
......
description="Internationalisation plugin"
<?php
$langs = [
'fr' => 'Français',
'en' => 'English',
//'es' => 'Español',
];
//session_set_cookie_params(365*24*60*60);
//session_start();
$paramLang = '';
// Default language fr
if ( !isset($_SESSION['lang'])
|| !in_array($_SESSION['lang'], array_keys($langs)) ) {
$_SESSION['lang'] = 'fr';
}
// Manual set by URL
if (isset($_GET['l'])
&& is_string($_GET['l'])
&& in_array($_GET['l'], array_keys($langs)) ) {
$_SESSION['lang'] = $_GET['l'];
$paramLang = '?l='.$_GET['l'];
// Manual set by form
} elseif ( isset($_POST['lang']) && is_string($_POST['lang'])
&& in_array($_POST['lang'], array_keys($langs)) ) {
$_SESSION['lang'] = $_POST['lang'];
// Check available languages
} else {
$browserLangs = array();
if (isset($_SERVER) && array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
preg_match_all("/([[:alpha:]]{1,8}(?:-[[:alpha:]|-]{1,8})?)" .
"(?:\\s*;\\s*q\\s*=\\s*(?:1\\.0{0,3}|0\\.\\d{0,3}))?\\s*(?:,|$)/i",
$_SERVER['HTTP_ACCEPT_LANGUAGE'], $hits);
foreach ($hits[1] as $hit) {
$browserLangs[] = strtolower(substr($hit,0,2));
}
}
if(in_array('fr', $browserLangs)) {
// french is better
$_SESSION['lang'] = 'fr';
} else {
// 1st default language
foreach($browserLangs as $lang) {
if(in_array($lang, array_keys($langs))) {
$_SESSION['lang'] = $lang;
break;
}
}
}
}
// Function t() is called in the template like this : {'String to translate'|t}
function t($txt){
// Import $t variable from locale/lg.php files in each plugin
// The 'i18n' plugin is one of them and contains the main file
foreach($GLOBALS['config']['ENABLED_PLUGINS'] as $plugin) {
if (is_file( PluginManager::$PLUGINS_PATH . '/' . $plugin . '/locale/'.$_SESSION['lang'].'.php') ) {
require( PluginManager::$PLUGINS_PATH . '/' . $plugin . '/locale/'.$_SESSION['lang'].'.php');
}
}
$txt = (isset($t[$txt]) && !empty($t[$txt])) ? $t[$txt] : $txt;
return $txt;
}
/*
// TODO: Add a select form to switch between available langs
function hook_i18n_render_header($data)
{
return $data;
}
function hook_i18n_render_footer($data)
{
return $data;
}
*/
\ No newline at end of file
<?php
// includes.html
$t['lg'] = 'en';
$t['RSS feed'] = 'RSS feed';
$t['ATOM feed'] = 'ATOM feed';
$t['MyFrama search'] = 'MyFrama search';
// 404.html
$t['404 Not found <small>Oh crap!</small>'] = '404 Not found <small>Oh crap!</small>';
$t['Would you mind '] = 'Would you mind ';
$t['clicking here?'] = 'clicking here?';
// addlink.html
$t['Add link'] = 'Add link';
// changepassword.html
$t['Change password'] = 'Change password';
$t['Old password:'] = 'Old password:';
$t['New password:'] = 'New password:';
$t['Save password'] = 'Save password';
// changetag.html
$t['Rename/delete tags'] = 'Rename/delete tags';
$t['Old tag:'] = 'Old tag:';
$t['New tag:'] = 'New tag:';
$t['(Case sensitive)'] = '(Case sensitive)';
$t['Rename tag'] = 'Rename tag';
$t['Delete tag'] = 'Delete tag';
$t['Are you sure you want to delete this tag from all links?'] = 'Are you sure you want to delete this tag from all links?';
// configure.html
$t['Configuration'] = 'Configuration';
$t['Page title:'] = 'Page title:';
$t['Title link:'] = 'Title link:';
$t['default value is: ?'] = 'default value is: ?';
$t['Timezone'] = 'Timezone';
$t['Privacy'] = 'Privacy';
$t['Redirector'] = 'Redirector';
$t['e\.g\. <i>http://anonym\.to/?</i> will mask the HTTP_REFERER'] = 'e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER';
$t['All new links are private by default'] = 'All new links are private by default';
$t['Do not show any links if the user is not logged in.'] = 'Do not show any links if the user is not logged in.';
$t['Options'] = 'Options';
$t['Disable session cookie hijacking protection'] = 'Disable session cookie hijacking protection';
$t['Check this if you get disconnected often or if your IP address changes often.'] = 'Check this if you get disconnected often or if your IP address changes often.';
$t['RSS direct links'] = 'RSS direct links';
$t['Disable it to use permalinks in RSS feed instead of direct links to your shaared links. Currently '] = 'Disable it to use permalinks in RSS feed instead of direct links to your shaared links. Currently ';
$t['enabled'] = 'enabled';
$t['disabled'] = 'disabled';
$t['Notify me when a new release is ready'] = 'Notify me when a new release is ready';
$t['Save config'] = 'Save config';
// daily.html
$t['Daily RSS feed'] = 'Daily RSS feed';
$t['Daily RSS'] = 'Daily RSS';
$t['Previous day'] = 'Previous day';
$t['Next day'] = 'Next day';
$t['Permalink'] = 'Permalink';
$t['Short link here'] = 'Short link here';
$t['No articles on this day.'] = 'No articles on this day.';
// dailyrss.html
// nothing (maybe '%A %e %B %Y' to change later)
// editlink.html
$t['URL'] = '<abbr>URL</abbr>';
$t['Title'] = 'Title';
$t['Description'] = 'Description';
$t['Tags'] = 'Tags';
$t['Private'] = 'Private';
$t['Save'] = 'Save';
$t['Cancel'] = 'Cancel';
$t['Delete'] = 'Delete';
// export.bookmarks.html
// nothing to do (not really a template file)
// export.html
$t['Selection:'] = 'Selection:';
$t[' All'] = ' All';
$t[' Private'] = ' Private';
$t[' Public'] = ' Public';
$t['Prepend note permalinks with this Shaarli instance\'s URL'] = 'Prepend note permalinks with this Shaarli instance\'s URL';
$t['<em>(useful to import bookmarks in a web browser)</em>'] = '<i>(useful to import bookmarks in a web browser)</i>';
$t['Export'] = 'Export';
// feed.*.html
$t['Shaared link'] = 'Shaared link';
// import.html
$t['Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...)'] = 'Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/…)';
$t['(Max:'] = '(Max:';
$t['bytes).'] = 'bytes).';
$t['Import'] = 'Import';
$t['Import all links as private'] = 'Import all links as private';
$t['Overwrite existing links'] = 'Overwrite existing links';
// install.html
// nothing to do because i18n plugin only works if Shaarli is already installed
// linklist.html
$t['Search text'] = 'Search text';
$t['Nothing found'] = 'Nothing found';
$t['Sorry... We found nothing'] = 'Sorry... We found nothing';
$t[' for '] = ' for ';
$t[' tagged '] = ' tagged ';
$t['Don\'t show links with this tag'] = 'Don\'t show links with this tag';
$t['Link list'] = 'Link list';
$t['Edit'] = 'Edit';
$t['Delete'] = 'Delete';
$t['Permalink'] = 'Permalink';
$t['Short link here'] = 'Short link here';
$t['Show links with this tag'] = 'Show links with this tag';
$t['Short link'] = 'Short link';
$t['Tags'] = 'Tags';
$t['Filter by tag'] = 'Filter by tag';
$t['Search'] = 'Search';
$t['Tag cloud'] = 'Tag cloud';
// linklist.paging.html
$t['Older'] = 'Older';
$t['Newer'] = 'Newer';
$t['page'] = 'page';
// loginform.html
$t['You have been banned from login after too many failed attempts. Try later.'] = 'You have been banned from login after too many failed attempts. Try later.';
$t['Connection form'] = 'Connection form';
$t['Username'] = 'Username';
$t['username'] = 'Your name'; // placeholder
$t['Password'] = 'Password';
$t['password'] = '********'; // placeholder
$t['Stay signed in (Do not check on public computers)'] = 'Stay signed in (Do not check on public computers)';
$t['Login'] = 'Login';
// opensearch.html
$t['Shaarli search'] = 'Shaarli search';
$t['Shaarli Community'] = 'Shaarli Community';
// page.footer.html
$t['<strong><a href="https://github.com/shaarli/Shaarli">Shaarli</a></strong> - The personal, minimalist, super-fast, database free, bookmarking service<br>by the Shaarli community - <a href="doc/Home.html" rel="nofollow">Help/documentation</a>'] = '';
$t[' is'] = ' is';
$t['available'] = 'available';
$t['Error:'] = 'Error:';
$t['Are you sure you want to delete this link?'] = 'Are you sure you want to delete this link?';
// page.header.html
$t['Show/hide menu'] = 'Show/hide menu';
$t['Picture wall'] = 'Picture wall';
$t['Daily'] = 'Daily';
$t['Search'] = 'Search';
$t['Change links per page'] = 'Change links per page';
$t['Links per page:'] = 'Links per page:';
$t[' links'] = ' links';
$t['Custom value...'] = 'Custom value...';
//$t['RSS Feed'] = '';
//$t['ATOM Feed'] = '';
//$t['Add link'] = 'Ajouter un lien';
$t['Tools'] = 'Tools';
$t['Logout'] = 'Logout';
$t['Close'] = 'Close';
$t['Search something here...'] = 'Search something here...';
$t['Filter by tag'] = 'Filter by tag';
// page.html
// nothing to do (not really a template file)
// picwall.html
// nothing to translate here
// pluginsadmin.html
$t['You need to enable Javascript to change plugin loading order.'] = 'You need to enable Javascript to change plugin loading order.';
$t['Enabled Plugins'] = 'Enabled Plugins';
$t['No plugin enabled.'] = 'No plugin enabled.';
$t['Disable'] = 'Disable';
$t['Order'] = 'Order';
$t['Name'] = 'Name';
$t['Description'] = 'Description';
$t['Parameters'] = 'Parameters';
$t['Save'] = 'Save';
$t['Disabled Plugins'] = 'Disabled Plugins';
$t['No plugin disabled.'] = 'No plugin disabled.';
$t['Enable'] = 'Enable';
// tagcloud.html
// nothing to translate here
// tools.html
$t['Settings'] = 'Settings';
$t['Global settings'] = 'Global settings';
$t['Configure your Shaarli'] = 'Configure your Shaarli';
$t['Change Title, timezone...'] = 'Change Title, timezone...';
$t['Plugins administration'] = 'Plugins administration';
$t['Enable, disable and configure plugins.'] = 'Enable, disable and configure plugins.';
$t['Change password'] = 'Change password';
$t['Change your password.'] = 'Change your password.';
$t['Rename/delete tags'] = 'Rename/delete tags';
$t['Rename or delete a tag in all links'] = 'Rename or delete a tag in all links';
$t['Import'] = 'Import';
$t['Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)'] = 'Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)';
$t['Export'] = 'Export';
$t['Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)'] = 'Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)';
$t['Sharing buttons'] = 'Sharing buttons';
$t['Shaare link'] = 'Shaare link';
$t['Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).'] = 'Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).';
$t['Then click "✚Shaare link" button in any page you want to share.'] = 'Then click "✚Shaare link" button in any page you want to share.';
$t['Add Note'] = 'Add Note';
$t['Then click "✚Add Note" button anytime to start composing a private Note (text post) to your Shaarli.'] = 'Then click "✚Add Note" button anytime to start composing a private Note (text post) to your Shaarli.';
$t['Add to<br>Firefox social'] = 'Add to<br>Firefox social';
$t['Click on this button to add Shaarli to the "Share this page" button in Firefox.'] = 'Click on this button to add Shaarli to the "Share this page" button in Firefox.';
$t['Plugins settings'] = 'Plugins settings';
$t['The personal, minimalist, super-fast, no-database delicious clone.'] = 'The personal, minimalist, super-fast, no-database delicious clone.';
$t['Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...'] = 'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...';
?>
\ No newline at end of file
<?php
// includes.html
$t['lg'] = 'fr';
$t['RSS feed'] = 'Flux RSS';
$t['ATOM feed'] = 'Flux ATOM';
$t['MyFrama search'] = 'Recherche MyFrama';
// 404.html
$t['404 Not found <small>Oh crap!</small>'] = '404 Lien introuvable <small>Oh zut !</small>';
$t['Would you mind '] = 'Voudriez-vous ';
$t['clicking here?'] = 'cliquer ici ?';
// addlink.html
$t['Add link'] = 'Ajouter un lien';
// changepassword.html
$t['Change password'] = 'Changer de mot de passe';
$t['Old password:'] = 'Ancien mot de passe';
$t['New password:'] = 'Nouveau mot de passe';
$t['Save password'] = 'Enregistrer le mot de passe';
// changetag.html
$t['Rename/delete tags'] = 'Renommer/supprimer un tag';
$t['Old tag:'] = 'Ancien tag';
$t['New tag:'] = 'Nouveau tag';
$t['(Case sensitive)'] = '(Sensible à la casse)';
$t['Rename tag'] = 'Renommer le tag';
$t['Delete tag'] = 'Supprimer le tag';
$t['Are you sure you want to delete this tag from all links?'] = 'Êtes-vous sûr de vouloir supprimer ce tag sur tous vos liens ?';
// configure.html
$t['Configuration'] = 'Configuration';
$t['Page title:'] = 'Titre du site';
$t['Title link:'] = 'Lien du titre';
$t['default value is: ?'] = 'la valeur par défaut est : ?';
$t['Timezone'] = 'Zone géographique';
$t['Privacy'] = 'Vie privée';
$t['Redirector'] = 'Redirection';
$t['for example'] = 'par exemple';
$t['will mask the HTTP_REFERER'] = 'masquera votre HTTP_REFERER';
$t['All new links are private by default'] = 'Tous les nouveaux lien sont privés par défaut';
$t['Do not show any links if the user is not logged in.'] = 'Ne pas afficher de lien si l’utilisateur n’est pas conecté.';
$t['Options'] = 'Options';
$t['Disable session cookie hijacking protection'] = 'Désactiver le cookie de protection anti hijacking';
$t['Check this if you get disconnected often or if your IP address changes often.'] = 'Cochez en cas de problèmes de déconnexions à répétition ou si votre adresse IP change souvent.';
$t['RSS direct links'] = 'RSS avec liens directs';
$t['Disable it to use permalinks in RSS feed instead of direct links to your shaared links. Currently '] = 'Désactivez-le pour utiliser les liens sources dans le flux RSS au lieu des liens vers vos articles partagés. Actuellement ';
$t['enabled'] = 'activé';
$t['disabled'] = 'désactivé';
$t['Notify me when a new release is ready'] = 'M’informer s’il existe une nouvelle version de Shaarli';
$t['Save config'] = 'Enregistrer la configuration';
// daily.html
$t['Daily RSS feed'] = 'Flux RSS du journal';
$t['Daily RSS'] = 'RSS du journal';
$t['Previous day'] = 'jour précédent';
$t['Next day'] = 'jour suivant';
$t['Permalink'] = 'Permalien';
$t['Short link here'] = 'Lien raccourci ici';
$t['No articles on this day.'] = 'Pas d’article à cette date.';
// dailyrss.html
// nothing (maybe '%A %e %B %Y' to change later)
// editlink.html
$t['URL'] = '<abbr>URL</abbr>';
$t['Title'] = 'Titre';
$t['Description'] = 'Description';
$t['Tags'] = 'Tags';
$t['Private'] = 'Privé';
$t['Save'] = 'Enregistrer';
$t['Cancel'] = 'Annuler';
$t['Delete'] = 'Supprimer';
// export.bookmarks.html
// nothing to do (not really a template file)
// export.html
$t['Selection:'] = 'Sélectionner :';
$t[' All'] = ' Tout';
$t[' Private'] = ' Privés';
$t[' Public'] = ' Publics';
$t['Prepend note permalinks with this Shaarli instance\'s URL'] = '';
$t['<em>(useful to import bookmarks in a web browser)</em>'] = '<i>(utile pour importer des marque-pages dans son navigateur web)</i>';
$t['Export'] = 'Exporter';
// feed.*.html
$t['Shaared link'] = 'Liens partagés';
// import.html
$t['Import Netscape HTML bookmarks (as exported from Firefox/Chrome/Opera/Delicious/Diigo...)'] = 'Importer un fichier de marque-pages HTML (exportés depuis Firefox, Chrome, Opera…)';
$t['(Max:'] = '(Max:';
$t['bytes).'] = 'bytes).';
$t['Import'] = 'Importer';
$t['Import all links as private'] = 'Importer tous les liens comme privés';
$t['Overwrite existing links'] = 'Écraser les liens existants';
// install.html
// nothing to do because i18n plugin only works if Shaarli is already installed
// linklist.html
$t['Search text'] = 'Texte recherché';
$t['Nothing found'] = 'Rien trouvé';
$t['Sorry... We found nothing'] = 'Désolé… Nous n’avons rien trouvé';
$t[' for '] = ' pour ';
$t[' tagged '] = ' taggé ';
$t['Don\'t show links with this tag'] = 'Ne pas afficher les liens contenant ce tag';
$t['Link list'] = 'Liste des liens';
$t['Edit'] = 'Modifier';
$t['Delete'] = 'Supprimer';
$t['Permalink'] = 'Permalien';
$t['Short link here'] = 'Lien raccourci ici';
$t['Show links with this tag'] = 'Afficher les liens contenant ce tag';
$t['Short link'] = 'Lien raccourci';
$t['Tags'] = 'Tags';
$t['Filter by tag'] = 'Filtrer par tag';
$t['Search'] = 'Rechercher';
$t['Tag cloud'] = 'Nuage de tags';
// linklist.paging.html
$t['Older'] = 'Plus anciens';
$t['Newer'] = 'Plus récents';
$t['page'] = 'page';
// loginform.html
$t['You have been banned from login after too many failed attempts. Try later.'] = '';
$t['Connection form'] = '';
$t['Username'] = 'Utilisateur';
$t['username'] = 'Votre nom'; // placeholder
$t['Password'] = 'Mot de passe';
$t['password'] = '********'; // placeholder
$t['Stay signed in (Do not check on public computers)'] = 'Rester connecté (Ne pas cocher sur un ordinateur public)';
$t['Login'] = 'Connexion';
// opensearch.html
$t['Shaarli search'] = 'Recherche Shaarli';
$t['Shaarli Community'] = 'Communauté Shaarli';
// page.footer.html
$t['<strong><a href="https://github.com/shaarli/Shaarli">Shaarli</a></strong> - The personal, minimalist, super-fast, database free, bookmarking service<br>by the Shaarli community - <a href="doc/Home.html" rel="nofollow">Help/documentation</a>'] = '';
$t[' is'] = ' est';
$t['available'] = 'disponible';
$t['Error:'] = 'Erreur :';
$t['Are you sure you want to delete this link?'] = 'Êtes-vous sûr de vouloir supprimer ce lien ?';
// page.header.html
$t['Show/hide menu'] = 'Afficher/masquer le menu';
$t['Picture wall'] = 'Mur d’images';
$t['Daily'] = 'Journal';
$t['Search'] = 'Rechercher';
$t['Change links per page'] = 'Changer le nombre de liens par page';
$t['Links per page:'] = 'Liens par page :';
$t[' links'] = ' liens';
$t['Custom value...'] = 'Au choix…';
//$t['RSS Feed'] = '';
//$t['ATOM Feed'] = '';
//$t['Add link'] = 'Ajouter un lien';
$t['Tools'] = 'Outils';
$t['Logout'] = 'Déconnexion';
$t['Close'] = 'Fermer';
$t['Search something here...'] = 'Effectuez une recherche ici…';
$t['Filter by tag'] = 'Filtrer par tag';
// page.html
// nothing to do (not really a template file)
// picwall.html
// nothing to translate here
// pluginsadmin.html
$t['You need to enable Javascript to change plugin loading order.'] = 'Vous devez activer le javascript pour changer l’ordre de chargement des plugins';
$t['Enabled Plugins'] = 'Pluggins activés';
$t['No plugin enabled.'] = 'Pas de plugin activé';
$t['Disable'] = 'Désactivé';
$t['Order'] = 'Ordre';
$t['Name'] = 'Nom';
$t['Description'] = 'Description';
$t['Parameters'] = 'Paramètres';
$t['Save'] = 'Enregistrer';
$t['Disabled Plugins'] = 'Plugins désactivés';
$t['No plugin disabled.'] = 'Pas de plugin désactivé';
$t['Enable'] = 'Activé';
// tagcloud.html
// nothing to translate here
// tools.html
$t['Settings'] = 'Paramètres';
$t['Global settings'] = 'Paramètres globaux';
$t['Configure your Shaarli'] = 'Configurer votre Shaarli';
$t['Change Title, timezone...'] = 'Changer le titre, la zone géographique…';
$t['Plugins administration'] = 'Gestion des plugins';
$t['Enable, disable and configure plugins.'] = 'Activer, désactiver et configurer les plugins.';
$t['Change password'] = 'Changement de mot de passe';
$t['Change your password.'] = 'Changez votre mot de passe';
$t['Rename/delete tags'] = 'Renommer/supprimer des tags';
$t['Rename or delete a tag in all links'] = 'Renomer ou supprimer des tags dans tous les liens';
$t['Import'] = 'Importer';
$t['Import Netscape html bookmarks (as exported from Firefox, Chrome, Opera, delicious...)'] = 'Importer un fichier de marque-pages HTML (exportés depuis Firefox, Chrome, Opera…)';
$t['Export'] = 'Exporter';
$t['Export Netscape html bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)'] = 'Exporter les liens vers une page HTML (qui peut ensuite être importée sur Firefox, Chrome, Opera…)';
$t['Sharing buttons'] = 'Boutons de partage';
$t['Shaare link'] = 'Partager le lien';
$t['Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link....).'] = 'Glissez ce lien dans vos marques-pages (ou effectuez un clic droit dessus et choisissez "Marque-page sur ce lien"…)';
$t['Then click "✚Shaare link" button in any page you want to share.'] = 'Cliquez ensuite sur le bouton "✚Partager le lien" depuis n’importe qu’elle page que vous souhaitez partager.';
$t['Add Note'] = 'Ajouter une note';
$t['Then click "✚Add Note" button anytime to start composing a private Note (text post) to your Shaarli.'] = 'Cliquez ensuite sur le bouton "✚Ajouter une note" chaque fois que vous rédiger une note privée à enregistrer dans votre Shaarli.';
$t['Add to<br>Firefox social'] = 'Ajouter à<br>Firefox social';
$t['Click on this button to add Shaarli to the "Share this page" button in Firefox.'] = 'Cliquez sur ce bouton pour ajouter Shaarli au menu "Partager cette page" dans Firefox';
$t['Plugins settings'] = 'Paramètres des plugins';
$t['The personal, minimalist, super-fast, no-database delicious clone.'] = '';
$t['Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...'] = 'Glissez ce lien dans vos marques-pages, ou effectuez un clic droit dessus et choisissez Marque-page sur ce lien…';
?>
\ No newline at end of file
<?php
$t['Change email'] = 'Changer le courriel';
$t['Change your recovery email'] = 'Changer votre courriel de restauration de compte';
$t['Close'] = 'Fermer';
$t['Email'] = 'Courriel';
$t['Save config'] = 'Enregistrer la configuration';
?>
\ No newline at end of file
<?php
// I18n
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS'])) {
function t($txt) { return $txt; }
}
function hook_recovery_render_footer($data)
{
if ($data['_LOGGEDIN_'] === false ) {
......@@ -12,6 +17,13 @@ function hook_recovery_render_tools($data)
{
$html = file_get_contents(PluginManager::$PLUGINS_PATH .'/recovery/tools.html');
// TODO: use preg_replace() instead
$html = str_replace("{'Change email'|t}", t('Change email'), $html);
$html = str_replace("{'Change your recovery email'|t}", t('Change your recovery email'), $html);
$html = str_replace("{'Close'|t}", t('Close'), $html);
$html = str_replace("{'Email'|t}", t('Courriel'), $html);
$html = str_replace("{'Save config'|t}", t('Save config'), $html);
if (isset ($GLOBALS['config']['email'])) {
$html = str_replace('value=""', 'value="' . htmlentities($GLOBALS['config']['email']) . '"', $html);
$html = str_replace('{$token}', getToken(), $html);
......
<a href="#recovery" data-toggle="modal" class="list-group-item">
<h2 class="h4 list-group-item-heading"><i class="fa fa-fw fa-2x fa-envelope-o pull-left"></i>Change email</h2>
<p class="list-group-item-text">Change your recovery email</p>
<h2 class="h4 list-group-item-heading"><i class="fa fa-fw fa-2x fa-envelope-o pull-left"></i>{'Change email'|t}</h2>
<p class="list-group-item-text">{'Change your recovery email'|t}</p>
</a>
<div class="modal fade" id="recovery" tabindex="-1" role="dialog" aria-labelledby="recoveryLabel" aria-hidden="true">
......@@ -9,19 +9,19 @@
<form method="POST" action="?do=configure" name="configform" id="configform">
<input type="hidden" name="token" value="{$token}">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">x</span><span class="sr-only">Fermer</span></button>
<h1>Change email</h1>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">x</span><span class="sr-only">{'Close'|t}</span></button>
<h1>{'Change email'|t}</h1>
</div>
<div class="modal-body">
<div class="form-group clearfix">
<label class="col-sm-3" for="email">Email</label>
<label class="col-sm-3" for="email">{'Email'|t}</label>
<div class="col-sm-9">
<input type="email" class="form-control" name="email" id="email" value="" />
</div>
</div>
</div>
<div class="modal-footer text-right">
<input type="submit" name="Save" value="Save config" class="btn btn-success">
<input type="submit" name="Save" value="{'Save config'|t}" class="btn btn-success">
</div>
</form>
</div>
......
<?php
$t['Tags advanced'] = 'Tags spéciaux';
$t['Close'] = 'Fermer';
$t['Order'] = 'Ordre';
$t['Name'] = 'Nom';
$t['Icon'] = 'Icône';
$t['Filter'] = 'Filtre';
$t['Pined?'] = 'Épinglé ?';
$t['Private?'] = 'Privé ?';
$t['Pined'] = 'Épinglé';
$t['Private'] = 'Privé';
$t['Add tag'] = 'Ajouter un tag';
$t['Save'] = 'Enregistrer';
$t['Move up'] = 'Monter';
$t['Move down'] = 'Descendre';
$t['Tag name'] = 'Nom du tag';
$t['Configure tags'] = 'Configurer les tags';
$t['Keep visible some important tags and define filters to automatically add tags to your links'] = 'Conserver vos tags importants à portée de clic et définir des filtres pour attribuer automatiquement des tags à vos liens';
?>
\ No newline at end of file
<
<?php
// I18n
if(!in_array('i18n',$GLOBALS['config']['ENABLED_PLUGINS'])) {
function t($txt) { return $txt; }
}
function tags_advanced_config($taData)
{
$html = file_get_contents(PluginManager::$PLUGINS_PATH .'/tags_advanced/tools.html');
$html = str_replace('{$token}', getToken() , $html);
// TODO: use preg_replace() instead
$html = str_replace("{'Tags advanced'|t}", t('Tags advanced'), $html);
$html = str_replace("{'Close'|t}", t('Close'), $html);
$html = str_replace("{'Order'|t}", t('Order'), $html);
$html = str_replace("{'Name'|t}", t('Name'), $html);
$html = str_replace("{'Icon'|t}", t('Icon'), $html);
$html = str_replace("{'Filter'|t}", t('Filter'), $html);
$html = str_replace("{'Pined?'|t}", t('Pined?'), $html);
$html = str_replace("{'Private?'|t}", t('Private?'), $html);
$html = str_replace("{'Add tag'|t}", t('Add tag'), $html);
$html = str_replace("{'Save'|t}", t('Save'), $html);
if(!isset($taData) || empty($taData)) {
$taData = array(
0 => array('', 'fa-map-pin', '', true, false)
......@@ -22,28 +38,28 @@ function tags_advanced_config($taData)
<tr id="ta_tag'.($k+1).'" data-order='.($k+1).'>
<td>
<div class="pull-left btn-group btn-group-xs" role="group">
<button type="button" class="btn moveup" onclick="return tagsSwitch(\'#ta_tag'.($k+1).'\',-1);">▲</button>
<button type="button" class="btn movedown" onclick="return tagsSwitch(\'#ta_tag'.($k+1).'\',1);">▼</button>
<button type="button" class="btn moveup" onclick="return tagsSwitch(\'#ta_tag'.($k+1).'\',-1);">▲<span class="sr-only"> '.t('Move up').'</span></button>
<button type="button" class="btn movedown" onclick="return tagsSwitch(\'#ta_tag'.($k+1).'\',1);">▼<span class="sr-only"> '.t('Move down').'</span></button>
</div>
</td>
<td>
<label for="ta-name'.($k+1).'" class="sr-only">Tag name</label>
<label for="ta-name'.($k+1).'" class="sr-only">'.t('Tag name').'</label>
<input type="text" class="form-control" name="ta-name'.($k+1).'" id="ta_name'.($k+1).'" value="'.htmlentities($v[0]).'" />
</td>
<td class="hidden">
<label for="ta-icon'.($k+1).'" class="sr-only">Icon</label>
<label for="ta-icon'.($k+1).'" class="sr-only">'.t('Icon').'</label>
<input type="text" class="form-control" name="ta-icon'.($k+1).'" id="ta_icon'.($k+1).'" value="'.htmlentities($v[1]).'" />
</td>
<td>
<label for="ta-filter'.($k+1).'" class="sr-only">Filter</label>
<label for="ta-filter'.($k+1).'" class="sr-only">'.t('Filter').'</label>
<input type="text" class="form-control" name="ta-filter'.($k+1).'" id="ta_filter'.($k+1).'" value="'.htmlentities($v[2]).'" />
</td>
<td>
<label for="ta-pined'.($k+1).'" class="sr-only">Pined</label>
<label for="ta-pined'.($k+1).'" class="sr-only">'.t('Pined').'</label>
<input type="checkbox" class="form-control" name="ta-pined'.($k+1).'" id="ta_pined'.($k+1).'" '.$pined.' />
</td>
<td>
<label for="ta-private'.($k+1).'" class="sr-only">Private</label>
<label for="ta-private'.($k+1).'" class="sr-only">'.t('Private').'</label>
<input type="checkbox" class="form-control" name="ta-private'.($k+1).'" id="ta_private'.($k+1).'" '.$private.' />
</td>
</tr>';
......@@ -81,7 +97,7 @@ function hook_tags_advanced_render_linklist($data)
}
if ($data['_LOGGEDIN_'] === true) {
$html = '<p class="pull-left"><a href="#tagsAdvanced" data-toggle="modal" class="btn btn-default btn-xs" ><i class="fa fa-fw fa-lg fa-cog"></i><span class="sr-only"> Configure tags</span></a></p>';
$html = '<p class="pull-left"><a href="#tagsAdvanced" data-toggle="modal" class="btn btn-default btn-xs" ><i class="fa fa-fw fa-lg fa-cog"></i><span class="sr-only"> '.t('Configure tags').'</span></a></p>';
$data['plugin_end_zone'][] .= $html . tags_advanced_config($taData);