Translate some missing string, fix #629

This commit is contained in:
Flavio Copes
2016-06-10 15:10:24 +02:00
parent fd9af0ec96
commit 99bc525095
6 changed files with 56 additions and 41 deletions

View File

@@ -695,7 +695,12 @@ class AdminPlugin extends Plugin
'ROUTABLE',
'NON_ROUTABLE',
'PUBLISHED',
'NON_PUBLISHED'
'NON_PUBLISHED',
'PLUGINS',
'THEMES',
'ALL',
'FROM',
'TO'
];
foreach($strings as $string) {

View File

@@ -561,9 +561,12 @@ PLUGIN_ADMIN:
TYPE: "Type"
FILE_EXTENSION: "File Extension"
LEGEND: "Page Legend"
MEMCACHE_SERVER: Memcache server
MEMCACHE_PORT: Memcache port
MEMCACHED_SERVER: Memcache server
MEMCACHED_PORT: Memcache port
REDIS_SERVER: Redis server
REDIS_PORT: Redis port
MEMCACHE_SERVER: "Memcache server"
MEMCACHE_PORT: "Memcache port"
MEMCACHED_SERVER: "Memcache server"
MEMCACHED_PORT: "Memcache port"
REDIS_SERVER: "Redis server"
REDIS_PORT: "Redis port"
ALL: "All"
FROM: "from"
TO: "to"

View File

@@ -85,12 +85,19 @@ export default class Updates {
.addClass('with-updates')
.find('.badge.updates').text(length);
var type_translation = '';
// update all
let title = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase();
if (type === 'plugins') {
type_translation = translations.PLUGIN_ADMIN.PLUGINS;
} else {
type_translation = translations.PLUGIN_ADMIN.THEMES;
}
let updateAll = $(`.grav-update.${type}`);
updateAll.css('display', 'block').html(`
<p>
<a href="#" class="button button-small secondary" data-remodal-target="update-packages" data-packages-slugs="${Object.keys(resources).join()}" data-${singles[index]}-action="start-packages-update">${translations.PLUGIN_ADMIN.UPDATE} All ${title}</a>
<a href="#" class="button button-small secondary" data-remodal-target="update-packages" data-packages-slugs="${Object.keys(resources).join()}" data-${singles[index]}-action="start-packages-update">${translations.PLUGIN_ADMIN.UPDATE} ${translations.PLUGIN_ADMIN.ALL} ${type_translation}</a>
<i class="fa fa-bullhorn"></i>
${length} ${translations.PLUGIN_ADMIN.OF_YOUR} ${type} ${translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE}
</p>

View File

@@ -1,5 +1,5 @@
import $ from 'jquery';
import { config } from 'grav-config';
import { config, translations } from 'grav-config';
import request from '../utils/request';
import { Instance as gpm } from '../utils/gpm';
@@ -121,7 +121,7 @@ class Packages {
name = resources.themes[slug].name;
}
list.append(`<li>${name ? name : slug}, from v<strong>${current_version}</strong> to v<strong>${available_version}</strong></li>`);
list.append(`<li>${name ? name : slug}, ${translations.PLUGIN_ADMIN.FROM} v<strong>${current_version}</strong> ${translations.PLUGIN_ADMIN.TO} v<strong>${available_version}</strong></li>`);
} else {
list.append(`<li>${name ? name : slug}</li>`);
}
@@ -241,7 +241,7 @@ class Packages {
name = resources.themes[slug].name;
}
$('.packages-names-list').append(`<li>${name ? name : slug}, from v<strong>${current_version}</strong> to v<strong>${available_version}</strong></li>`);
$('.packages-names-list').append(`<li>${name ? name : slug}, ${translations.PLUGIN_ADMIN.FROM} v<strong>${current_version}</strong> ${translations.PLUGIN_ADMIN.TO} v<strong>${available_version}</strong></li>`);
} else {
$('.packages-names-list').append(`<li>${name ? name : slug}</li>`);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long