Re: [translate-pootle] Make commits from command line
Our Pootle system is at http://translate.unixlan.com.ar/ and svn browser at http://www.unixlan.com.ar/viewvc regards, Normando Normando Hall escribió: > Thank you Friedel, Miklos, Lars, and Christian for your helpful advices. > > We implement a cron auto-commit script to make the commits without force > user to make this. This is because in the future we implement an > automatic system to make patchs and rpms automatically, so yet at > testing only. > I will try to add a message log from pocount and last username > translator, via -F commit option. > For those are interested in the script, here I add a dirty non refined > script, the same we are using now. > > SVN-CI-PO > > #!/bin/bash - > /usr/bin/svn -q ci --username pootle --password -m "Automatic > updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project1/* > /usr/bin/svn -q ci --username pootle --password -m "Automatic > updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project2/* > /usr/bin/svn -q ci --username pootle --password -m "Automatic > updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project3/* > > In our system we have implemented two svn repositories. One for PO > translated files, and one only for Templates. Each repo has anonymous > access for checkout and update, but authenticated for import and commit. > > Because pootle has not yet a way to upload templates, we can do through > SVN and other cron script. > > Follow is the templates script, that run an update from svn to pootle > templates. > > SVN-UP-TMPL > > #!/bin/bash - > /usr/bin/svn -q update > /usr/lib/python2.4/site-packages/Pootle/po/project1/templates > /usr/bin/svn -q update > /usr/lib/python2.4/site-packages/Pootle/po/project2/templates > /usr/bin/svn -q update > /usr/lib/python2.4/site-packages/Pootle/po/project3/templates > > Now, because we can't give admin access to users for run "Update from > templates" or "Update languages" from pootle web admin inteface, we also > make another script to run this: > > UPDATE-PO-FROM-TMPL > > #!/bin/bash > > lup=/tmp/langupd > mkdir $lup > #BASE=pootleLang > BASE=/usr/lib/python2.4/site-packages/Pootle/po/ > > cd $BASE > #echo `pwd` > > for project in project1 project2 project3 > do > > cd $project > #echo `pwd` > > for dir in `ls -I templates` > do > > #echo $dir > mkdir $lup/$dir > cp -r $dir/*.po $lup/$dir > /usr/bin/python2.4 /usr/bin/pot2po --progress=none -t $lup/$dir > templates $dir > rm -rf $lup/$dir > > done > cd .. > > done > rm -rf $lup > > Finally we make a script to add new files to repository. This is because > if you have upload (add + commit) a new template to svn, then this > template is parsed through all languages PO files with the above script, > generating new files (if this is the cace) or modifying. But this new PO > file is not added to the PO repo. The follow is the script to add new > files to PO repo from Pootle PO files. > > SVN-ADD-PO > > #!/bin/bash > > poadd="/tmp/svnadd" > > echo "#!/bin/bash" > $poadd > echo "" >> $poadd > svn status /usr/lib/python2.4/site-packages/Pootle/po/project1/??/*.po > |grep ? >> $poadd > perl -pi -e 's/\? /svn add -q/g' $poadd > chmod 755 $poadd > $poadd > rm -f $poadd > > echo "#!/bin/bash" > $poadd > echo "" >> $poadd > svn status /usr/lib/python2.4/site-packages/Pootle/po/project2/??/*.po > |grep ? >> $poadd > perl -pi -e 's/\? /svn add -q/g' $poadd > chmod 755 $poadd > $poadd > rm -f $poadd > > echo "#!/bin/bash" > $poadd > echo "" >> $poadd > svn status /usr/lib/python2.4/site-packages/Pootle/po/project3/??/*.po > |grep ? >> $poadd > perl -pi -e 's/\? /svn add -q/g' $poadd > chmod 755 $poadd > $poadd > rm -f $poadd > > > It i better if I use for-do-done :) > > Run these scripts once an hour. I was made a mistake running every 5 or > 6 minutes and at some time two or more scripts overlap and make locked > repo, generatin lock errors from svn. > > We will try to refine these scripts, and publish them. > > Thanks again for all your replies. > > regards, Normando > > > > F Wolff escribió: > >> Op Vrydag 2008-02-29 skryf Miklos Vajna: >> >> >>> On Fri, Feb 29, 2008 at 07:19:05AM +0100, Christian Perrier <[EMAIL >>> PROTECTED]> wrote: >>> >>> > I want to make commit from command line. I can make commits through cron > scripts, but I want through pootle, because add a message about > translator and translated strings. > > Is this possible? > > As far as I know, no. This is something we also need for Debian's experimental Pootle server. >>> hmm. i think it's good to force users to commit manually, so that you >>> can run 'git blame' (or other similar command for other vcses) to see >>> who committed for example a mistake. if you do anonymous commits, then >>> you can't blame anybody when a bug is found. >>> >>> >> Well, the Last-Trans
Re: [translate-pootle] Make commits from command line
Becareful with scripts because email wrap lines. Normando Normando Hall escribió: > Thank you Friedel, Miklos, Lars, and Christian for your helpful advices. > > We implement a cron auto-commit script to make the commits without force > user to make this. This is because in the future we implement an > automatic system to make patchs and rpms automatically, so yet at > testing only. > I will try to add a message log from pocount and last username > translator, via -F commit option. > For those are interested in the script, here I add a dirty non refined > script, the same we are using now. > > SVN-CI-PO > > #!/bin/bash - > /usr/bin/svn -q ci --username pootle --password -m "Automatic > updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project1/* > /usr/bin/svn -q ci --username pootle --password -m "Automatic > updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project2/* > /usr/bin/svn -q ci --username pootle --password -m "Automatic > updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project3/* > > In our system we have implemented two svn repositories. One for PO > translated files, and one only for Templates. Each repo has anonymous > access for checkout and update, but authenticated for import and commit. > > Because pootle has not yet a way to upload templates, we can do through > SVN and other cron script. > > Follow is the templates script, that run an update from svn to pootle > templates. > > SVN-UP-TMPL > > #!/bin/bash - > /usr/bin/svn -q update > /usr/lib/python2.4/site-packages/Pootle/po/project1/templates > /usr/bin/svn -q update > /usr/lib/python2.4/site-packages/Pootle/po/project2/templates > /usr/bin/svn -q update > /usr/lib/python2.4/site-packages/Pootle/po/project3/templates > > Now, because we can't give admin access to users for run "Update from > templates" or "Update languages" from pootle web admin inteface, we also > make another script to run this: > > UPDATE-PO-FROM-TMPL > > #!/bin/bash > > lup=/tmp/langupd > mkdir $lup > #BASE=pootleLang > BASE=/usr/lib/python2.4/site-packages/Pootle/po/ > > cd $BASE > #echo `pwd` > > for project in project1 project2 project3 > do > > cd $project > #echo `pwd` > > for dir in `ls -I templates` > do > > #echo $dir > mkdir $lup/$dir > cp -r $dir/*.po $lup/$dir > /usr/bin/python2.4 /usr/bin/pot2po --progress=none -t $lup/$dir > templates $dir > rm -rf $lup/$dir > > done > cd .. > > done > rm -rf $lup > > Finally we make a script to add new files to repository. This is because > if you have upload (add + commit) a new template to svn, then this > template is parsed through all languages PO files with the above script, > generating new files (if this is the cace) or modifying. But this new PO > file is not added to the PO repo. The follow is the script to add new > files to PO repo from Pootle PO files. > > SVN-ADD-PO > > #!/bin/bash > > poadd="/tmp/svnadd" > > echo "#!/bin/bash" > $poadd > echo "" >> $poadd > svn status /usr/lib/python2.4/site-packages/Pootle/po/project1/??/*.po > |grep ? >> $poadd > perl -pi -e 's/\? /svn add -q/g' $poadd > chmod 755 $poadd > $poadd > rm -f $poadd > > echo "#!/bin/bash" > $poadd > echo "" >> $poadd > svn status /usr/lib/python2.4/site-packages/Pootle/po/project2/??/*.po > |grep ? >> $poadd > perl -pi -e 's/\? /svn add -q/g' $poadd > chmod 755 $poadd > $poadd > rm -f $poadd > > echo "#!/bin/bash" > $poadd > echo "" >> $poadd > svn status /usr/lib/python2.4/site-packages/Pootle/po/project3/??/*.po > |grep ? >> $poadd > perl -pi -e 's/\? /svn add -q/g' $poadd > chmod 755 $poadd > $poadd > rm -f $poadd > > > It i better if I use for-do-done :) > > Run these scripts once an hour. I was made a mistake running every 5 or > 6 minutes and at some time two or more scripts overlap and make locked > repo, generatin lock errors from svn. > > We will try to refine these scripts, and publish them. > > Thanks again for all your replies. > > regards, Normando > > > > F Wolff escribió: > >> Op Vrydag 2008-02-29 skryf Miklos Vajna: >> >> >>> On Fri, Feb 29, 2008 at 07:19:05AM +0100, Christian Perrier <[EMAIL >>> PROTECTED]> wrote: >>> >>> > I want to make commit from command line. I can make commits through cron > scripts, but I want through pootle, because add a message about > translator and translated strings. > > Is this possible? > > As far as I know, no. This is something we also need for Debian's experimental Pootle server. >>> hmm. i think it's good to force users to commit manually, so that you >>> can run 'git blame' (or other similar command for other vcses) to see >>> who committed for example a mistake. if you do anonymous commits, then >>> you can't blame anybody when a bug is found. >>> >>> >> Well, the Last-Translator header field helps a little bit, and if people >> commit manual
Re: [translate-pootle] Make commits from command line
Thank you Friedel, Miklos, Lars, and Christian for your helpful advices. We implement a cron auto-commit script to make the commits without force user to make this. This is because in the future we implement an automatic system to make patchs and rpms automatically, so yet at testing only. I will try to add a message log from pocount and last username translator, via -F commit option. For those are interested in the script, here I add a dirty non refined script, the same we are using now. SVN-CI-PO #!/bin/bash - /usr/bin/svn -q ci --username pootle --password -m "Automatic updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project1/* /usr/bin/svn -q ci --username pootle --password -m "Automatic updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project2/* /usr/bin/svn -q ci --username pootle --password -m "Automatic updating from Pootle" /usr/lib/python2.4/site-packages/Pootle/po/project3/* In our system we have implemented two svn repositories. One for PO translated files, and one only for Templates. Each repo has anonymous access for checkout and update, but authenticated for import and commit. Because pootle has not yet a way to upload templates, we can do through SVN and other cron script. Follow is the templates script, that run an update from svn to pootle templates. SVN-UP-TMPL #!/bin/bash - /usr/bin/svn -q update /usr/lib/python2.4/site-packages/Pootle/po/project1/templates /usr/bin/svn -q update /usr/lib/python2.4/site-packages/Pootle/po/project2/templates /usr/bin/svn -q update /usr/lib/python2.4/site-packages/Pootle/po/project3/templates Now, because we can't give admin access to users for run "Update from templates" or "Update languages" from pootle web admin inteface, we also make another script to run this: UPDATE-PO-FROM-TMPL #!/bin/bash lup=/tmp/langupd mkdir $lup #BASE=pootleLang BASE=/usr/lib/python2.4/site-packages/Pootle/po/ cd $BASE #echo `pwd` for project in project1 project2 project3 do cd $project #echo `pwd` for dir in `ls -I templates` do #echo $dir mkdir $lup/$dir cp -r $dir/*.po $lup/$dir /usr/bin/python2.4 /usr/bin/pot2po --progress=none -t $lup/$dir templates $dir rm -rf $lup/$dir done cd .. done rm -rf $lup Finally we make a script to add new files to repository. This is because if you have upload (add + commit) a new template to svn, then this template is parsed through all languages PO files with the above script, generating new files (if this is the cace) or modifying. But this new PO file is not added to the PO repo. The follow is the script to add new files to PO repo from Pootle PO files. SVN-ADD-PO #!/bin/bash poadd="/tmp/svnadd" echo "#!/bin/bash" > $poadd echo "" >> $poadd svn status /usr/lib/python2.4/site-packages/Pootle/po/project1/??/*.po |grep ? >> $poadd perl -pi -e 's/\? /svn add -q/g' $poadd chmod 755 $poadd $poadd rm -f $poadd echo "#!/bin/bash" > $poadd echo "" >> $poadd svn status /usr/lib/python2.4/site-packages/Pootle/po/project2/??/*.po |grep ? >> $poadd perl -pi -e 's/\? /svn add -q/g' $poadd chmod 755 $poadd $poadd rm -f $poadd echo "#!/bin/bash" > $poadd echo "" >> $poadd svn status /usr/lib/python2.4/site-packages/Pootle/po/project3/??/*.po |grep ? >> $poadd perl -pi -e 's/\? /svn add -q/g' $poadd chmod 755 $poadd $poadd rm -f $poadd It i better if I use for-do-done :) Run these scripts once an hour. I was made a mistake running every 5 or 6 minutes and at some time two or more scripts overlap and make locked repo, generatin lock errors from svn. We will try to refine these scripts, and publish them. Thanks again for all your replies. regards, Normando F Wolff escribió: > Op Vrydag 2008-02-29 skryf Miklos Vajna: > >> On Fri, Feb 29, 2008 at 07:19:05AM +0100, Christian Perrier <[EMAIL >> PROTECTED]> wrote: >> I want to make commit from command line. I can make commits through cron scripts, but I want through pootle, because add a message about translator and translated strings. Is this possible? >>> As far as I know, no. >>> >>> This is something we also need for Debian's experimental Pootle >>> server. >>> >> hmm. i think it's good to force users to commit manually, so that you >> can run 'git blame' (or other similar command for other vcses) to see >> who committed for example a mistake. if you do anonymous commits, then >> you can't blame anybody when a bug is found. >> > > > Well, the Last-Translator header field helps a little bit, and if people > commit manually, that can also help. In XLIFF files, you might be able > to store all sorts of interesting meta information (like who, when, > etc.), but the tool support is not really there yet. > > I guess the support provided by Pootle is really meant for cases where > we want to give VCS access to more people that might not know or care > about the differences. And of course, no extra accounts necessary, as >
Re: [translate-pootle] Make commits from command line
Op Vrydag 2008-02-29 skryf Miklos Vajna: > On Fri, Feb 29, 2008 at 07:19:05AM +0100, Christian Perrier <[EMAIL > PROTECTED]> wrote: > > > I want to make commit from command line. I can make commits through cron > > > scripts, but I want through pootle, because add a message about > > > translator and translated strings. > > > > > > Is this possible? > > > > > > As far as I know, no. > > > > This is something we also need for Debian's experimental Pootle > > server. > > hmm. i think it's good to force users to commit manually, so that you > can run 'git blame' (or other similar command for other vcses) to see > who committed for example a mistake. if you do anonymous commits, then > you can't blame anybody when a bug is found. Well, the Last-Translator header field helps a little bit, and if people commit manually, that can also help. In XLIFF files, you might be able to store all sorts of interesting meta information (like who, when, etc.), but the tool support is not really there yet. I guess the support provided by Pootle is really meant for cases where we want to give VCS access to more people that might not know or care about the differences. And of course, no extra accounts necessary, as the Pootle accounts are used. It is not ideal for everything, but solves some problems for some people. People who want to script commits from the server / cron can still do that, and it won't interfere with Pootle as long as it was working in the first place (non-interactive authentication). Friedel - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Translate-pootle mailing list Translate-pootle@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/translate-pootle
Re: [translate-pootle] Make commits from command line
On Fri, Feb 29, 2008 at 07:19:05AM +0100, Christian Perrier <[EMAIL PROTECTED]> wrote: > > I want to make commit from command line. I can make commits through cron > > scripts, but I want through pootle, because add a message about > > translator and translated strings. > > > > Is this possible? > > > As far as I know, no. > > This is something we also need for Debian's experimental Pootle > server. hmm. i think it's good to force users to commit manually, so that you can run 'git blame' (or other similar command for other vcses) to see who committed for example a mistake. if you do anonymous commits, then you can't blame anybody when a bug is found. - VMiklos pgpNmJ6GjRosU.pgp Description: PGP signature - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Translate-pootle mailing list Translate-pootle@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/translate-pootle
Re: [translate-pootle] Make commits from command line
Hi Normando, > I want to make commit from command line. I can make commits through cron > scripts, but I want through pootle, because add a message about > translator and translated strings. I am not sure, if you want to do the commits via command line or via pootle. For command line: make sure, that you use the appropriate system user (e.g. "pootle") to avoid trouble with file permissions and ownership. For commits via the pootle web interface take a look at: http://translate.sourceforge.net/wiki/pootle/version_control http://translate.sourceforge.net/wiki/pootle/permissions I hope this helps, Lars - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Translate-pootle mailing list Translate-pootle@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/translate-pootle
Re: [translate-pootle] Make commits from command line
Quoting Normando Hall ([EMAIL PROTECTED]): > Hello again :) > > I want to make commit from command line. I can make commits through cron > scripts, but I want through pootle, because add a message about > translator and translated strings. > > Is this possible? As far as I know, no. This is something we also need for Debian's experimental Pootle server. If someone is able to work on this, that would rock. The same stands for Pootle updates from the command-line which you mentioend earlier. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Translate-pootle mailing list Translate-pootle@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/translate-pootle
Re: [translate-pootle] Make commits from command line
Op Vrydag 2008-02-29 skryf Normando Hall: > Hello again :) > > I want to make commit from command line. I can make commits through cron > scripts, but I want through pootle, because add a message about > translator and translated strings. > > Is this possible? I don't know if you will easily get exactly what you want, but a lot of the information you want is available as the output from a command like pocount from the Translate Toolkit: http://translate.sourceforge.net/wiki/toolkit/pocount It will give you lots of useful output, that you might just want to put into a file and commit with something like "cvs/svn commit -F tmpfile_with_commit_message " or something similar of your version control system. You can get similar information from 'msgfmt -v' from the gettext package, although not as detailed. I hope this helps. Groete Friedel - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Translate-pootle mailing list Translate-pootle@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/translate-pootle