From: Jakobus Schürz Date: Sat, 11 Mar 2023 16:26:00 +0000 (+0100) Subject: make erromessages translateable X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9140914a241836f25d5e605317d4d724a30816b7;p=friendica.git make erromessages translateable --- diff --git a/src/App/Page.php b/src/App/Page.php index e226252124..c2a77b3251 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -253,6 +253,12 @@ class Page implements ArrayAccess '$touch_icon' => $touch_icon, '$block_public' => intval($config->get('system', 'block_public')), '$stylesheets' => $this->stylesheets, + '$likeNetError' => $l10n->t('Like not successfull (Network error)'), + '$dislikeNetError' => $l10n->t('Dislike not successfull (Network error)'), + '$annonNetError' => $l10n->t('Sharing not successfull (Network error)'), + '$likeSrvError' => $l10n->t('Like not successfull (Backend error)'), + '$dislikeSrvError' => $l10n->t('Dislike not successfull (Backend error)'), + '$annonSrvError' => $l10n->t('Sharing not successfull (Backend error)'), ]) . $this->page['htmlhead']; } diff --git a/view/theme/frio/js/theme.js b/view/theme/frio/js/theme.js index 4d14df5724..f6d681203e 100644 --- a/view/theme/frio/js/theme.js +++ b/view/theme/frio/js/theme.js @@ -851,7 +851,7 @@ function doActivityItemAction(ident, verb, un) { $('button[id^=shareMenuOptions-' + ident.toString() + '] i:first-child').addClass('fa-share'); $('button[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass); $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass); - $.jGrowl(verb + ' not successful (server error)', {sticky: false, theme: 'info', life: 5000}); + $.jGrowl(aActSrvErr[verb], {sticky: false, theme: 'info', life: 5000}); } }) .error(function(data){ @@ -860,7 +860,7 @@ function doActivityItemAction(ident, verb, un) { $('button[id^=shareMenuOptions-' + ident.toString() + '] i:first-child').addClass('fa-share'); $('button[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass); $('a[id^=' + verb + '-' + ident.toString() + '] i:first-child').addClass(thumbsClass); - $.jGrowl(verb + ' not successful (network error)', {sticky: false, theme: 'info', life: 5000}); + $.jGrowl(aActNetErr[verb], {sticky: false, theme: 'info', life: 5000}); }); } diff --git a/view/theme/frio/templates/js_strings.tpl b/view/theme/frio/templates/js_strings.tpl index c27921afdb..540009c82d 100644 --- a/view/theme/frio/templates/js_strings.tpl +++ b/view/theme/frio/templates/js_strings.tpl @@ -10,4 +10,14 @@ They are loaded into the html so that js functions can use them *}} 'blockAuthor' : "{{$blockAuthor|escape:'javascript' nofilter}}", 'ignoreAuthor' : "{{$ignoreAuthor|escape:'javascript' nofilter}}", }; + var aActNetErr = { + 'like' : "{{$likeNetError}}", + 'dislike' : "{{$dislikeNetError}}", + 'announce' : "{{$annonNetError}}", + }; + var aActSrvErr = { + 'like' : "{{$likeSrvError}}", + 'dislike' : "{{$dislikeSrvError}}", + 'announce' : "{{$annonSrvError}}", + };