]> git.mxchange.org Git - friendica.git/commitdiff
make erromessages translateable
authorJakobus Schürz <jakobus.schuerz@schuerz.at>
Sat, 11 Mar 2023 16:26:00 +0000 (17:26 +0100)
committerJakobus Schürz <jakobus.schuerz@schuerz.at>
Tue, 14 Mar 2023 16:32:11 +0000 (17:32 +0100)
src/App/Page.php
view/theme/frio/js/theme.js
view/theme/frio/templates/js_strings.tpl

index e226252124fed000336299b23c859ccbdb48217f..c2a77b32513465d3d7a56d8d61d092dfcad842d9 100644 (file)
@@ -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'];
        }
 
index 4d14df57241a8a26dc705379e781f35cfff662bb..f6d681203ed955b1152bdea62cb9f3d2f34ded26 100644 (file)
@@ -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});
        });
 }
 
index c27921afdbb9060ca34dfb7c3b8c81745b080546..540009c82d2145ebf54b036e4ed982823c387d61 100644 (file)
@@ -10,4 +10,14 @@ They are loaded into the html <head> 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}}",
+        };
 </script>