works very well, except every time a file gets reparsed the translation line is added one more time in the po file.....

e.g.

#: fivestar_comment.inc:24,24,24,24,24,24,24,24
msgid "Optional rating"
msgstr "Optionele punten"

This happens with the local parser.

Comments

gábor hojtsy’s picture

How does the package gets reparsed?

pvasili’s picture

Probably, I receive the same error: http://drupal.org/node/206126

bwynants’s picture

Yes sometimes the project are reparsed (with reason). if not reparsed it does not get an extra repeat.

ps: I update the archives sometimes to include the latest fixes, hence the reparsing...

gábor hojtsy’s picture

Status: Active » Fixed

Doh, just found out that there was a $fid value used in extractor.inc's l10n_community_save_string(), which was never initialized. So all reparsed releases had their lines stored all again, and again. Doh. Now hopefully fixed with this change:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/l10n_server...

Note however that reparsing stuff still keeps old occurrences of strings, so strings removed in the new version will not get removed, and strings moved lines in the new version will get their old and new line numbers stored as well. This is either bad or by design. If we just remove the file/line information when reparsing a package, it could easily lead to data loss if the new package is not properly parseable. The reparsing "feature" is in itself a development feature by nature. The drupal.org install will parse alpha, beta, rc versions (depending on setup), but not nightly development versions, as parsing all nightly development versions again and again each day would add a *huuuuge* data overhead to this system. So this module will only parse fixed code bases, which are not modifiable, and therefore do not require reparsing.

pvasili’s picture

Status: Fixed » Postponed (maintainer needs more info)

2 Gábor Hojtsy - I can remove data it SQL http://drupal.org/node/203658 ? Lines will be taken again correctly.
Thanks

gábor hojtsy’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sure, feel free to remove file and line data in case you reparse the file again. Keep the strings and translations intact. **Always** make a backup first, in case anything goes wrong.

bwynants’s picture

Status: Fixed » Postponed (maintainer needs more info)

so it should be ok to increase the version number to create a clean file? for the way I use it the overhead is not a problem...

Thanks for the fix. Is there a need/way for me to clean up my database?

bwynants’s picture

Status: Postponed (maintainer needs more info) » Fixed

state and answer given during my edit sorry :-)

psicomante’s picture

Can we reparse all modules from scratch without losing translations? Something like


TRUNCATE 'l10n_community_file';
TRUNCATE 'l10n_community_line';
TRUNCATE 'l10n_community_project';
TRUNCATE 'l10n_community_release';

And reparsing all projects?

bwynants’s picture

I cleared only l10n_community_file and l10n_community_line touched all archive, reparsed and it was ok....

gábor hojtsy’s picture

Yes, the extractor picks up identifiers of existing source strings, so if you keep the source strings intact, it will add back the file and line information properly. Actually, there was only a problem with the line information, so you should be fine with just truncating the line table and reparsing all source packages. (The code notices that you already have that file recorded, so it should not add that twice, there was only a problem with the lines).

Again, always make a backup first!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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