Author Topic: How to update translation  (Read 1497 times)

scootergrisen

  • Jr. Member
  • **
  • Posts: 53
How to update translation
« on: November 27, 2016, 10:38:37 PM »
I would like to update the translation (avidemux_da.ts) to newest version.
How do i do that?

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #1 on: November 28, 2016, 07:18:58 AM »
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

Code: [Select]
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)

Code: [Select]
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)

Code: [Select]
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

Code: [Select]
cd ~/avidemux2
bash bootStrap.bash --deb --rebuild

To install generated packages do

Code: [Select]
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

Code: [Select]
git diff avidemux/qt4/i18n/avidemux_da.ts > ~/avidemux-i18n-da-update.patch

scootergrisen

  • Jr. Member
  • **
  • Posts: 53
Re: How to update translation
« Reply #2 on: November 30, 2016, 10:16:24 PM »
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

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #3 on: November 30, 2016, 10:28:01 PM »
That seems easy... not  :o

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

Quote
Are 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

  • Jr. Member
  • **
  • Posts: 53
Re: How to update translation
« Reply #4 on: December 01, 2016, 12:00:38 AM »
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

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #5 on: December 01, 2016, 12:42:20 AM »
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

  • Jr. Member
  • **
  • Posts: 53
Re: How to update translation
« Reply #6 on: December 01, 2016, 12:36:02 PM »
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

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #7 on: December 01, 2016, 04:43:23 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.

Quote
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.

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 ;)

Quote
I 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.

Quote
I 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

  • Jr. Member
  • **
  • Posts: 53
Re: How to update translation
« Reply #8 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?
Are you sure lrealease is used to update files? It says its for converting TS file into QM file.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #9 on: December 02, 2016, 04:58:25 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.

Quote
Are 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

  • Jr. Member
  • **
  • Posts: 53
Re: How to update translation
« Reply #10 on: December 06, 2016, 01:37:31 PM »
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

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #11 on: December 06, 2016, 10:35:36 PM »
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

  • Jr. Member
  • **
  • Posts: 53
Re: How to update translation
« Reply #12 on: December 07, 2016, 05:44:50 AM »
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

  • Hero Member
  • *****
  • Posts: 1165
Re: How to update translation
« Reply #13 on: December 07, 2016, 09:21:19 AM »
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.