Bug 444376 - msgctxt for 'Predefined' is NOT correctly implemented, the translation doesn't show in the UI
Summary: msgctxt for 'Predefined' is NOT correctly implemented, the translation doesn'...
Status: RESOLVED NOT A BUG
Alias: None
Product: krita
Classification: Applications
Component: Translation (show other bugs)
Version: 5.0.0-beta1
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-25 16:38 UTC by Hoang Duy Tran
Modified: 2021-10-25 17:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The PO file for UI language in Vietnamese (1.76 MB, application/x-po)
2021-10-25 16:40 UTC, Hoang Duy Tran
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hoang Duy Tran 2021-10-25 16:38:28 UTC
SUMMARY


STEPS TO REPRODUCE
1. Load the attached krita.po into an editor, say vscode, or vi
2. Search to find 'msgid.*Predefined' to locate the key in question, the current content of this entry is:

#: plugins/paintops/libpaintop/kis_brush_selection_widget.cpp:49
#, kde-format
msgctxt "Predefined Brush tip mode"
msgid "Predefined"
msgstr "Định Trước"

3. Open an command line window and run the MO compilation line, using:

msgfmt -o $KRITA_MO_FILE $KRITA_PO_FILE

(Note: edit your 'rc' file (says: .bashrc if you are using BASH shell) to make sure the two keys:
export KRITA_MO_FILE=<path to the MO file of the krita executable:
(mine is: KRITA_MO_FILE=/Applications/krita_5.app/Contents/Resources/locale/vi/LC_MESSAGES/krita.mo)

export KRITA_PO_FILE=<path to the attached PO file>
(mine is: KRITA_PO_FILE=/Users/hoangduytran/Dev/tran/krita/vi-kde/trunk/l10n-kf5/vi/messages/krita/krita.po)
make sure to reload the changes in the .bashrc (. ./.bashrc)

4. Open Krita app, open a new document of any size/type, click on the icon Edit Brush Setting in the tool bar (You'll probably need to change the 'General->Tools->Tool Options Location from 'In Docker' to 'In Toolbar' first, and restart Krita)

5. In the 'Brush Editor', select a brush (press '<' on the left to show brush presets), select (y) Screentone moire) brush, on the right, you should see tabs 'Auto, Predefined, Text'.

6. Now switch the UI to Vietnamese using Settings->Switch Application Language->Primary Language to 'Vietnamese', and restart Krita

7. After Krita loaded and went back to 'Brush Editor' as describe above, you still see the 'Predefined' in English.

8. In the krita.po editor, remove the 'msgctxt' line for the 'Predefined', recompile the changes using 'msgfmt -o ...' described above

9. Reload krita and go back to 'Brush Editor', you should now see the translation in Vietnamese as 'Định Trước'.


OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
The above running shows that either 'msgctxt' for 'Predefined' key has not yet implemented correctly or the existence of 'msgctxt' should not be there.
Comment 1 Hoang Duy Tran 2021-10-25 16:40:17 UTC
Created attachment 142857 [details]
The PO file for UI language in Vietnamese

Using 'msgfmt -o $KRITA_MO_FILE $KRITA_PO_FILE' command to convert the PO file to MO file
Comment 2 Alvin Wong 2021-10-25 17:33:16 UTC
Hi, the context for the "Predefined" string was changed fairly recently [1], so the message in the newer PO file you have there does not correspond to 5.0.0-beta1, but it does correspond to the latest commit on the stable branch (krita/5.0). As I mentioned in bug 444364, comment 1, you should test with the latest nightly builds (choose Plus or Next depending on which SVN branch you are starting with), and remember to update it whenever you fetch the latest PO file from SVN.

From what I remember, the latest stable has several translation string changes even from 5.0.0-beta2, so you shouldn't use that as a reference either.

[1]: https://invent.kde.org/graphics/krita/-/commit/069a7645799df0527c385097ffd7b7fb5a661c95#b3d1303fcf07be4c866a1e6011527b6b9542661d_49_49