Bug 18634: Handle colliding translation for preference sections
commit7bcad818744b11180b2b2c31a5dda8d51552b862
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 14 Jun 2017 13:37:55 +0000 (14 15:37 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 12 Jul 2017 07:37:48 +0000 (12 09:37 +0200)
tree36c44cc50a81a7719c55cc41ae8bc26edc608538
parent15e6d33fc02f2c11e24c359dbc52da6b2f20fbf9
Bug 18634: Handle colliding translation for preference sections

Problem on this report was caused by translating the tabs Privacy
and Payments by the same string. This caused overwriting a hash entry.

This patch tests if the key already exists and if so, it merges the
entries instead of overwriting the old contents.

Test plan:
[1] Make sure that e.g. Privacy and Payments translate to e.g Vie privee.
[2] Run translate install fr-CA (or the language you altered)
[3] Without this patch you should loose preferences from either Privacy or
    Payments. With this patch, they should be merged.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with fr-CA.

Signed-off-by: Blou <philippe.blouin@inlibro.com>
Reset the .po files, reproduced the problem.  Applied the patch and suddenly 'paypal' appeared.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0d98089ec701bc96893e68408ce2dedad36f7235)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
misc/translator/LangInstaller.pm