Path of the Handbrake language file

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Path of the Handbrake language file

Post by Casper1968 »

Hello .. I would like to ask you the Handbrake program where you have the language file path in linux mint 19.1. I ask it because I'm going to help translate the program and I want to see how it looks.
That is, I want to change the language file to see how it is going.

Thank you
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Path of the Handbrake language file

Post by BradleyS »

Hi, please read the Translation section at https://handbrake.fr/docs/en/1.2.0/cont ... ibute.html. Thanks for helping out.
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hello .. thank you for answering ... but that is not what I need to know ... I am already in the Transifex translation group and I am already translating .. what I want is to know where is the handbrake language file in linux mint. .to change it and see how the translations are going.
Somewhere in linux should be the path of that file, right?
Thank you
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Path of the Handbrake language file

Post by JohnAStebbins »

In the source tree, the language translation files are in gtk/po. These are the output produced by the Transifex project and should not be edited directly.

To generate the pot file (po template), first build HandBrake, then

Code: Select all

cd build/gtk/po
make ghb.pot
ghb.pot will be built in that directory. This is the file you start from when generating new translations. I've never done it but I assume this is uploaded to Transifex somehow and all translations start from this file. Use Transifex so that your work can be reviewed and others can help with translation.

The files that are actually used by the executable to provide localized UI to the user get installed in /usr/share/locale/$lang/LC_MESSAGES/ where $lang is 'en_US' for U.S. English translation. They have a 'gmo' extension (e.g. ghb.gmo).
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hello John, as I said I am in the transifex group..alli I can translate online handbrake. I can do it from transifex directly or by downloading a .po file (like you comment) and edit it with the program poedit, save it and compile it with this program (when saving it generates the file) and then upload it already translated to Transifex. in this way I see how it will be left hand brake translated (I will translate from English to Spanish (Spain)). From there to want to know where to copy and paste that .mo file to see how it is handbrake. since the length of the texts in English is not the same as in Spanish. I have searched the routes that you have put me, but I do not find gtk / po any in my pc and the other routes I do not find said file that you say and I have installed handbrake 1.2.1 via Flakpat I remember.
To say that in linux I am new although I have been using it for a while.
Thanks for everything
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Path of the Handbrake language file

Post by JohnAStebbins »

I gave slightly incorrect information. When installing the files they get renamed with the 'mo' extension. So my final paragraph above should have been...

The files that are actually used by the executable to provide localized UI to the user get installed in /usr/share/locale/$lang/LC_MESSAGES/ where $lang is 'en_US' for U.S. English translation. They have a 'mo' extension (e.g. ghb.mo)

This assumes you set the install prefix during configure to '/usr' which is not the default. The default is '/usr/local'. So if you are building and installing HandBrake from source, you may have installed the 'mo' files to /usr/local/share/locale/$lang/LC_MESSAGES/
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hi John, I think we do not understand each other. I am not translating the original source file (handbrake) but a file provided in transifex by the handbrake team. This file can be translated on the internet from the transifex website or downloaded from transifex the .po file facilitated to translate it with the Poedit program and then upload it to transifex.
The problem is that I do not know where the original source .mo file is (handbrake) to change it and see how I carry the translation.
the path that indicates / usr / share / locale / en_US / LC_MESSAGES / here I only have one file called compiz.mo. My Linux distro is in Spanish, I have also looked at the same route provided by you but in the folders it is, es_ES, es_CO, es_AR and that file ghb.mo is not.
Hence, ask for the file.
Thanks again for the inconvenience ... is that the translation would be a bit blind.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Path of the Handbrake language file

Post by JohnAStebbins »

You don't change mo files. Let me describe the process as I understand it (I'm not a translator, I am only familiar with the build process). The process starts with the 'pot' file. This is generated by first building HandBrake, then:

Code: Select all

cd build/gtk/po
make ghb.pot
A translator then copies this 'pot' file to a 'po' file and fills in the translation strings.

To view the translations in HandBrake, the 'mo' file must be generated from the 'po' file. If this is a translation of a language that was not previously supported, the language code needs to be added to gtk/po/LINGUAS. Then the po file needs to be copied to gtk/po/. Then HandBrake must be re-built. Simply running 'make' again in the build directory should do the job. The build will create a 'gmo' file for each supported language in build/gtk/po. Running 'make install' will copy those 'gmo' files to 'mo' files in the directories under $prefix/share/locale/$lang/LC_MESSAGES.
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hello John, a question let's forget for a moment the translation. If you install or someone installs Handbrake on your PC with linux Linux system that is in Spanish. The file needed for handbrake to appear in Spanish ... where is it located? must exist if not only would be seen in English.

Thanks for your time John.

Regards
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Path of the Handbrake language file

Post by JohnAStebbins »

There are a number of variations of Spanish, each has it's own language code, see http://www.localeplanet.com/icu/

Let's use European Spanish as an example. It's code is 'es_ES'. Translations to European Spanish for all installed programs will be in /usr/share/locale/es_ES/LC_MESSAGES/.

When you configure HandBrake with *no* prefix option, then build and install HandBrake, e.g.

Code: Select all

cd HandBrake
configure
cd build
make
sudo make install
HandBrake and all it's associated files will be installed to /usr/local/*. So in this case *HandBrake's* 'mo' file would be installed to /usr/local/share/locale/es_ES/LC_MESSAGES/.

If you want HandBrake to be installed to /usr like all other programs that you install from your distributions repository, you must add the '--prefix=/usr' option to configure. e.g.

Code: Select all

cd HandBrake
configure --prefix=/usr
cd build
make
sudo make install
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hello John, I thought about uninstalling Handbrake and installing it again. I have always installed it from the Software Manager. How would you have to do it to install it from the terminal and install it in / usr / and you can see that .mo file ?. You could put me the steps that I would have to put via terminal.

Thank you
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Path of the Handbrake language file

Post by mduell »

Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hi. I have tried the information that you give me .. but I am not an expert in linux .. I have installed git and given the order of git clone ... that appears and creates a folder of handbrake where it appears the files that John told me. .but of course this handbrake is not installed .. I have tried to continue putting the orders that appear there ... but it gives errors I do not know what it does.
thank you for your time I leave it seems to me a lot of mess to just copy and replace a file. I will do it blindly from Transifex.

Thanks for your time..
Regards
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

Hi John. Well, it was only to tell you that in this conversation we had from the file ... the file that I was looking for is where you said that only appears in two cases that I comment in case someone is interested.
There are three ways to install handbrake. through the Software Manager or also Synaptic, through Flakpat and through PPA.
Well the file ghb.mo only appears in the path / usr / share / locale / and the folder of the necessary language if it is installed by means of PPA (latest version) or by software manager (version 1.1.0), if installed by flakpat It does not appear there ... And that's how I did it, that's why I could not find it ... Now I've done it for PPA and solved it.
By the way the translation into Spanish (Spain) is completely done so you know it.

Thanks and regards
Casper1968
Posts: 9
Joined: Fri Apr 12, 2019 6:45 pm

Re: Path of the Handbrake language file

Post by Casper1968 »

I forgot to say that the translation is in Linux
Post Reply