Bug 47442 - The javascript _.ngettext() function does not work
The javascript _.ngettext() function does not work
Status: RESOLVED DUPLICATE of bug 48723
Product: UCS
Classification: Unclassified
Component: UMC (Generic)
UCS 4.3
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-02 13:01 CEST by Richard Ulmer
Modified: 2019-03-07 10:09 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.051
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Idea for replacing eval (untested) (899 bytes, patch)
2018-08-23 09:59 CEST, Richard Ulmer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Ulmer univentionstaff 2018-08-02 13:01:26 CEST
When using _.ngettext() in javascript code, the translation is always the plural form.

For example: The german "Gruppen" UMC-Module displays the text "1 Gruppen von 10 ausgewählt." instead of "Eine Gruppe von 10 ausgewählt.".
Comment 1 Richard Ulmer univentionstaff 2018-08-02 13:06:19 CEST
The problem was probably introduced by ECMAScript 5, because it changed the behavoir of the eval() function, which is used in the _.ngettext() function.

The eval() function is probably renamed during compression of the javascript code and thus now changes it's behavoir, so that it searches for variables in the global scope.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Description for more info.
Comment 2 Richard Ulmer univentionstaff 2018-08-23 09:59:15 CEST
Created attachment 9637 [details]
Idea for replacing eval (untested)

After talking to a fellow student I think that something similar to this could solve the problem. I didn't yet fully test this patch, though.
Comment 3 Florian Best univentionstaff 2019-03-07 10:09:17 CET
commit 56e72425bd9930ffa9b6ed86e163438b7e8d1e3e

*** This bug has been marked as a duplicate of bug 48723 ***