languages updates

This commit is contained in:
Diego Najar 2018-08-08 00:16:35 +02:00
parent 942f3c04cb
commit 551614e7cc
15 changed files with 63 additions and 38 deletions

View File

@ -1,8 +1,11 @@
<!-- Check if the user is logged --> <!-- Check if the user is logged -->
<script>
<!-- DEBUG: Each request increase the count of simple stats -->
<!-- <script>
setInterval( setInterval(
function() { function() {
var ajax = new bluditAjax(); var ajax = new bluditAjax();
ajax.userLogged(showAlert); ajax.userLogged(showAlert);
}, 15000); }, 15000);
</script> </script> -->

View File

@ -3,7 +3,7 @@
echo Bootstrap::pageTitle(array('title'=>$L->g('Categories'), 'icon'=>'tags')); echo Bootstrap::pageTitle(array('title'=>$L->g('Categories'), 'icon'=>'tags'));
echo Bootstrap::link(array( echo Bootstrap::link(array(
'title'=>'Add a new category', 'title'=>$L->g('Add a new category'),
'href'=>HTML_PATH_ADMIN_ROOT.'new-category', 'href'=>HTML_PATH_ADMIN_ROOT.'new-category',
'icon'=>'plus' 'icon'=>'plus'
)); ));
@ -12,8 +12,8 @@ echo '
<table class="table table-striped mt-3"> <table class="table table-striped mt-3">
<thead> <thead>
<tr> <tr>
<th class="border-bottom-0" scope="col">Name</th> <th class="border-bottom-0" scope="col">'.$L->g('Name').'</th>
<th class="border-bottom-0" scope="col">URL</th> <th class="border-bottom-0" scope="col">'.$L->g('URL').'</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -4,24 +4,24 @@
<!-- Quick Links --> <!-- Quick Links -->
<div class="container border-bottom pb-4"> <div class="container border-bottom pb-4">
<h4 class="pb-3">Quick links</h4> <h4 class="pb-3"><?php $L->p('Quick links') ?></h4>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<a class="quick-links text-center" style="color: #4586d4" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>"> <a class="quick-links text-center" style="color: #4586d4" href="<?php echo HTML_PATH_ADMIN_ROOT.'new-content' ?>">
<div class="oi oi-justify-left quick-links-icons"></div> <div class="oi oi-justify-left quick-links-icons"></div>
<div>New content</div> <div><?php $L->p('New content') ?></div>
</a> </a>
</div> </div>
<div class="col border-left border-right"> <div class="col border-left border-right">
<a class="quick-links text-center" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>"> <a class="quick-links text-center" href="<?php echo HTML_PATH_ADMIN_ROOT.'categories' ?>">
<div class="oi oi-tags quick-links-icons"></div> <div class="oi oi-tags quick-links-icons"></div>
<div>Categories</div> <div><?php $L->p('Categories') ?></div>
</a> </a>
</div> </div>
<div class="col"> <div class="col">
<a class="quick-links text-center" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>"> <a class="quick-links text-center" href="<?php echo HTML_PATH_ADMIN_ROOT.'users' ?>">
<div class="oi oi-people quick-links-icons"></div> <div class="oi oi-people quick-links-icons"></div>
<div>Users</div> <div><?php $L->p('Users') ?></div>
</a> </a>
</div> </div>
</div> </div>
@ -31,19 +31,19 @@
<div class="col"> <div class="col">
<a class="quick-links text-center" target="_blank" href="https://docs.bludit.com"> <a class="quick-links text-center" target="_blank" href="https://docs.bludit.com">
<div class="oi oi-compass quick-links-icons"></div> <div class="oi oi-compass quick-links-icons"></div>
<div>Documentation</div> <div><?php $L->p('Documentation') ?></div>
</a> </a>
</div> </div>
<div class="col border-left border-right"> <div class="col border-left border-right">
<a class="quick-links text-center" target="_blank" href="https://forum.bludit.org"> <a class="quick-links text-center" target="_blank" href="https://forum.bludit.org">
<div class="oi oi-loop-square quick-links-icons"></div> <div class="oi oi-loop-square quick-links-icons"></div>
<div>Forum support</div> <div><?php $L->p('Forum support') ?></div>
</a> </a>
</div> </div>
<div class="col"> <div class="col">
<a class="quick-links text-center" target="_blank" href="https://gitter.im/bludit/support"> <a class="quick-links text-center" target="_blank" href="https://gitter.im/bludit/support">
<div class="oi oi-chat quick-links-icons"></div> <div class="oi oi-chat quick-links-icons"></div>
<div>Chat support</div> <div><?php $L->p('Chat support') ?></div>
</a> </a>
</div> </div>
</div> </div>
@ -55,7 +55,7 @@
<!-- Notifications --> <!-- Notifications -->
<ul class="list-group list-group-striped b-0"> <ul class="list-group list-group-striped b-0">
<li class="list-group-item pt-0"><h4>Notifications</h4></li> <li class="list-group-item pt-0"><h4><?php $L->p('Notifications') ?></h4></li>
<?php <?php
$logs = array_slice($syslog->db, 0, NOTIFICATIONS_AMOUNT); $logs = array_slice($syslog->db, 0, NOTIFICATIONS_AMOUNT);
foreach ($logs as $log) { foreach ($logs as $log) {
@ -67,7 +67,7 @@
} }
echo '<br><span class="notification-date"><small>'; echo '<br><span class="notification-date"><small>';
echo Date::format($log['date'], DB_DATE_FORMAT, NOTIFICATIONS_DATE_FORMAT); echo Date::format($log['date'], DB_DATE_FORMAT, NOTIFICATIONS_DATE_FORMAT);
echo ' - by '.$log['username']; echo ' [ '.$log['username'] .' ]';
echo '</small></span>'; echo '</small></span>';
echo '</li>'; echo '</li>';
} }

