Bugzilla – Attachment 156712 Details for
Bug 34983
Retranslating causes changes in locale_data.json
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34983: Force a sort order in JSON output of po2json
Bug-34983-Force-a-sort-order-in-JSON-output-of-po2.patch (text/plain), 1.39 KB, created by
David Nind
on 2023-10-08 19:13:54 UTC
(
hide
)
Description:
Bug 34983: Force a sort order in JSON output of po2json
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-10-08 19:13:54 UTC
Size:
1.39 KB
patch
obsolete
>From 4590853852f7fd2eb2da34c3c07c16a38d03af22 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 4 Oct 2023 15:04:27 +0200 >Subject: [PATCH] Bug 34983: Force a sort order in JSON output of po2json > >This patch does so by default. If you do not want them sorted, >export CANONICAL-0 on the command line. > >Test plan: >Copy a staff PO file from misc/translator to test.po >Now run: time misc/translator/po2json test.po > json1 >And do: time misc/translator/po2json test.po > json2 >Run: diff json1 json2; #They should be the same. >Now: export CANONICAL=0 >And run: time misc/translator/po2json test.po > json3 >And again: time misc/translator/po2json test.po > json4 >And run: diff json3 json4; # Lots of changes >Remove the created cruft. And signoff :) > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >--- > misc/translator/po2json | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/misc/translator/po2json b/misc/translator/po2json >index 410bd68c41..a04d85949f 100755 >--- a/misc/translator/po2json >+++ b/misc/translator/po2json >@@ -165,7 +165,7 @@ sub main > } > > >- my $jsonobj = JSON->new; >+ my $jsonobj = JSON->new->canonical( $ENV{CANONICAL} // 1 ); # if you dont want sorted keys, export CANONICAL=0 > my $basename = basename($src); > $basename =~ s/\.pot?$//; > if ($pretty) >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34983
:
156538
|
156712
|
157084