How to compile language pack only with files from pootle?

Hi.

I'm compiling libreoffice 6 on ubuntu for checking my new (korean)
translation.
However, it takes forever--it's running for 6 hours so far.

Q1. Is there a way to compile a language pack only?
I use ubuntu 16.04, x64

Q2. How to compile language pack with files from pootle, not from gerrit?
while compiling, the script downloaded translation source from gerrit.
But I want to use my newest translation which is on pootle.
I guess I might have to change Makefile, but I'm not sure where and how.
probably somewhere around 240th line, 'get-submodules:'
Should I just comment the line 'cd $(SRCDIR) && ./g -f clone' and copy my
po files into the directory before starting to compile?
It could work but I think it will make another problem since that part is
not only about translation, but also other submodules.

I hope someone has the answers to these.
thanks all.

Hi.
I'm a Japanese translation volunteer, remember that I'm not a programmer, not a engineer.

If you have built LibreOffice from the source and your purpose is checking your translation, I can show you my way:
1. Download .po files which you want check from Pootle.
2. remove comments from the .po files.
3. copy the .po files to proper place, the places under "tanslation/source/ko/**".
4. If names of the .po files are not "messages.po", do 'make build-l10n-only'.
5. If a name of the .po files is "messages.po", do "msgfmt -o instdir/program/resource/ko/LC_MESSAGES/MOFILE DIR/messages.po". The relations of DIRs and MOFILEs are as follows:
    accessibility/messages.po: acc.mo
    avmedia/messages.po: avmedia.mo
    basctl/messages.po: basctl.mo
    chart2/messages.po: chart.mo
    connectivity/messages.po: cnr.mo
    cui/messages.po: cui.mo
    dbaccess/messages.po: dba.mo
    desktop/messages.po: dkt.mo
    editeng/messages.po: editeng.mo
    filter/messages.po: flt.mo
    formula/messages.po: for.mo
    fpicker/messages.po: fps.mo
    forms/messages.po: frm.mo
    framework/messages.po: fwk.mo
    extensions/messages.po: pcr.mo
    reportdesign/messages.po: rpt.mo
    basic/messages.po: sb.mo
    sc/messages.po: sc.mo
    scaddins/messages.po: sca.mo
    sccomp/messages.po: scc.mo
    sd/messages.po: sd.mo
    sfx2/messages.po: sfx.mo
    starmath/messages.po: sm.mo
    svl/messages.po: svl.mo
    svtools/messages.po: svt.mo
    svx/messages.po: svx.mo
    sw/messages.po: sw.mo
    uui/messages.po: uui.mo
    vcl/messages.po: vcl.mo
    wizards/messages.po: wiz.mo
    writerperfect/messages.po: wpt.mo
    xmlsecurity/messages.po: xsc.mo

If you would like to build LibreOffice-master and check the translation, you may need "make translations" and to merge .po file with the .pot files.

Hi, Kiyotaka Nishibori

I followed your instructions.
It works well. Now I can check my translations in few mins.

Thank you very much.

FYI, my process was

*1. Download Libreoffice source*
$ git clone git://anongit.freedesktop.org/libreoffice/core libreoffice
$ cd libreoffice

*2. Build libreoffice with languagepack option*
$ ./autogen.sh --with-lang="ko"
$ make
$ sudo make install (I'm not sure whether this is needed, or not)

*3. Download po files from Pootle and extract to relevant directories.*
$ cp -R ko/libo_ui/* libreoffice/translations/source/ko/

*4. Build l10n only*
$ make build-l10n-only

*5. Convert po files to mo using msgfmt*
msgfmt translations/source/ko/accessibility/messages.po -o
./instdir/program/resource/ko/LC_MESSAGES/acc.mo
.. so on

*6. Install again*
$ sudo make install

Hi, Kiyotaka Nishibori

I followed your instructions.
It works well. Now I can check my translations in few mins.

Thank you very much.

FYI, my process was

*1. Download Libreoffice source*
$ git clone git://anongit.freedesktop.org/libreoffice/core libreoffice
$ cd libreoffice

*2. Build libreoffice with languagepack option*
$ ./autogen.sh --with-lang="ko"
$ make
$ sudo make install (I'm not sure whether this is needed, or not)

*3. Download po files from Pootle and extract to relevant directories.*
$ cp -R ko/libo_ui/* libreoffice/translations/source/ko/

*4. Build l10n only*
$ make build-l10n-only

*5. Convert po files to mo using msgfmt*
msgfmt translations/source/ko/accessibility/messages.po -o
./instdir/program/resource/ko/LC_MESSAGES/acc.mo
.. so on

*6. Install again*
$ sudo make install

Think that shouldn't that be added to

https://wiki.documentfoundation.org/Development/BuildingOnLinux

as massages here are not so googlable as wiki pages.

Kruno

Hi, Kiyotaka Nishibori

I followed your instructions.
It works well. Now I can check my translations in few mins.

Thank you very much.

FYI, my process was

*1. Download Libreoffice source*
$ git clone git://anongit.freedesktop.org/libreoffice/core libreoffice
$ cd libreoffice

*2. Build libreoffice with languagepack option*
$ ./autogen.sh --with-lang="ko"
$ make
$ sudo make install (I'm not sure whether this is needed, or not)

*3. Download po files from Pootle and extract to relevant directories.*
$ cp -R ko/libo_ui/* libreoffice/translations/source/ko/

*4. Build l10n only*
$ make build-l10n-only

*5. Convert po files to mo using msgfmt*
msgfmt translations/source/ko/accessibility/messages.po -o
./instdir/program/resource/ko/LC_MESSAGES/acc.mo
.. so on

*6. Install again*
$ sudo make install

Think that shouldn't that be added to

Wanted to say 'Shouldn't that be added to [...]'

Kruno

Will do later today.

Kruno

Hi, Kruno.

Please add this as well.

For local Help pack,

in step 2,
$ ./autogen.sh --with-help --with-lang="ko"

in step 3,
(for Help)
$ \cp -fR ko/libo_help/*
libreoffice/translations/source/ko/helpcontent2/source/text/
$ \mv
libreoffice/translations/source/ko/helpcontent2/source/text/auxiliary.po
libreoffice/translations/source/ko/helpcontent2/source/

Thanks.

Hi, Kruno.

Please add this as well.

For local Help pack,

in step 2,
$ ./autogen.sh --with-help --with-lang="ko"

in step 3,
(for Help)
$ \cp -fR ko/libo_help/* libreoffice/translations/source/ko/helpcontent2/source/text/
$ \mv libreoffice/translations/source/ko/helpcontent2/source/text/auxiliary.po libreoffice/translations/source/ko/helpcontent2/source/

Thanks.

Hi,

I finally added everything to

https://wiki.documentfoundation.org/Development/BuildingOnLinux#Building_translated_user_interface_with_.po_files_from_Pootle

could Kiyotaka and you check everything. I'll edit if needed.

Thanks,
Kruno

Hi,

is there a way to use the already built version (like a master daily build)
and just build the lang-pack without the need of pulling and building the
whole package?

Also, the instructions are not clear about messages.po file names. Current
po file have some name messages.po and others not (like the files in the
dictionaries folder or the officecfg folder). So are you referring to
pre-6.0 po files (no renaming needed, use step 4) and post-5.4 po-files
(use step 5)?

Also, could you publish a rename/move script for all ui and help po files
of the current 6.0 and master tree?

Thanks, m.

Hi,

is there a way to use the already built version (like a master daily build)
and just build the lang-pack without the need of pulling and building the
whole package?

What do you mean by whole package? I don't think language pack is available in master for all languages. Just a handful of them, so pulling from Pootle is necessary.

Also, the instructions are not clear about messages.po file names. Current
po file have some name messages.po and others not (like the files in the
dictionaries folder or the officecfg folder). So are you referring to
pre-6.0 po files (no renaming needed, use step 4) and post-5.4 po-files
(use step 5)?

Wrong person to ask. Instructions are not mine. I commented that this could be valuable information so I was asked to put it in Wiki pages. I did just that. Know it's bit unclear and that's why I asked on this list so instructions can be proofread.

Thank you for that as I still didn't complete this successfully.

Also, could you publish a rename/move script for all ui and help po files
of the current 6.0 and master tree?

I can do that, but firstly we need to figure out the renaming part.

Sorry for not being able to solve this in first go.

Kruno

Hi Martin.

Also, the instructions are not clear about messages.po file names. Current
po file have some name messages.po and others not (like the files in the
dictionaries folder or the officecfg folder). So are you referring to
pre-6.0 po files (no renaming needed, use step 4) and post-5.4 po-files
(use step 5)?

on Pootle
1) some files has the names as messages.po
2) some others has different names.

It has to be treated differently.(I don't know why though)
So..

step 3 is for 1) case
step 5 is for 2) case

I'm not an expert but it works for me(thanks to Kiyotaka). Good luck.

Hi Martin.

Also, the instructions are not clear about messages.po file names. Current
po file have some name messages.po and others not (like the files in the
dictionaries folder or the officecfg folder). So are you referring to
pre-6.0 po files (no renaming needed, use step 4) and post-5.4 po-files
(use step 5)?

on Pootle
1) some files has the names as messages.po
2) some others has different names.

It has to be treated differently.(I don't know why though)
So..

step 3 is for 1) case
step 5 is for 2) case

I'm not an expert but it works for me(thanks to Kiyotaka). Good luck.

That means that when I extract .po files to 'translations' folder in source tree, I need to check if .po files in individual directory is named 'messages.po' or differently.

If name is 'messages.po' then command

msgfmt -o instdir/program/resource/<langCode>/LC_MESSAGES/<mofile> <dir>/messages.po

needs to be run in that particular directory on right side of the table in Wiki page by replacing '<mofile>' in command with information from left side of the table on Wiki page?

After dealing with renaming, command

make build-l10n-only

needs to be run?

If I'm right, then all what's needed is to switch places of fourth and fifth step (and simplify instructions).

Can you, please, confirm this?

Thanks,

Kruno

To Krunose

That means that when I extract .po files to 'translations' folder in source
tree, I need to check if .po files in individual directory is named
'messages.po' or differently.

If name is 'messages.po' then command

    msgfmt -o instdir/program/resource/<langCode>/LC_MESSAGES/<mofile>
<dir>/messages.po

needs to be run in that particular directory on right side of the table in
Wiki page by replacing '<mofile>' in command with information from left side
of the table on Wiki page?

Basically "Yes", but you don't have to check every directories nor po files
because step 3, 5 will do it for you. Of course you have to make a
script for step 5 though.

After dealing with renaming, command

    make build-l10n-only

needs to be run?

Yes. step 4 makes some mo files from po files on step 3, which is not
named as messages.po.
But it doesn't care about messages.po files. So we need step 5.

If I'm right, then all what's needed is to switch places of fourth and fifth
step (and simplify instructions).

I'm not sure about this. The original instruction came from Kiyotaka.
However I guess you're right. It could be switched.
For me, current instructions is good. Because step 3, 4 are dealing
with not 'messages.po' files
and step 5 is about 'messages.po' files.

And you need to add step 6 from my instruction at the end of section on wiki.
"sudo make install"

Those instructions(both of Kiyotaka's and mine) are about building
libreoffice from the source.
I tried just copying .mo files to already installed Libreoffice via
apt, but it didn't work.

Here is my post about this.
http://libreoffice.tistory.com/entry/리브레오피스-도움말-패키지-빌드하기-우분투-1604

To Krunose

That means that when I extract .po files to 'translations' folder in source
tree, I need to check if .po files in individual directory is named
'messages.po' or differently.

If name is 'messages.po' then command

     msgfmt -o instdir/program/resource/<langCode>/LC_MESSAGES/<mofile>
<dir>/messages.po

needs to be run in that particular directory on right side of the table in
Wiki page by replacing '<mofile>' in command with information from left side
of the table on Wiki page?

Basically "Yes", but you don't have to check every directories nor po files
because step 3, 5 will do it for you. Of course you have to make a
script for step 5 though.

After dealing with renaming, command

     make build-l10n-only

needs to be run?

Yes. step 4 makes some mo files from po files on step 3, which is not
named as messages.po.
But it doesn't care about messages.po files. So we need step 5.

If I'm right, then all what's needed is to switch places of fourth and fifth
step (and simplify instructions).

I'm not sure about this. The original instruction came from Kiyotaka.
However I guess you're right. It could be switched.
For me, current instructions is good. Because step 3, 4 are dealing
with not 'messages.po' files
and step 5 is about 'messages.po' files.

And you need to add step 6 from my instruction at the end of section on wiki.
"sudo make install"

Those instructions(both of Kiyotaka's and mine) are about building
libreoffice from the source.
I tried just copying .mo files to already installed Libreoffice via
apt, but it didn't work.

Here is my post about this.
http://libreoffice.tistory.com/entry/리브레오피스-도움말-패키지-빌드하기-우분투-1604

Thanks, I'll update later today.

Seams that problem is not with instructions as with lack of our understanding of the process and directory structure. I'll test and update instructions.

Thanks,

Kruno

To Krunose

That means that when I extract .po files to 'translations' folder in source
tree, I need to check if .po files in individual directory is named
'messages.po' or differently.

If name is 'messages.po' then command

msgfmt -o instdir/program/resource/<langCode>/LC_MESSAGES/<mofile>
<dir>/messages.po

needs to be run in that particular directory on right side of the table in
Wiki page by replacing '<mofile>' in command with information from left side
of the table on Wiki page?

Basically "Yes", but you don't have to check every directories nor po files
because step 3, 5 will do it for you. Of course you have to make a
script for step 5 though.

After dealing with renaming, command

make build-l10n-only

needs to be run?

Yes. step 4 makes some mo files from po files on step 3, which is not
named as messages.po.
But it doesn't care about messages.po files. So we need step 5.

If I'm right, then all what's needed is to switch places of fourth and fifth
step (and simplify instructions).

I'm not sure about this. The original instruction came from Kiyotaka.
However I guess you're right. It could be switched.
For me, current instructions is good. Because step 3, 4 are dealing
with not 'messages.po' files
and step 5 is about 'messages.po' files.

And you need to add step 6 from my instruction at the end of section on wiki.
"sudo make install"

Those instructions(both of Kiyotaka's and mine) are about building
libreoffice from the source.
I tried just copying .mo files to already installed Libreoffice via
apt, but it didn't work.

Here is my post about this.
http://libreoffice.tistory.com/entry/리브레오피스-도움말-패키지-빌드하기-우분투-1604

Thanks, I'll update later today.

Seams that problem is not with instructions as with lack of our understanding of the process and directory structure. I'll test and update instructions.

Thanks,

Kruno

Hi,

I've done my best

https://wiki.documentfoundation.org/Development/BuildingOnLinux#Building_translated_user_interface_with_.po_files_from_Pootle

hope at least somebody will find this helpful.

Kruno

Hi,
I'm sorry I'm late.

I found some new facts about "make build-l10n-only":
1. The command generates a .mo file in workdir/MoTarget if it does not exist here or is older than .po file for the .mo file. The .mo file name is "<DOMAIND><LANG>.mo". <DOMAIN> means final .mo name like 'sc', 'dkt' and so on; for exsample, if <DOMAIN> is 'sc' and <LANG> is 'ja', "make build-l10n-only" generates 'scja.mo' in the directory.

2. Timestamp of a <DOMAIN><LANG>.mo is when the .mo file is generated.

3. THe command copies a workdir/MoTarget/<DOMAIN><LANG>.mo as instdir/program/resource/<LANG>/LC_MESSAGES/<DOMAIN>.mo if the <DOMAIN>.mo does not exist or is older than the <DOMAIN><LANG>.mo.

These things mean that if we remove .mo files from workdir/MoTarget before running "make build-l10n-only", we can get updated .mo file by the command. Could you please reproduce it?

Ofcourse, direct generation of .mo files to instdir/... is also available.

Hi,
I'm sorry I'm late.

I found some new facts about "make build-l10n-only":
1. The command generates a .mo file in workdir/MoTarget if it does not exist here or is older than .po file for the .mo file. The .mo file name is "<DOMAIND><LANG>.mo". <DOMAIN> means final .mo name like 'sc', 'dkt' and so on; for exsample, if <DOMAIN> is 'sc' and <LANG> is 'ja', "make build-l10n-only" generates 'scja.mo' in the directory.

2. Timestamp of a <DOMAIN><LANG>.mo is when the .mo file is generated.

3. THe command copies a workdir/MoTarget/<DOMAIN><LANG>.mo as instdir/program/resource/<LANG>/LC_MESSAGES/<DOMAIN>.mo if the <DOMAIN>.mo does not exist or is older than the <DOMAIN><LANG>.mo.

These things mean that if we remove .mo files from workdir/MoTarget before running "make build-l10n-only", we can get updated .mo file by the command. Could you please reproduce it?

Ofcourse, direct generation of .mo files to instdir/... is also available.
--
Regards,

Kiyotaka

Uh... I don't mind rewriting but I'm not sure where to add this information. Would you mind edit article at

https://wiki.documentfoundation.org/Development/BuildingOnLinux

and send the new version directly to me and all update it.

I would do it myself gladly, but I still need to ask you if I got everything right so I think it would be easier if you edit what's necessary.

Could you do that, please?

Kruno

Sorry, everyone,

I am very confused. I looked into macOS lang-pack and saw what this
required mo building and renaming process produces.

Can someone explain where some existing po files finish after this process
(I am listing them below) - because they contain like 7000 UI strings that
- where do they end up? They do not seem to be contained in the lang-pack
in the mo form (or are they joined with some other po files in the process
and then converted to mo files - which would require some file merging
before mo transformation).

I am especially worried about the
/officecfg/registry/data/org/openoffice/Office/UI.po file.

Thanks, m.