View File

@ -11,7 +11,7 @@ echo Bootstrap::formOpen(array());
echo Bootstrap::formInputTextBlock(array( echo Bootstrap::formInputTextBlock(array(
'name'=>'category', 'name'=>'category',
'label'=>$L->g('Category name'), 'label'=>$L->g('Name'),
'value'=>isset($_POST['category'])?$_POST['category']:'', 'value'=>isset($_POST['category'])?$_POST['category']:'',
'class'=>'', 'class'=>'',
'placeholder'=>'', 'placeholder'=>'',
@ -20,8 +20,8 @@ echo Bootstrap::formOpen(array());
echo ' echo '
<div class="form-group mt-4"> <div class="form-group mt-4">
<button type="submit" class="btn btn-primary mr-2">Save</button> <button type="submit" class="btn btn-primary mr-2">'.$L->g('Save').'</button>
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'categories" role="button">Cancel</a> <a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'categories" role="button">'.$L->g('Cancel').'</a>
</div> </div>
'; ';

View File

@ -176,7 +176,7 @@
'tip'=>$L->g('Write a template name to filter the page in the theme and change the style of the page.') 'tip'=>$L->g('Write a template name to filter the page in the theme and change the style of the page.')
)); ));
echo Bootstrap::formTitle(array('title'=>'SEO')); echo Bootstrap::formTitle(array('title'=>$L->g('SEO')));
// Tags // Tags
echo Bootstrap::formInputText(array( echo Bootstrap::formInputText(array(
@ -191,7 +191,7 @@
'name'=>'slug', 'name'=>'slug',
'tip'=>$L->g('URL associated with the content'), 'tip'=>$L->g('URL associated with the content'),
'label'=>$L->g('Friendly URL'), 'label'=>$L->g('Friendly URL'),
'placeholder'=>'Leave empty for autocomplete by Bludit.' 'placeholder'=>$L->g('Leave empty for autocomplete by Bludit.')
)); ));
echo Bootstrap::formCheckbox(array( echo Bootstrap::formCheckbox(array(

View File

@ -7,19 +7,19 @@ echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog'));
<!-- TABS --> <!-- TABS -->
<ul class="nav nav-tabs" id="dynamicTab" role="tablist"> <ul class="nav nav-tabs" id="dynamicTab" role="tablist">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" id="general-tab" data-toggle="tab" href="#general" role="tab" aria-controls="general" aria-selected="true">General</a> <a class="nav-link active" id="general-tab" data-toggle="tab" href="#general" role="tab" aria-controls="general" aria-selected="true"><?php $L->p('General') ?></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " id="advanced-tab" data-toggle="tab" href="#advanced" role="tab" aria-controls="advanced" aria-selected="false">Advanced</a> <a class="nav-link " id="advanced-tab" data-toggle="tab" href="#advanced" role="tab" aria-controls="advanced" aria-selected="false"><?php $L->p('Advanced') ?></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " id="seo-tab" data-toggle="tab" href="#seo" role="tab" aria-controls="seo" aria-selected="false">SEO</a> <a class="nav-link " id="seo-tab" data-toggle="tab" href="#seo" role="tab" aria-controls="seo" aria-selected="false"><?php $L->p('SEO') ?></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link " id="social-tab" data-toggle="tab" href="#social" role="tab" aria-controls="social" aria-selected="false">Social Networks</a> <a class="nav-link " id="social-tab" data-toggle="tab" href="#social" role="tab" aria-controls="social" aria-selected="false"><?php $L->p('Social Networks') ?></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" id="language-tab" data-toggle="tab" href="#language" role="tab" aria-controls="language" aria-selected="false">Language</a> <a class="nav-link" id="language-tab" data-toggle="tab" href="#language" role="tab" aria-controls="language" aria-selected="false"><?php $L->p('Language') ?></a>
</li> </li>
</ul> </ul>
<?php <?php

View File

@ -82,8 +82,8 @@ class Language extends dbJSON {
return $this->db[$key]; return $this->db[$key];
} }
$line = '"'.$key.'": "'.$string.'",'; //$line = '"'.$key.'": "'.$string.'",';
file_put_contents(DEBUG_FILE, $line.PHP_EOL, FILE_APPEND); //file_put_contents(DEBUG_FILE, $line.PHP_EOL, FILE_APPEND);
return $string; return $string;
} }

View File

@ -342,5 +342,12 @@
"allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Allow Unicode characters in the URL and some part of the system.", "allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Allow Unicode characters in the URL and some part of the system.",
"variables-allowed": "Variables allowed", "variables-allowed": "Variables allowed",
"tag": "Tag", "tag": "Tag",
"drag-and-drop-to-sort-the-plugins": "Drag and Drop to sort the plugins." "drag-and-drop-to-sort-the-plugins": "Drag and Drop to sort the plugins.",
"seo": "SEO",
"documentation": "Documentation",
"forum-support": "Forum support",
"chat-support": "Chat support",
"quick-links": "Quick links",
"leave-empty-for-autocomplete-by-bludit": "Leave empty for autocomplete by Bludit.",
"choose-a-password-for-the-user-admin": "Choose a password for the user <code>admin</code>"
} }

