Dňa 14.10.2011 16:08, Sérgio Marques  wrote / napísal(a):
> Hi Milos,
>
> Thanks for Your well done explanation.
>
> Andras said that he could do it so I´m waiting for his response to my post.
> I think it is better to be done by someone that has experience with such
> operations.
>
> But in the meantime I will certainly try Your commands and post an feedback.
>
> In some other posts someone said that it is possible to upload the whole
> directory to pootle but I don´t know how.
>
> Just one more question. If I download whole directory from pootle, when
> unzip it I have a folder with several subfolders. Does Your command work on
> parent folder or do I have to enter in each subfolder and do the command on
> them.
Just that one for all subfolders. The `find . -name \*.po` command does
the trick - it finds all po files in the tree specified by the first
argument to find (. (dot) in this case, meaning "this directory").
Milos
> regards
>
> 2011/10/14 Milos Sramek <sramek.mi...@gmail.com>
>
>> Dňa 13.10.2011 17:49, Sérgio Marques  wrote / napísal(a):
>>> Is there any chance of someone with skills make a bash script to remove
>>> accelerators from translation (msgstr) files?
>> Hi, this seems to be easy:
>>
>> In the topmost directory issue the following command:
>>
>> sed -i.xx '/^msgstr/ s/\~//g' `find . -name \*po`
>>
>>
>> Explanation:
>>
>> find . -name \*po  finds all po files
>> `find . -name \*po`  enters list of these files to the command
>> sed -i does inplace modification, backing up the original file to
>> name.po.xx
>>
>> the command s/\~//g  replaces all ~character by nothing
>> /^msgstr/ allows to do that only on lines, which start by msgstr
>>
>> (you probably do no want to change the English lines and the lines which
>> specify ~ as the accelerator.)
>>
>>
>> Once done, you can check the differences by:
>>
>> for i in `find . -name \*.po`; do diff $i.xx $i >$i.diff; done
>>
>> for each po file, a file with differences is created with the following
>> records:
>> 73c73   .... line number
>> < msgstr "Otvo~riť len na čítanie"   .... input
>> ---
>>> msgstr "Otvoriť len na čítanie"    ..... output
>> If you want to see the ~ characters, use the following before and after
>> deletion
>>
>> grep \~ `find . -name \*.po`
>>
>>
>> While it is easy to get all po files from pootle, I do not know, if it
>> is possible to upload many files at once. Perhaps,  git access is useful
>> to do this.
>>
>> Be careful, always make backups and check the result
>>
>> Enjoy
>> Milos
>>
>>> It would be very usefull.
>>>
>>> 2011/10/13 Andras Timar <tima...@gmail.com>
>>>
>>>> Hi Michael,
>>>>
>>>> 2011/10/12 Michael Bauer <f...@akerbeltz.org>:
>>>>> 2) Accelerators
>>>>> Could these *please* be automated by some dandy piece of script rather
>>>> than
>>>>> the translator spending hours trying to make sure they don't overlap,
>>>> then
>>>>> watching them overlap and spending even more time finding the right one
>>>> and
>>>>> changing it? Surely this can be automated.
>>>>>
>>>> I'll answer to other items later, but this one is easy. Accelerators
>>>> are generated automatically when you omit them from your translation.
>>>> VCL takes care of them so they don't overlap.
>>>>
>>>> Best regards,
>>>> Andras
>>>>
>>>> --
>>>> Unsubscribe instructions: E-mail to l10n+h...@global.libreoffice.org
>>>> Problems?
>>>> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>>>> Posting guidelines + more:
>> http://wiki.documentfoundation.org/Netiquette
>>>> List archive: http://listarchives.libreoffice.org/global/l10n/
>>>> All messages sent to this list will be publicly archived and cannot be
>>>> deleted
>>>>
>>>
>>
>> --
>> email & jabber: sramek.mi...@gmail.com
>>
>>
>> --
>> Unsubscribe instructions: E-mail to l10n+h...@global.libreoffice.org
>> Problems?
>> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
>> List archive: http://listarchives.libreoffice.org/global/l10n/
>> All messages sent to this list will be publicly archived and cannot be
>> deleted
>>
>
>


-- 
email & jabber: sramek.mi...@gmail.com


-- 
Unsubscribe instructions: E-mail to l10n+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/l10n/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to