Re: CVS modules for translations



Folks, I have another idea.
What if instead of messing with CVS and changing the way it works we
create a simple python script that does bulk committing?
I just was thinking about this for 5-10 minutes and got this idea.
Would be glad to hear your comments on this. Here I assume that we are
translating HEAD, we are getting po files from the status pages where
they are updated very frequently, and that we are NOT adding new

translations-just updating them.
Here is my scenarion:

Say I want to translate some Desktop group apps so I go to
http://developer.gnome.org/projects/gtp/status/gnome-2.6/az/desktop/index.ht
ml
and get all (or needed) files from there.
Now I have a local directory such as /home/metin/translations/desktop
with files named (will write only four of them to be short):

/home/metin/translations/desktop/
                    //                        acme.HEAD.az.po
                   //                         bug-buddy.HEAD.az.po
                   //                         eel.HEAD.az.po
                  //                          eog.HEAD.az.po
                 ...                                  ...

Now I edit them and it's time to commit changes back.
So I execute script with something like:

commitcsript --path=/home/metin/translations/desktop --logmessage='ChangeLog
message goes here'

Our commitscript goes to provided directory, parses it, gets all filenames
inside that dir and does this:

---------------------------------------------

1- Look for all files which end with .po (if there aren't any, give friendly
error)
2- Next check the suffix (in this case: "az") and remember this (this can
also be harcoded into the script)

 BEGIN LOOP UNTIL ALL PO FILES ARE DONE
  a- Read file name before first dot (actually module name)
  b- Do cvs -z3 co file_name/po/remembered_earlier_suffix.po
        cvs -z3 co file_name/po/ChangeLog
  c- Get my modified version from provided dir, rename it on the fly to
suffix.po and copy that over just checked out version
  d- Modify ChangeLog with provided changelog entry (see execution line
above)
  e- Commit all (in this case 2 files)
  f- Give message that file_name (in this case module name) has been updated
successfully
 END LOOP

3- Give some statistics about things

---------------------------------------------

And we are done! Of course the script can do the syntax control stuff too
but I just wrote down the most important aspects.
I might forget something here, if so, please correct me. Actually I could
write
more scenarios and thoughts but I urgently need some sleep :p

Cheers

Metin Amiroff
Azerbaijani Team





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]