[Ack] [R118] Duplicate tags in localization file (a kind of bug?)

Hey there! A different kind of bug report this time, or should it be in the Localization forum? :stuck_out_tongue:

So, I have done some more work with my translation helping program, and have found two errors in the en.json file. Not critical bugs, but a FYI since I canā€™t imagine this is wanted by anyone :wink:

There are two tags that are duplicated:
ā€œloadingā€ : ā€œLoadingā€¦ā€, (row 9 and 34)
and
"title_screen_load_game": ā€œLoad Gameā€, (row 19 and 21)

Short story:
I was about to continue the translation work, normally I first open the previous and new english file and compare them. Anyway, I noticed row 34 to be marked as ā€œno translationā€. Strange, because I remembered that I had translated this one! So I opened the original files (r99 and r118), oh yes, they were identical on this row! So I started to check through my code to look for errors in my program (due to the ā€œā€¦ā€ after ā€œLoadingā€ or so). Couldnā€™t find any though, so I started to break down the translation files. And then I noticed the error on row 19-21 instead, and I had my explanation :blush: Btw, this ā€œerrorā€ has existed for quite a while, I didnā€™t see it at first since I thought they were new tags.

Now, when I look at the localization file, it has no groups or categories, but the file itself is grouped by an empty row between groups of tags. So this question is for Radiant (@sdee perhaps?), will you have the same tag name in several places or is this a ā€œbugā€ in your en.json file? When my software reads the second tag, it would place the translation on the first occation of the tag (again). So if you will reuse tag names Iā€™ll have to rewrite my program, because it is not designed for this at all :wink:

Btw, I noticed the inventory tags are now called backpack tags :smile:

2 Likes

nicely spotted! I hope it has implications of individual unit inventories that can perhaps be adjusted (or at least viewed)? :smiley:

Good eye! Yes, thatā€™s a bug; there shouldnā€™t be 2 tags of the same name. :slight_smile:

1 Like

Ok, good to know :blush:

Btw, you still have formatting in the localization file :stuck_out_tongue:

Anyway, I threw in a piece of code for next release:

//True means duplicate found
if (searchForDuplicate(NewItem.tagName))
   writeLog("Duplicate tag found: " + NewItem.tagName);

So I will look for if the tag already exists before adding a potential second one (it will still be added, but get no translation, and the log will notify the user. Perhaps a pop-up in addition if errors are found. Everyone loves pop-ups.

2 Likes

Btw, this is how it looks when a duplicate is found now :wink:

From the log:

...
Opened the translation file.
Duplicate tag found: title_screen_load_game
Duplicate tag found: loading
...

And this is how it looks when tags get new names:

These have no translation (but they had before):

The old ones are now found at the bottom as ā€œtags that canā€™t be found any longerā€.

3 Likes