View File

@ -307,7 +307,7 @@
"social-networks": "Redes sociales", "social-networks": "Redes sociales",
"interval": "Intervalo", "interval": "Intervalo",
"number-in-minutes-for-every-execution-of-autosave": "Número en minutos para cada ejecución de Autoguardar.", "number-in-minutes-for-every-execution-of-autosave": "Número en minutos para cada ejecución de Autoguardar.",
"extreme-friendly-url": "Extreme friendly URL", "extreme-friendly-url": "URL amistosas",
"title-formats": "Formatos de los títulos", "title-formats": "Formatos de los títulos",
"delete-content": "Eliminar contenido", "delete-content": "Eliminar contenido",
"are-you-sure-you-want-to-delete-this-page": "¿Confirma que desea eliminar esta página?", "are-you-sure-you-want-to-delete-this-page": "¿Confirma que desea eliminar esta página?",
@ -340,5 +340,11 @@
"allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Permitir caracteres Unicode en la dirección URL y en alguna parte del sistema.", "allow-unicode-characters-in-the-url-and-some-part-of-the-system": "Permitir caracteres Unicode en la dirección URL y en alguna parte del sistema.",
"variables-allowed": "Variables permitidas", "variables-allowed": "Variables permitidas",
"tag": "Etiqueta", "tag": "Etiqueta",
"drag-and-drop-to-sort-the-plugins": "Arrastrar y soltar para ordenar los plugins." "drag-and-drop-to-sort-the-plugins": "Arrastrar y soltar para ordenar los plugins.",
"seo": "SEO",
"documentation": "Documentation",
"forum-support": "Forum support",
"chat-support": "Chat support",
"quick-links": "Enlaces rápidos",
"leave-empty-for-autocomplete-by-bludit": "Deje vacío para ser autocompletado por Bludit."
} }

