Re: [translate-pootle] Make commits from command line

2008-03-02 Thread Normando Hall
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

2008-03-02 Thread Normando Hall
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] Pootle wrap msgstr string

2008-03-02 Thread Normando Hall
Thanks Dwayne for your information.
I was installed Pootle 1.0.2 and there are no differences, also break lines.
We have you you suggest method with msgcat and run perfectly.

regards, Normando

Dwayne Bailey escribió:
> Thanks Normando, let us know if the solutions work.  I have added a
> bug[1] which you can use to report your findings or to check on
> progress.
>
> [1] http://bugs.wordforge.org/show_bug.cgi?id=340
>
> On Fri, 2008-02-29 at 00:07 -0200, Normando Hall wrote:
>   
>> Hi Dwayne
>>
>> Thank you very much for your advices.
>> I can't remember very well, but I think pootle 1.0.2 not break the 
>> lines, I think.
>>
>> I will install again Pootle 1.0.2 in a test server and will comment the 
>> results.
>>
>> Thanks
>>
>> Dwayne Bailey escribió:
>> 
>>> Hi Normando,
>>>
>>> Do you mean that the PO that you are translating has some entries that
>>> must not be unwrapped and that Pootle is wrapping these?
>>>
>>> I don't think our Python PO parser will respect the '#, no-wrap' marker
>>> if its is present.  You can try the experimental C based parser by
>>> running Pootle with USECPO=1 (Note cPO does not correctly free memory so
>>> this will eventually eat all memory)
>>>
>>> If you want to unwrap the lines you can use msgcat with the --nowrap
>>> option which will then unwrap all the entries in the file.
>>>
>>>
>>> On Tue, 2008-02-26 at 16:15 -0200, Normando Hall wrote:
>>>   
>>>   
 Hello.

 I want to no wrap or unwrap the translated strings through Pootle.

 When the msgstr strings is over 80 characters, this line is breack into 
 several lines.
 The translated files must not break these lines, because error.
 What I can do to unwrap the already wraped lines?
 Are there any option I have missed?

 My system has installed:

 Pootle 1.1.0rc1
 Herramientas (Toolkit) de Traducción 1.1.1rc3
 jToolkit 0.7.8
 Kid 0.9.6
 ElementTree 1.2.7
 Python 2.4.2 (#1, Sep 28 2005, 10:25:47) [GCC 3.4.3 20041212 (Red Hat 
 3.4.3-9.EL4)] (on linux2/posix)

 Thank you


 -
 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
 
 


-
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

2008-03-02 Thread Normando Hall
  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
>