]> git.koha-community.org Git - koha.git/commit
Bug 37303: Replace po2json with a JS version
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 10 Jul 2024 10:16:55 +0000 (12:16 +0200)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 29 Aug 2024 16:48:45 +0000 (16:48 +0000)
commitca663e537725f63e8eecc23a1f34f0143e91d593
tree8b74220102840402d3210f3ecf3d83ffa09a2884
parentca43567e86220d1a5ef645d23b500ef4a6362169
Bug 37303: Replace po2json with a JS version

When using __() (ie. Gettext.js) we are seeing the translations that are marked as fuzzy.
This is definitely not the expected behaviour.

It happens because (our version of) po2json are old and no longer maintained,
and just embed them.

It seems that the bin we have has been upgraded to a JS version
(different authors).

Test plan:
(replace LANG with your language code)
0. Do not apply this patch
Edit misc/translator/po/LANG-messages-js.po
Mark a string as fuzzy
Edit ./intranet-main.tt and add the following lines inside $(document).ready
  console.log(_("Your string"));
  console.log(__("Your string"));
Replace "Your string" with the string you are actually testing.

Update the templates: `koha-translate --update LANG --dev kohadev && restart_all`

Go to the Koha home page, open the console.

=> Notice that the second log in the console is displaying the fuzzy string.

1. Apply this patch
Install the new version of po2json using `yarn install`
Repeat the previous steps.

=> With this patch applied both logs show the English version of the
string.

Remove fuzzy, update the templates and try again.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4eb981635453871fa2a33396391f3f75a6baa8b1)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
misc/translator/LangInstaller.pm
misc/translator/po2json [deleted file]
package.json