symphonycms / symphonycms

This is the official Symphony CMS repository.
https://www.getsymphony.com
MIT License
545 stars 210 forks source link

Translation not shown properly #2902

Open jurajkapsz opened 5 years ago

jurajkapsz commented 5 years ago

Affected Symphony version(s) : 2.7.10 PHP version(s) : 7.2 OS(es) : Ubuntu (Chrome, Firefox)

I have a Symphony translation:

'This request exceeds the maximum allowed request size of %s specified by your host.' =>
'Táto požiadavka prekročila povolenú veľkosť %s stanovenú serverom.',

But in the UI it is shown the following way (see at the beginning):

image

It looks like it is somehow changed by the backend javascript, 'cause in the html source the translation is present as translated, but changed in browser's debugger:

image

No errors in JS.

wdebusschere commented 4 years ago

Ok I have reproduced this.

The problem is because of this line: https://github.com/symphonycms/symphonycms/blob/master/symphony/assets/js/src/symphony.notify.js#L56

item = $('<p />', {
                'class': type
            }).html(message.replace(Symphony.Language.get('at') + ' ', '')).addClass('notice active').symphonyTimeAgo();
{
Ignore?: "Ignorovať?",
next: "ďalšie",
at: "o",
status: 200
}

Táto požiadavka get Tátpožiadavka

nitriques commented 4 years ago

@wdebusschere any ideas on how to fix it ?

wdebusschere commented 4 years ago

@nitriques

only replace if there is a %s (date?) after.. (maybe check if after the space there is a number)

'Author created at %s.' =>'Autor um %s erstellt.',

It's a minor issue, but i guess it can happen often.. example german: at = um, i guess the message could have some words ending in um with a space after and then the next word..