D5455: Extend Programmer's Guide with notes about influence of setlocale()

Chusslove Illich noreply at phabricator.kde.org
Thu Apr 27 20:40:41 UTC 2017


ilic added a comment.


  I guess not bad to mention this stuff, but I would make following adaptations:
  
  1. Move the section as subsection of "Controlling Language Of Catalog to Use", and give it a more focused ( title, e.g. "Placing i18n calls before creation of QCoreApplication".
  
  2. State up front that in general one should avoid making i18n calls before QCoreApplication is crated, in one of two ways: either using statically initialized character arrays wrapped in I18N_* macros for extraction, and later making actual i18n* calls; or, using ki18n* calls to make KLocalizedString instances, that do not perform immediate catalog lookup, and later fetch actual translation throug their toString() methods.
  
  3. Finally the part about setlocale etc, for the case that all of the above is for some reason not applicable. I'm not 100% percent sure that everything will work as expected with this. For example, before QCoreApplication is initialized, what happens with ki18n's internal search for catalogs through standard directory paths...

REPOSITORY
  R249 KI18n

BRANCH
  addNoteAboutGettextLocaleIssuse

REVISION DETAIL
  https://phabricator.kde.org/D5455

To: kossebau, #frameworks, ilic, aacid
Cc: aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170427/0d588dc5/attachment.html>


More information about the Kde-frameworks-devel mailing list