View File

@ -49,7 +49,7 @@ class pluginRSS extends Plugin {
$onlyPublished = true; $onlyPublished = true;
// Get the list of pages // Get the list of pages
$list = $pages->getList($pageNumber, $numberOfItems, $onlyPublished, true); $list = $pages->getList($pageNumber, $numberOfItems, $onlyPublished);
$xml = '<?xml version="1.0" encoding="UTF-8" ?>'; $xml = '<?xml version="1.0" encoding="UTF-8" ?>';
$xml .= '<rss version="2.0">'; $xml .= '<rss version="2.0">';

View File

@ -3,5 +3,8 @@
{ {
"name": "Simple Stats", "name": "Simple Stats",
"description": "Show the number of visitors per day on your dashboard." "description": "Show the number of visitors per day on your dashboard."
} },
"visits": "Visits",
"visits-today": "Visits today",
"unique-visitors-today": "Unique visitors today"
} }

View File

@ -3,5 +3,8 @@
{ {
"name": "Simple Stats", "name": "Simple Stats",
"description": "Muestra el número de visitantes por día en tu panel." "description": "Muestra el número de visitantes por día en tu panel."
} },
"visits": "Visitas",
"visits-today": "Visitas de hoy",
"unique-visitors-today": "Visitantes únicos de hoy"
} }

View File

@ -10,9 +10,11 @@ class pluginSimpleStats extends Plugin {
public function init() public function init()
{ {
global $L;
// Fields and default values for the database of this plugin // Fields and default values for the database of this plugin
$this->dbFields = array( $this->dbFields = array(
'label'=>'Visits', 'label'=>$L->g('Visits'),
'numberOfDays'=>7, 'numberOfDays'=>7,
'excludeAdmins'=>false 'excludeAdmins'=>false
); );
@ -63,6 +65,7 @@ class pluginSimpleStats extends Plugin {
public function dashboard() public function dashboard()
{ {
global $L;
$label = $this->getValue('label'); $label = $this->getValue('label');
$currentDate = Date::current('Y-m-d'); $currentDate = Date::current('Y-m-d');
$visitsToday = $this->visits($currentDate); $visitsToday = $this->visits($currentDate);
@ -75,8 +78,8 @@ $html = <<<EOF
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="ct-chart ct-perfect-fourth"></div> <div class="ct-chart ct-perfect-fourth"></div>
<p class="legends visits-today">Visits today: $visitsToday</p> <p class="legends visits-today">{$L->g('Visits today')}: $visitsToday</p>
<p class="legends unique-today">Unique visitors today: $uniqueVisitors</p> <p class="legends unique-today">{$L->g('Unique visitors today')}: $uniqueVisitors</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -155,7 +155,7 @@ foreach ($languageFiles as $fname=>$native) {
} }
} }
$language = new Language($finalLanguage); $L = $language = new Language($finalLanguage);
// Set locale // Set locale
setlocale(LC_ALL, $localeFromHTTP); setlocale(LC_ALL, $localeFromHTTP);
@ -591,7 +591,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
elseif (isset($_GET['language'])) elseif (isset($_GET['language']))
{ {
?> ?>
<p><?php echo $L->get('Choose a password for the username admin') ?></p> <p><?php echo $L->get('choose-a-password-for-the-user-admin') ?></p>
<form id="jsformInstaller" method="post" action="" autocomplete="off"> <form id="jsformInstaller" method="post" action="" autocomplete="off">
<input type="hidden" name="timezone" id="jstimezone" value="UTC"> <input type="hidden" name="timezone" id="jstimezone" value="UTC">