Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations don't get saved into .po if made between sync_stores and update_stores #366

Open
iafan opened this issue Dec 21, 2018 · 0 comments
Labels

Comments

@iafan
Copy link
Contributor

iafan commented Dec 21, 2018

Today we had an issue with some translation being 'stuck' on the translation server. While translation was provided 4 days ago, it wasn't downsynced to .po files, and running sync_stores command (without --force) wouldn't export it either.

So I looked at the logs and here is the relevant log entries around the time the submission was made:

[...]
[17/Dec/2018 01:15:49]  system  X       ./manage.py sync_stores --skip-missing --project=webclipper_evernote
[17/Dec/2018 01:15:51]  system  X       ./manage.py update_stores --project=webclipper_evernote
[17/Dec/2018 01:15:53]  system  X       ./manage.py sync_stores --skip-missing --project=website3_evernote
[17/Dec/2018 01:15:54]  nijinik SC      12.8571428571   TX      #7077486        NS=18   S=0     (total: 167295.04494)
[17/Dec/2018 01:15:54]  nijinik C       ja      7077486 /ja/website4_evernote/cms-content/feeds/notes.json.po   目標へ向かって前進していくなかで、その週にう>
[17/Dec/2018 01:15:58]  system  X       ./manage.py update_stores --project=website3_evernote
[17/Dec/2018 01:16:00]  system  X       ./manage.py sync_stores --skip-missing --project=website4_evernote
[17/Dec/2018 01:16:02]  [sync] File saved; updated 1 units in /ja/website4_evernote/cms-content/features/search-handwriting.json.po [revision: 2047766]
[17/Dec/2018 01:16:02]  [sync] File saved; updated 3 units in /ja/website4_evernote/cms-content/feeds/notes.json.po [revision: 2047774]
[17/Dec/2018 01:16:02]  [sync] File saved; updated 3 units in /ja/website4_evernote/cms-content/templates/index.json.po [revision: 2047769]
[17/Dec/2018 01:16:26]  nijinik SC      11.0    TA      #7077483        NS=11   S=0     (total: 167307.902083)
[17/Dec/2018 01:16:26]  nijinik A       ja      7077483 /ja/website4_evernote/cms-content/feeds/notes.json.po   課題を特定し、どのように目標を達成するかを具>
[17/Dec/2018 01:16:29]  system  X       ./manage.py update_stores --project=website4_evernote
[17/Dec/2018 01:16:31]  [update] updated 5 units in /ja/website4_evernote/cms-content/feeds/notes.json.po [revision: 2047776]
[17/Dec/2018 01:16:35]  system  X       ./manage.py sync_stores --skip-missing --project=windows_evernote
[17/Dec/2018 01:16:37]  system  X       ./manage.py update_stores --project=windows_evernote
[17/Dec/2018 01:16:39]  system  X       ./manage.py sync_stores --skip-missing --project=windows_v6_evernote
[...]

Key events and my interpretation:

  1. [01:16:00] - sync_stores started on website4_evernote
  2. [01:16:02] - /ja/.../notes.json.po file was saved to disk [revision: 2047774]
  3. [01:16:26] - translation for unit 7077483 was provided in /ja/.../notes.json.po file (I assume it got revision 2047775)
  4. [01:16:29] - update_stores started on website4_evernote
  5. [01:16:31] - 5 units were read from /ja/.../notes.json.po file [new revision: 2047776]

So after that translation with revision 2047775 was never synced back to .po (we were thinking that .po file is already at revision 2047776).

One way to address this is, at update_stores time, to check if the current revision of the file is the same as the last saved one for that file. If revisions differ, skip bumping up the revision. This will guarantee that next time sync_stores is executed, it will save all the new units back.

I understand that we introduced revision bumping at update_stores time as an optimization, to avoid re-exporting units that came from .po files. But in rare cases like the one described above, we can sacrifice this optimization.

@iafan iafan changed the title Translations don't get saved into .po if made between update_stores and sync_stores Translations don't get saved into .po if made between sync_stores and update_stores Dec 21, 2018
@iafan iafan added the bug label Dec 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant