Shaarli's translation

* translation system and unit tests
 * Translations everywhere

Dont use translation merge

It is not available with PHP builtin gettext, so it would have lead to inconsistency.
This commit is contained in:
ArthurHoaro 2017-05-09 18:12:15 +02:00
parent 72cfe44436
commit 12266213d0
51 changed files with 2252 additions and 246 deletions

View file

@ -1 +1,5 @@
<span><a href="%s%s" target="_blank"><img class="linklist-plugin-icon" src="%s/wallabag/wallabag.png" title="Save to wallabag" alt="wallabag" /></a></span>
<span>
<a href="%s%s" target="_blank">
<img class="linklist-plugin-icon" src="%s/wallabag/wallabag.png" title="%s" alt="wallabag" />
</a>
</span>

View file

@ -5,6 +5,7 @@
*/
require_once 'WallabagInstance.php';
use Shaarli\Config\ConfigManager;
/**
* Init function, return an error if the server is not set.
@ -17,8 +18,8 @@ function wallabag_init($conf)
{
$wallabagUrl = $conf->get('plugins.WALLABAG_URL');
if (empty($wallabagUrl)) {
$error = 'Wallabag plugin error: '.
'Please define the "WALLABAG_URL" setting in the plugin administration page.';
$error = t('Wallabag plugin error: '.
'Please define the "WALLABAG_URL" setting in the plugin administration page.');
return array($error);
}
}
@ -43,12 +44,14 @@ function hook_wallabag_render_linklist($data, $conf)
$wallabagHtml = file_get_contents(PluginManager::$PLUGINS_PATH . '/wallabag/wallabag.html');
$linkTitle = t('Save to wallabag');
foreach ($data['links'] as &$value) {
$wallabag = sprintf(
$wallabagHtml,
$wallabagInstance->getWallabagUrl(),
urlencode($value['url']),
PluginManager::$PLUGINS_PATH
PluginManager::$PLUGINS_PATH,
$linkTitle
);
$value['link_plugin'][] = $wallabag;
}
@ -56,3 +59,14 @@ function hook_wallabag_render_linklist($data, $conf)
return $data;
}
/**
* This function is never called, but contains translation calls for GNU gettext extraction.
*/
function wallabag_dummy_translation()
{
// meta
t('For each link, add a QRCode icon.');
t('Wallabag API URL');
t('Wallabag API version (1 or 2)');
}