SUMMARY In the Exif editor, the strings ‘Portrait’ and ‘Landscape’ have a different meaning than in the rest of the Krita UI. Here, they refer to literal portraits (photos showing people) and landscapes (photos showing landscapes), but in the rest of the UI, they refer to image/paper orientation (vertical and horizontal). But there’s only one msgid for each string, so it’s not possible to provide different translations for the two meanings of the words. So the strings corresponding to the Exif scene types needs to have ‘msgctxt’ added (i.e. ‘Photos of people’ and ‘Photos of landscapes), so that they appear as separate strings in the POT file. The scene type metadata strings can be found in: Layer → Edit metadata → Exif → Misc → Scene capture type The POT files lists the following file positions for the ‘Landscape’ string (and similar for the ‘Portrait’ string): libs/ui/forms/wdgnewimage.ui:165 libs/widgets/KoPageLayoutWidget.ui:166 plugins/extensions/metadataeditor/editors/exif.ui:975
How do we add context for strings in ui files?
(In reply to Boudewijn Rempt from comment #1) > How do we add context for strings in ui files? That’s what I was wondering (otherwise, I could have tried to fix it myself). But I just did some searching, and found this: https://api.kde.org/frameworks/ki18n/html/prg_guide.html > When Qt Designer is used to build the user interface, the -tr option of > uic should be used to pass UI strings through Ki18n's tr2i18n function > (see also link_ui). This function is the equivalent of i18n or i18nc, > based on whether the second argument is null or not. If a string in the > .ui file has the attribute comment=, its value will be automatically used > as the context argument. (In Qt Designer, this is the disambiguation > property of a string.) Alternatively, strings can be passed to Ki18n's > tr2xi18n function (see kuit_markup).
So I can try to add comments, and see if that works.
Git commit b4e1710021ce78ef103db3435298d6093a2a8bf7 by Karl Ove Hufthammer. Committed on 29/07/2019 at 09:22. Pushed by rempt into branch 'master'. Add message context for scene types ‘Portrait’ and ‘Landscape’ In the Exif metadata, the ‘Portrait’ and ‘Landscapes’ strings mean actual photos of people and landscape, but in the rest of the Krita UI, they mean vertical/horizontal paper orientation. This adds ‘msgctxt’ info for the Exif strings, so that they can translated differently than the paper orientation strings. M +2 -2 plugins/extensions/metadataeditor/editors/exif.ui https://invent.kde.org/kde/krita/commit/b4e1710021ce78ef103db3435298d6093a2a8bf7