[Mythtv-translators] Empty translations/plurals...

ikke ikke at iki.fi
Thu Apr 12 05:14:55 UTC 2012


On Thu, Apr 12, 2012 at 3:38 AM, Nicolas Riendeau <nriendeau at mythtv.org> wrote:
> grep -C3 'translation></translation' *_fi.ts
> grep -C3 '<numerusform></numerusform>' *_fi.ts

Thanks. O'h, I used grep to do it. I used similar than that, but you
need to escape '/' sign.

I was thinking I could anyway share some useful commands on the wiki
page for translation. I used some of these heavily while doing
translations, I'll CC the translation list in case it would be useful
for someone else too:


#to start the job:
git branch finnish
find . -name '*_fi.ts' | while read name ; do pushd `dirname $name` ;
lupdate absolute translate.pro; popd; done

# I open all files just to get all strings into suggestion box
find . -name '*_fi.ts' | xargs linguist

# do updates, and to fix things you mentioned
# those files can be edited rather fast with vim keybindings
find . -name '*_fi.ts' | xargs grep 'numerusform><\/numerusform>'
find . -name '*_fi.ts' | xargs grep 'translation><\/translation>'

# Update stuff which was committed to master in between
# probably could have done with less commands, I don't use git that much...
git checkout master
git pull
git checkokut finnish
git merge master

# Update again the translations
find . -name '*_fi.ts' | while read name ; do pushd `dirname $name` ;
lupdate absolute translate.pro; popd; done

# after done editing, release the stuff into .qm files
find . -name '*_fi.ts' | while read name ; do pushd `dirname $name` ;
lrelease translate.pro; popd; done

# and clean up the codeline references to keep patch clean
# IMO this should be required, it easens finding the real changes in diffs
# and in case there would be someone reviewing the changes, it is better to
# do this way...
find . -name '*_fi.ts' | while read name ; do pushd `dirname $name` ;
lupdate none translate.pro; popd; done

# and for the patch I merge stuff back to master, not really needed
find . -name '*_fi.ts' | xargs git commit -m "Finnish translations"
git checkout master
git pull finnish

# and finally do the patch
find . -name '*_fi.ts' | xargs git diff origin/master >finnish-25.patch

I rewrote the commands into mail, there might be something I missed or
typoed, but hopefully not too much :)

BR,

ikke


More information about the Mythtv-translators mailing list