Invalid Entry in Po Files

Dear All,

After we did a 100%, we decided to change some of owr strings to a new
terminology. As a result I did a "Find and Replace in All Files" using
Sublime Text 2 to change the terms.

After this I started building entire LO,(libreoffice-4-1 branch), but it
failed to include the new terms saying invalid entry like
"git/libowin/translations/source/sid/scp2/source/base.po contains invalid
entry".

What mistake did I do? How may i resolve this?

It's fairly simple, assuming you have the gettext tools installed, if not
just send me the file and I'll scan it for you.

With gettext the command would be: msgfmt -vco /dev/null base.po (in the
same dir of course)

Yaron Shahrabani

<Hebrew translator>

Yes, gettext may help, to find the problem, but the "contains invalid
entry" message come from LO specific po checks. The LO used po has some
additional requirements to meet. If you use Pootle, than this problem don't
come up, but If you intend to use "Find and Replace" in a text editor than
you have to be sure that this replacing touch only the lines started with
"msgstr" and not others.

Best regards,
Tamás

Dear Yaron,

I am still struggling with the 'invalid entry' message during LO build. The
followings are things I have done since you advised me last time:

1) corrected all 'critical errors' suggested
2) Tried to build and failed
3) Uploaded all files to Pootle, corrected all errors suggested by pootle
downloaded the translations and tried to build, not OK
4) Pulled the latest source code from git, switched to master and tried to
build, not OK

I did this on both Win and Ubuntu with same result. When I open the files
in Virtaal I cannot see any problem. What shall I do?

Regards,

Dear Tadele!
Try using Poedit (Any version above 1.5 is fine).

This tool shows the misbehaving strings in red on top of the list after you
save.
This way you can look at the strings that Virtaal will simply ignore upon
saving (Sorry Friedel :relaxed:).

Another great tool I would suggest you to use (mainly in Ubuntu) is
"msgfmt".
After you edit the file just go to the command line and type "msgfmt -vco
/dev/null /path/to/your/file.sid.po" (replace the last part with the actual
file location).

If you don't have the msgfmt tool you'll have to install gettext using the
following command:
sudo apt-get install gettext
You will be asked for your password and then the tool will be installed so
you can use it.

Anyways I'm so glad to see this translation completing so fast.
Good job!

Yaron Shahrabani

<Hebrew translator>

Dear Yaron,

Well I have gettext and in fact I have tried the command you gave me on all
offending files. I have also opened 2 of the files in poedit, and found "no
error". The first file which comes as having invalid entry (during build)
is [1]. I opened that file and compared it to a Hungarian translation using
Meld Diff Viewer. The difference I spotted appeared at the bottom of the
files with many more comments in my file than the Hungarian one. Can that
be a cause?

[1]
https://translations.documentfoundation.org/export/libo_ui/sid/vcl/source/src.po

Hi Tadele,

Meld Diff Viewer. The difference I spotted appeared at the bottom of the
files with many more comments in my file than the Hungarian one. Can that
be a cause?

Yes, it is the cause. Remove those obsolete entries from the end of
the file. As far as I remember, Tamas Zolnai fixed this misbehaviour
in po parser in master and libreoffice-4-1. I guess you are compiling
LibreOffice 4.0.x.

Best regards,
Andras

Yes, I did and so comments at the end of the files doesn't make the parser
to skip strings, but warnings are still alive. It can be helpful to avoid
useless lines from git repository. So these warnings can appear in 4.1 too,
but strings are merged, as long as there are no other problem.
However as I see this is not true.

For example:
msgid "There are no pages to be printed. Please check your document for
ranges relevant to printing."
msgstr ""
"Attamantanno qoolla dino. Eeggatena bortajekki attamote hakkigeeshsha
buuxi."

If the translation doesn't include end line than it have to stand directly
behind msgstr, like this:
msgstr "Attamantanno qoolla dino. Eeggatena bortajekki attamote
hakkigeeshsha buuxi."

Other example (with the same problem):
"msgid "Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without
accessibility support, or click '%CANCEL' to exit %PRODUCTNAME
%PRODUCTVERSION."
msgstr ""
"Click '%OK' to start %PRODUCTNAME %PRODUCTVERSION without accessibility "
"support, or click '%CANCEL' to exit %PRODUCTNAME %PRODUCTVERSION.""

Andras, as I remember you said, you use msgcat to get this kind of result.
That's why LO po parser works this kind of po files.

Best regards,
Tamás

Thanks everybody for your help now that I have corrected all problems and
once again had nice build on both Ubuntu and Windows.

Now additional array of help requests:
1) I want to build the LO with Spellchecker and Help Pack included in the
installer. Providing a separate installation of Help and Spellchecker
extension is not good way as many of our user have little experience with
software installation.
2) Can I change the installer language to be mine, it is now in English.
3) The MSI installer I built is shows a 'Beta' Splash Screen and is
installed as "LibreOfficeDev4.1.1.0.0", how can I produce LibreOffice
4.x.x.x like the official installer.

Regards,

Hi Tadele,

Now additional array of help requests:
1) I want to build the LO with Spellchecker and Help Pack included in the
installer. Providing a separate installation of Help and Spellchecker
extension is not good way as many of our user have little experience with
software installation.

Try --with-helppack-integration --with-myspell-dicts switches in your
autogen.input.

2) Can I change the installer language to be mine, it is now in English.

I think it is not possible to build an installer without en-US, unless you
modify the source code. And Sidama will not be auto-detected, because it is
not supported by Windows. You can force the language of the installer with
a command line parameter:
msiexec /i LibreOffice-4.1.msi ProductLanguage=1669

3) The MSI installer I built is shows a 'Beta' Splash Screen and is
installed as "LibreOfficeDev4.1.1.0.0", how can I produce LibreOffice
4.x.x.x like the official installer.

Try --enable-release-build in your autogen.input.

Best regards,
Andras