To be able to show status of translation for downloaded files, a much requested feature, we should add number of source strings present in a release as a "cached" number on release entries. Even though we can count this it only ever changes when the release is parsed or re-parsed, so we can update the number in that case. If we also add that number to packages, we'll get two numbers easily compared for showing status. Counts on releases should also speed up status shown on project browser pages.

This is a very rough start and I had more important things to venture into momentarily, so I'm recording it here for future development.

CommentFileSizeAuthor
#1 sid_count.patch38.64 KBgábor hojtsy
sidcount.patch5.21 KBgábor hojtsy

Comments

gábor hojtsy’s picture

Status: Needs work » Fixed
StatusFileSize
new38.64 KB

Here is an improved version which also includes fixes for all the tests. Some were broken by this change, others were broken by potx source string changes. Its not fortunate that our tests depend on the potx module test sample data (however it is convenient if those do not change). So for now, it will stay like that.

The attached patch adds a sid_count to l10n_server_release and to l10n_packager_file. No UIs are affected, so we are not exposing this data yet. However, there is an update function for releases since we should know the exact number of sid_counts there. For files generated before this patch, we cannot be sure, since strings might have changed since then. Theoretically, we could devise some update query to get the data, but it sounds way too complicated, so I'm opting to let the system run its course regenerating files, and we'll display N/A status for stuff when the UI hits for this, for unknown sid_counts.

The tests do not cover the functionality 100% but all tests pass now, and the patch looks good visually, so I'm committing it and deploying to l.d.o.

gábor hojtsy’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.