News:

--

Main Menu

How to update translation

Started by scootergrisen, November 27, 2016, 10:38:37 PM

Previous topic - Next topic

scootergrisen

I would like to update the translation (avidemux_da.ts) to newest version.
How do i do that?

eumagga0x2a

The most comfortable and safe in the sense of quality way is to setup a build environment on Linux, e.g. Lubuntu 16.04. An installation in a VM of your liking suffices, then in case of *ubuntu 16.04 in your home directory do

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git vim
git clone https://github.com/mean00/avidemux2.git


(you've got the source)

cd ~/avidemux2
git branch i18n-da-updates
git checkout i18n-da-updates


(you've created a branch you will work on and switched to this branch)

bash createDebFromSourceUbuntu.bash

(this step installs build dependencies, compiles and installs Avidemux with /usr as prefix; the dependencies are important, not the installation)

You can rebuild any time with

cd ~/avidemux2
bash bootStrap.bash --deb --rebuild


To install generated packages do

cd ~/avidemux2/debs
sudo dpkg -i *.deb


Now you have everything to build Avidemux yourself, make changes with vim and test them. As long as you haven't committed your changes, you generate a patch "~/avidemux-i18n-da-update.patch" e.g. by running

git diff avidemux/qt4/i18n/avidemux_da.ts > ~/avidemux-i18n-da-update.patch

scootergrisen

That seems easy... not  :o
Are there no easy way to just update my translation file without having to dowload the intire source and build the software?

eumagga0x2a

Quote from: scootergrisen on November 30, 2016, 10:16:24 PM
That seems easy... not  :o

That is easy, far easier than any other way to work on translation.

QuoteAre there no easy way to just update my translation file without having to dowload the intire source and build the software?

Of course you can always download just the avidemux_da.ts file: https://raw.githubusercontent.com/mean00/avidemux2/master/avidemux/qt4/i18n/avidemux_da.ts. But how are you going to test that your translation is correct, fits into the context and doesn't break things?

Last but not least, git is very handy for generating patches.

scootergrisen

Ok i guess i will give it a try.
But could you or someone make a page or something that tells people how to contribute translations and update them and test them and so on like some other software have. They often have a CONTRIBUTE menu where people can read how to help translate.

eumagga0x2a

I wholeheartedly agree that this would be helpful. On the other hand, is it not totally obvious that one needs the source and the build environment to work on a software project? "Some other software" are usually much bigger projects as Avidemux, which is basically driven by a single person, a couple of occasional external contributors notwithstanding.

scootergrisen

I translate mostly software that uses PO files so i am more used to that.
If you look from a translators perspective i dont really need the entire source just because i want to update the translation.
With PO files i just need to get the latest POT file and run "msgmerge --verbose --update x.da.po x.pot" to update my PO file.

I just had some bad experience with building on Debian because of dependencies and versions and installing in /usr/ gave problems i think.
So i try to do it in VirtualBox so i don't mess up my system again.

I think the easier/attractive you make it for translators the more people would be interesting in translating.

eumagga0x2a

Quote from: scootergrisen on December 01, 2016, 12:36:02 PM
I translate mostly software that uses PO files so i am more used to that.

Well, Avidemux probably won't switch to GTK, so no .po files here.

QuoteIf you look from a translators perspective i dont really need the entire source just because i want to update the translation.
With PO files i just need to get the latest POT file and run "msgmerge --verbose --update x.da.po x.pot" to update my PO file.

You can do the same with lrelease (lrealease-qt5 on Fedora) and .ts files. You need the source and build environment to generate patches in an easy way and a better QA. Last but not least, it is much faster to grep local files if you want to verify that a translation really reflects what the code says and not what the English string you are translating suggests ;)

QuoteI just had some bad experience with building on Debian because of dependencies and versions and installing in /usr/ gave problems i think.

I've opened a pull request https://github.com/mean00/avidemux2/pull/50 for a couple of enhancements to the simple Ubuntu build script which will allow installing to /usr/local e.g. or just installing the dependencies.

QuoteI think the easier/attractive you make it for translators the more people would be interesting in translating.

Sure. Please take into account that I started to contribute to Avidemux in summer 2016 with zero knowledge in C++ and no translator experience. Both my time and my abilities to move things are very limited.

scootergrisen

So do i copy my avidemux_da.ts with changes into i18n/translations and then build to update the avidemux_da.ts file?
Are you sure lrealease is used to update files? It says its for converting TS file into QM file.

eumagga0x2a

Quote from: scootergrisen on December 02, 2016, 01:27:39 PM
So do i copy my avidemux_da.ts with changes into i18n/translations and then build to update the avidemux_da.ts file?

I personally prefer to edit the file in-place on a git branch. From time to time you generate a patch under a different name in case you make a bigger mistake and have to discard your changes. Git allows to delete a file and to checkout it again in pristine form at any moment.

To test the changes, it is in most cases enough just to replace the avidemux_da.qm file in $PREFIX/share/avidemux6/qt5/i18n with the .qm file generated by lrelease from the avidemux_da.ts file. You need an Avidemux build from the current git to do that, of course, that is why it is handy to have a full build environment at your disposal.

QuoteAre you sure lrealease is used to update files? It says its for converting TS file into QM file.

lrelease will generate .qm files out of provided .ts files. If there is already a matching .qm file in the same location, this .qm file will be updated.

scootergrisen

I don't have libpng12-dev. Can't see it with apt-get.
I can see libpng12-0 and libpng-dev and libpng++-dev.

eumagga0x2a

The script createDebFromSourceUbuntu.bash is very much focused on Ubuntu. Building with libpng 1.6 as in stretch or sid should not pose a problem, just replace libpng12-dev at line 26 with libpng-dev

scootergrisen

The following packages have unmet dependencies:
libdca-dev : Depends: libdca0 (= 0.0.5-dmo2) but 0.0.5-dmo2+deb8u1 is to be installed
libfaac-dev : Depends: libfaac0 (= 1:1.28-dmo3) but 1:1.28-dmo3+deb8u1 is to be installed

eumagga0x2a

Version conflicts within the debian-multimedia repository is not something that can be caught in the simple Ubuntu Avidemux build script.

In this case you could try to download and install matching packages from https://www.deb-multimedia.org/pool/main/libd/libdca-dmo/libdca-dmo manually or build them from source and delete from the list of deps in the script. Once all deps are there (not necessarily as packages, the LFS way to do things is possible as well and on Debian sometimes preferable) you can and should use bootStrap.bash directly.