Hi *,
On Thu, Jan 19, 2017 at 3:17 PM, Khaled Hosny <khaledhosny@eglug.org> wrote:
I’m trying to test the latest Arabic translation on a local build from
source, it is enough to download the PO files from Pootle and extract
them to the translation/source/ar/
For UI only yes, help needs a little reshuffling (move into the proper
directory) - also for languages using underscore as delimiter in
pootle, need to rename the directory to use dash instead.
, or are there any post-processing
steps needed?
RE does processing to reduce noise in the diff, most notably removing
the key-ID identifier and getting rid of obsolete strings (but those
aren't exported when using webexport anyway), and using msguniq
--no-wrap to have strings in a single line (if not a block to begin
with)
I just did that and I see lots of comments like “#. eDUKr”
in the files I got from Pootle, not sure of they are harmless.
Should be harmless.
In case you're interested: this is the cleanup RE runs (apart from
also running it with pocheck afterwards)
#!/bin/bash
# run with:
# find $lo_lang_temp/translations/libo*_ui/ -name *.po -print0 | xargs
-r -0 -P4 -I pofile $lo_repos/translation_templated/convertme.sh
pofile
pofile=$1
echo processing $pofile
sed -e '/^#~/d' -e '/^#\. .....\?$/d' -e 's/^#\. ...#:/#:/' -e
'/^#$/d' -e '/^#[^:~,.]/d' $pofile > $pofile.new && msguniq --no-wrap
$pofile.new | sed 's/[ ]*$//' > $pofile && rm -f $pofile.new
So if you want to reduce noise between your changes and what's in the
repo, run the above, and also pocheck:
LD_LIBRARY_PATH=instdir/program make cmd
cmd=workdir/LinkTarget/Executable/pocheck 2>&1 |tee ~/tmp/pocheck.log
Files will still have metadata changes (like the export-date), we
filter those out with:
# add files with actual changes
for file in $(LC_MESSAGES=C git status |awk '/modified/{print $2}' ) ;
do if (git diff -- $file |egrep -m 2 '^[+-](msg(id|str) "[^"]|#,
fuzzy)') ; then git add $file; fi; done
#commit/review those...
# files with possible matches
for file in $(LC_MESSAGES=C git status |awk '/modified/{print $2}' ) ;
do if (git diff -- $file | grep ^[+-][^+-] |grep -v -e
"POT-Creation-Date" -e "X-Generator" -e "X-POOTLE-MTIME" -e "#.
extracted from" -e "PO-Revision-Date:" -e "Last-Translator" -e
'^[+-]"Language: ' -e '^[+-]"Language-Team: ' -e
"Report-Msgid-Bugs-To: " -e "X-Accelerator-Marker: " -e
"Project-Id-Version:" -e "Plural-Forms: " -e "Content-Type:
text/plain; charset=") ; then git add $file; fi; done
# review and commit--amend
# check that nothing was missed
LC_MESSAGES=C git status |awk '/modified/{print $2}' | xargs -r git
diff |grep ^[+-][^+-] |grep -v -e X-POOTLE-MTIME -e "#. extracted from
" -e POT-Creation-Date: -e PO-Revision-Date -e X-Accelerator-Marker -e
X-Generator -e Last-Translator -e '^[+-]"Language: ' -e
'^[+-]"Language-Team: ' -e "Plural-Forms: " -e Report-Msgid-Bugs-To |
sort -u
# if not, clear list - might have to run this multiple times in case
git stubmles over its own lock
LC_MESSAGES=C git status |awk '/modified/{print $2}' | xargs -r git checkout --
beware of linebreaks in all of the commands, the commands themselves
all on one line...
Note that for viewing diff in the repo itself, when using "git diff"
- you could setup a textconv filter that does something similar to the
above, i.e. ignoring all the metadata-headers that don't reflect
actual string change)
sample I have in my local pot repo to do some sanity checking (in
~/.git/config, adapting to po case is left as exercise for the reader
:-P):
[diff "potfile"]
textconv = "sed -e '/POT-Creation-Date/d'"
and corresponding entry in ~/.gitattributes:
*.pot diff=potfile
ciao
Christian
--
To unsubscribe e-mail to: l10n+unsubscribe@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
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.