From 849c3440103beb4c3f990be54376dfa26c986848 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Mon, 9 Aug 2021 15:07:57 +0200 Subject: [PATCH] related to #1459 Translating MB to Mo --- admin/themes/default/js/maintenance.js | 5 ++--- admin/themes/default/template/maintenance_actions.tpl | 9 +++++---- language/en_UK/admin.lang.php | 1 + language/fr_FR/admin.lang.php | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/admin/themes/default/js/maintenance.js b/admin/themes/default/js/maintenance.js index 5fba7531a..194f7e09a 100644 --- a/admin/themes/default/js/maintenance.js +++ b/admin/themes/default/js/maintenance.js @@ -1,12 +1,12 @@ function displayResponse(domElem, values, mDivs, mValues) { for (let index = 0; index < domElem.length; index++) { - domElem[index].html(values[index] + " Mo") + domElem[index].html(unit_MB.replace("%s",values[index])) } for (let index = 0; index < mDivs.length; index++) { mDivName = mDivs[index].getAttribute("name"); - mDivs[index].title = mValues[mDivName] + " Mo"; + mDivs[index].title = unit_MB.replace("%s", mValues[mDivName]) } $(".cache-lastCalculated-value").html(no_time_elapsed); @@ -15,7 +15,6 @@ function displayResponse(domElem, values, mDivs, mValues) { $(document).ready(function () { $(".refresh-cache-size").on("click", function () { $(this).find(".refresh-icon").addClass("animate-spin"); - console.log("lelelele"); return new Promise((res, rej) => { jQuery.ajax({ diff --git a/admin/themes/default/template/maintenance_actions.tpl b/admin/themes/default/template/maintenance_actions.tpl index ce903d1c4..ae7d46b3d 100644 --- a/admin/themes/default/template/maintenance_actions.tpl +++ b/admin/themes/default/template/maintenance_actions.tpl @@ -6,6 +6,7 @@ const confirm_msg = '{"Yes, I am sure"|@translate}'; const cancel_msg = "{"No, I have changed my mind"|@translate}"; const no_time_elapsed = "{"right now"|@translate}"; +const unit_MB = "{"%s MB"|@translate}" let selected = []; $(".lock-gallery-button").each(function() { const gallery_tip = '{"A locked gallery is only visible to administrators"|@translate|@escape:'javascript'}'; @@ -147,7 +148,7 @@ $(".delete-size-check").click( function () { {'Cache size'|@translate} {if isset($cache_sizes)} - {round($cache_sizes[0]['value']/1024/1024, 2)} Mo + {"%s MB"|@translate:{round($cache_sizes[0]['value']/1024/1024, 2)}} {else} {'N/A'|translate} {/if} @@ -159,7 +160,7 @@ $(".delete-size-check").click( function () { {'Purge compiled templates'|@translate} {if isset($cache_sizes)} - {round($cache_sizes[2]['value']/1024/1024, 2)} Mo + {"%s MB"|@translate:{round($cache_sizes[2]['value']/1024/1024, 2)}} {else} {'N/A'|translate} {/if} @@ -171,7 +172,7 @@ $(".delete-size-check").click( function () { {'Delete multiple size images'|@translate} {if isset($cache_sizes)} - {round($cache_sizes[1]['value']['all']/1024/1024, 2)} Mo + {"%s MB"|@translate:{round($cache_sizes[1]['value']['all']/1024/1024, 2)}} {else} {'N/A'|translate} {/if} @@ -179,7 +180,7 @@ $(".delete-size-check").click( function () {
{foreach from=$purge_derivatives key=name item=url name=loop} -
+
{$name}
diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index 3e0e146d3..eff819cea 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -1239,3 +1239,4 @@ $lang['Has access to administration. Can only manage content: photos/albums/user $lang['No access to administration, can see private content with appropriate permissions.'] = 'No access to administration, can see private content with appropriate permissions.'; $lang['Can be shared by several individuals without conflict (they cannot change the password).'] = 'Can be shared by several individuals without conflict (they cannot change the password).'; $lang['Equivalent to deactivation. The user is still in the list, but can no longer log in.'] = 'Equivalent to deactivation. The user is still in the list, but can no longer log in.'; +$lang['%s MB'] = '%s MB'; \ No newline at end of file diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index 8678f8506..2989d6e93 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -1241,3 +1241,4 @@ $lang['Has access to administration. Can only manage content: photos/albums/user $lang['No access to administration, can see private content with appropriate permissions.'] = 'Pas d\'accès à l\'administration. Peut accéder au contenu privé s\'il en a les permissions.'; $lang['Can be shared by several individuals without conflict (they cannot change the password).'] = 'Partageable entre plusieurs personnes sans rentrer en conflit (mot de passe non modifiable).'; $lang['Equivalent to deactivation. The user is still in the list, but can no longer log in.'] = 'Équivalent à une désactivation. L\'utilisateur est toujours dans la liste mais ne peut plus se connecter.'; +$lang['%s MB'] = '%s Mo'; \ No newline at end of file