Bug 397604 - Untranslated strings from bibtexfields.cpp and bibtexentries.cpp
Summary: Untranslated strings from bibtexfields.cpp and bibtexentries.cpp
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: User interface (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-19 06:43 UTC by Yuri Chornoivan
Modified: 2018-09-09 17:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 0.8.2


Attachments
Screenshot of KbibTeX 0.8.2 window, Ukrainain (uk) locale, compiled from 0.8.2 branch at 2018-08-17 (25.74 KB, image/png)
2018-08-19 06:43 UTC, Yuri Chornoivan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Chornoivan 2018-08-19 06:43:57 UTC
Created attachment 114486 [details]
Screenshot of KbibTeX 0.8.2 window, Ukrainain (uk) locale, compiled from 0.8.2 branch at 2018-08-17

Strings from bibtexfields.cpp and bibtexentries.cpp are successfully extracted to kbibtex.pot, can be translated, but are shown in English in the interface in both 0.8.2 and git/master branches (please see the screenshot attached). They are displayed correctly (translated) in v0.7 from Mageia RPM.

It was told that "They are using i18n() before creating a QCoreApplication and that is not supported at this time."

https://marc.info/?l=kde-i18n-doc&m=153462469130148&w=2

Many thanks in advance for fixing this bug.
Comment 1 Thomas Fischer 2018-08-28 20:22:16 UTC
I have trouble getting translations to be loaded in the first place (everything stays English, no matter what) so I have problems to reproduce this bug.
However, I believe that it exists and I may have an idea how to fix it.

Please check out this commit and see if it makes a difference in your case:
https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/b595e7ccaf75875022d1fdf927568b67b7a7b3ed
Note that this code only exists in my personal clone of KBibTeX's code, but not in the official repository.
Comment 2 Yuri Chornoivan 2018-08-29 08:24:35 UTC
(In reply to Thomas Fischer from comment #1)

> Please check out this commit and see if it makes a difference in your case:
> https://commits.kde.org/clones/kbibtex/thomasfischer/kbibtex/
> b595e7ccaf75875022d1fdf927568b67b7a7b3ed

Tested for git/master. Now the translations work as expected. Thanks for your work.
Comment 3 Thomas Fischer 2018-09-01 18:48:32 UTC
Git commit a801a85b9755f154c0192ff7a22e9df00772e14f by Thomas Fischer.
Committed on 01/09/2018 at 18:47.
Pushed by thomasfischer into branch 'kbibtex/0.8'.

Delaying initialization of static variables

To allow for proper internationalization to be loaded and
initialized before static const variables in BibTeXFields and
BibTeXEntries, those variables have been refactored into the
singleton functions of each class.
FIXED-IN: 0.8.2

M  +48   -47   src/config/bibtexentries.cpp
M  +159  -158  src/config/bibtexfields.cpp

https://commits.kde.org/kbibtex/a801a85b9755f154c0192ff7a22e9df00772e14f
Comment 4 Thomas Fischer 2018-09-09 17:54:41 UTC
Git commit d11f419afc2289e42f4b3bd682ef8269ccd13bf1 by Thomas Fischer.
Committed on 30/08/2018 at 19:28.
Pushed by thomasfischer into branch 'master'.

Delaying initialization of static variables

To allow for proper internationalization to be loaded and
initialized before static const variables in BibTeXFields and
BibTeXEntries, those variables have been refactored into the
singleton functions of each class.

M  +48   -48   src/config/bibtexentries.cpp
M  +159  -159  src/config/bibtexfields.cpp

https://commits.kde.org/kbibtex/d11f419afc2289e42f4b3bd682ef8269ccd13bf1