D5455: Extend Programmer's Guide with notes about influence of setlocale()
This revision was automatically updated to reflect the committed changes. Closed by commit R249:db45cf7242d7: Extend Programmer's Guide with notes about influence of setlocale() (authored by kossebau). REPOSITORY R249 KI18n CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D5455?vs=14158=14214 REVISION DETAIL https://phabricator.kde.org/D5455 AFFECTED FILES docs/programmers-guide.md To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
ilic accepted this revision. ilic added a comment. All good to me. REPOSITORY R249 KI18n BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau added a comment. In https://phabricator.kde.org/D5455#107095, @kossebau wrote: > BTW, the `` and `\ref x` seems not to work (only reused that for consistency), will do a separate patch later which follows instructions from http://doxygen.10944.n7.nabble.com/Creating-links-in-and-between-Markdown-files-pages-td6689.html Hmpf, seems there is a bug in doxygen about section creation, as actually also stated by the doxygen author in the linked thread above. Guess that is also why currently the `` are used. Giving up on that bug for now. For the given patch in this review, will commit next WE unless someone has further comments :)(or before if you ilic give your okay) REPOSITORY R249 KI18n BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau added a comment. BTW, the `` and `\ref x` seems not to work (only reused that for consistency), will do a separate patch later which follows instructions from http://doxygen.10944.n7.nabble.com/Creating-links-in-and-between-Markdown-files-pages-td6689.html REPOSITORY R249 KI18n BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau added a comment. @ilic Thanks for the comments, agreed. Actually the initial text had some "really?" across it, as I was surprised about the findings stated in there and wanted (your) confirmation. So made this info bit a subsection of the "Writing Messages" part, and changed it to first be handling instructions (given this is a guide), then have some explanation for the curious. Also dumped any proposals for custom usage of setlocale(). REPOSITORY R249 KI18n BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau updated this revision to Diff 14158. kossebau added a comment. rework text follwing feedback REPOSITORY R249 KI18n CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D5455?vs=13447=14158 BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 AFFECTED FILES docs/programmers-guide.md To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
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
D5455: Extend Programmer's Guide with notes about influence of setlocale()
aacid accepted this revision. aacid added a comment. This revision is now accepted and ready to land. Looks a bit convoluted way of explaining not to use i18n before Q*Application, but i guess it works :) REPOSITORY R249 KI18n BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic, aacid Cc: aacid
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau added a comment. ping? REPOSITORY R249 KI18n REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau added a comment. Actually, I simplified/ignored how i18n calls internally make the gettext call chose a locale name for which a catalog has been found, by temporarily setting the LANGUAGE variable. What do you think, should this implementation detail be noted here as well, or would it only result in confused readers, who might already being challenged a lot by the complexity how to use the ki18n API? REPOSITORY R249 KI18n REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau added a comment. See thread around https://phabricator.kde.org/D5439#102005 for related discussion. REPOSITORY R249 KI18n REVISION DETAIL https://phabricator.kde.org/D5455 To: kossebau, #frameworks, ilic
D5455: Extend Programmer's Guide with notes about influence of setlocale()
kossebau created this revision. Restricted Application added a project: Frameworks. REVISION SUMMARY Collect knowlegde found when investigating why i18n calls before line QApplication app; do not return translated strings. Perhaps needs more prominent place to warn about the issues. But having it documented somewhere will be a start. REPOSITORY R249 KI18n BRANCH addNoteAboutGettextLocaleIssuse REVISION DETAIL https://phabricator.kde.org/D5455 AFFECTED FILES docs/programmers-guide.md To: kossebau, #frameworks, ilic