Missing key disappears from list of missing keys although it is not translated

I have had three missing keys needed to be translated. I entered missing key , did not change anything and logged out. When I logged in I noticed that it is not anymore in the list of missing keys
I have removed closing tag in default.journal.policy key in locale.xml but behavior is the same. There is no missing keys in Translator plugin although they are not translated.
Please advise

If you entered any text (for example, the English sample) in the missing key, it will no longer appear as “missing”. If you use the Translate Plugin’s “Edit” feature to edit the file, do you see the key?

It was not necessary to enter any text. It was sufficient to click to open it and after saving without changes that missing key was missing from the list when I click on Check locale. If I press edit I see the list of 129 entries. I do not which one is that if it is one of those listed.

Thanks,

Vedran

I’m not able to reproduce this locally. Are you still testing under 2.4.6 with the sr_SR locale?

Can you share the XML file as it now exists where the missing keys are not flagged? A straightforward way to do this would be to install a fresh copy of OJS and just use the Translate plugin to check and save the locale.

Hello,

yes, the same is happening with sr_SR and hr_HR locales. Please let me know which xml files do you need and I will send them to you.

Thanks

When in the “Check” feature of the Translate Plugin, the Missing Keys will describe which file was expected:

Missing Keys
The key “common.metric” is missing from “lib/pkp/locale/sr_SR/common.xml”. The English version has been provided as a default.
Reference Version
Translation
The key “common.count” is missing from “lib/pkp/locale/sr_SR/common.xml”. The English version has been provided as a default.
Reference Version
Translation
The key “defaultMetric.title” is missing from “lib/pkp/locale/sr_SR/common.xml”. The English version has been provided as a default.
Reference Version
Translation
The key “defaultMetric.availableMetrics” is missing from “lib/pkp/locale/sr_SR/common.xml”. The English version has been provided as a default.
Reference Version
Translation

So, if you click “Save” and the “common.metric” key has disappeared unexpectedly, the corresponding file would be “lib/pkp/locale/sr_SR/common.xml

There are no Missing keys any more and there were Missing locale files below missing keys. When I opened Missing locale file and event after not entering anything in the field option to translate missing locale file disappeared like it was translated. i .e Datacite plugin related fields disappeared although they were not translated.

I guess that there are the following possible causes of that behavior:

  1. People who started to create locale files have had the same mistake in sr_SR and hr_HR locales since the same people started the both locales
  2. Existing translations were old and new versions did not upgrade possible code details which caused such behavior
  3. There is a bug that create problems during the translation. Please see issues I mentioned in other threads related to translation.

Thanks,

@vvucic, can you replicate this on a clean install?

Here is what I did to test this:
Install a fresh copy of OJS and create a single empty journal.
As the Site Administrator, navigate to User Home → Journal Manager → System Plugins → Generic Plugins → Translator Plugin.
Then Enable, then Translate from the Translator Plugin.
In the Translator Plugin, navigate to page 2, then sr_SR and select “Check”.
Scroll to the bottom, click “Save”
Return to sr_SR and select “Check” again.

If you follow these steps on a clean install, what do you see?

Hello,

I have done clean install and created Testing Journal that is actually empty. I enabled translator plugin and have done the following:

  1. clicked on Check of hr_HR
    ( I have seen, missing keys fields, extra keys to be deleted and missing locale files. Extra keys could not be deleted by checking delete Checkbox)
  2. When I clicked on Missing locale file and did not change anything it disappears from the list of missing locale files if I click on Save or Done. Only after clicking Cancel it stays on the list of missing locale files.

Please let me know is that normal. I suppose that there should be some warning message that will inform user that after clicking Save or Done it would not be possible to edit that locale file via GUI afterwards.
please let me know if I did some mistake.
Thanks

It sounds like you are:

  • Checking a Translation
  • Clicking the “CREATE” link under “Missing Locale Files”
  • Clicking “Done” without completing the translation of the newly created file.

If that is the case, the newly created file is then created with all keys as English translations. I believe the bug is that the file should have been created with blank translations instead.

There ought to be logic to wipe the key values after:

Yes, you correctly noticed the procedure what I have done and the consequences. Please let me know if I can help in further testing.

Thanks

@vvucic, this will be fixed in 2.4.7, per this issue: Translate plugin creates new files with default translations · Issue #546 · pkp/pkp-lib · GitHub

If we ask nicely enough, perhaps @asmecher would even cherry-pick to ojs-stable-2_4_6 to get it in 2.4.6-1.

If you’re handy with code, you can use this patch against your current install: https://github.com/pkp/ojs/commit/0a56040ea5d93b590b298dfa78d08aca2a5fc107.diff

Hi @vvucic & @ctgraham,

That’s nice enough for me – I’ve cherry-picked it to ojs-stable-2_4_6.

Regards,
Alec Smecher
Public Knowledge Project Team

I can wait upgrade for next version. Thanks. I am would be glad if I could help more in looking for bugs.

Sincerely,

Veki