| Summary: | Preset choosers are not using the translated names | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Tyson Tan <tysontanx> |
| Component: | Translation | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | alvin, halla, thetwo222 |
| Priority: | NOR | ||
| Version First Reported In: | 5.0.0-beta1 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Bug Depends on: | 439760 | ||
| Bug Blocks: | |||
| Attachments: |
screenshot of untranslated tooltip
screenshot of krita preset hover translation |
||
|
Description
Tyson Tan
2021-09-08 04:20:47 UTC
And Workspace Chooser's presets list too. Well, that is actually intentional... In https://phabricator.kde.org/T379, we discuss this. The actual resource names are not translated so tutorials can referto the original names. We've been discussing this with windragon on irc, but there's no real solution here yet. My opinion is quite the opposite. My logic goes like this: 1) If someone uses a localized version, chances are they can't read English very well. In that case, our base presets are not of much use without a separated guide, which is rather counter productive. 2) Not all people needs to follow a tutorial. But EVERY USER needs to read from the UI. Crippling an essential part of the UI for something may or may not be useful is also rather counter productive. 3) If people needs to follow a tutorial, they'd have used one in their native language. Those who use localized Krita most likely won' be able to use an English tutorial anyway. If the tutorial was translated, it's only natural for the translator to translate the names for them -- like what I did in Krita's documentation. 4) They can learn the original names from the tooltip WHEN THEY NEEDED IT. 5) But everyone must be able to understand the presets ALL THE TIME. Therefore, I recommend to make the translated preset names the default in Krita's UI. Hm, trying to do this now, but for some reason the translations (I'm testing with es) aren't picked up. The translated names are displayed in a popup when you are hovering over on a preset. There are two lines - the English line is always on top. Maybe the English name line is not i18n? This arrangement works okay for Krita's default icon list view, but not so much with the detailed list view. Created attachment 150409 [details]
screenshot of untranslated tooltip
Here, when testing the spanish translation, the tooltip doesn't have a translation. I've checked that the po file provides the translation. There are other problems: the extracti18n.pl script does some sanitizing in the hope that it can create a nice name from the filename for resource types that don't have a name field:
sub parseFromFilename($$) {
# function that prettifies filenames
# it extracts the filename from the full path, cuts off the extension and replaces '_ with ' '
my $name = $_[0];
my $extension = $_[1];
chomp($name);
my @path = split(/\//, $name);
$name = $path[$#path];
$name =~ s/_/ /g;
if( $extension ne "" ) {
$name =~ s/\.${extension}$//g;
}
return $name;
}
We don't do this in most cases in Krita itself anymore, because that gave problems. But... That means that the po files have, for instance Cross04 for name, while Krita has Cross04.pat.
#. i18n: Display name of resource, see context: [path-to-resources]/[resource-type]/[resource-filename]
#, kde-format
msgctxt "./krita/data/patterns/Cross04.pat"
msgid "Cross04"
msgstr "Cruz04"
But even if I fix that, or filter the name before looking up the translation, a debug line that prints i18n("Cross04") doesn't print a translated string, and I don't know why that is.
Created attachment 150410 [details]
screenshot of krita preset hover translation
It works for me with Simplified Chinese translation here. It has been like this for us since Krita 5.0, which is quite acceptable, so I have completely forgotten about this bug...
What I think might fix your situation though: uninstall Krita, delete all its presets from:
/home/username/.local/share/krita/
Then reinstall Krita.
If that fixed it for you, then Krita is loading preset names from either:
1) the current preset files
or
2) the database
My theory is that if you have been upgrading from an old version, and you have never cleared out the old assets, it could cause such issue.
Since I need to test Krita all the time, I routinely clear out my assets and configurations when weird things happens
The translated tooltip names are written to the database on first creation (there should be an open bug that tracks this), perhaps this is why you are not seeing the translated names? > We don't do this in most cases in Krita itself anymore, because that gave problems. But... That means that the po files have, for instance Cross04 for name, while Krita has Cross04.pat. When was this changed? Are you sure this is breaking anything? I believe when these names first become translated I personally verified that every one of them are translated. > But even if I fix that, or filter the name before looking up the translation, a debug line that prints i18n("Cross04") doesn't print a translated string, and I don't know why that is. You're missing the message context: i18nc("./krita/data/patterns/Cross04.pat", "Cross04") bug 439300 Translation of tags and resources only happen when creating the database - it was marked as fixed but the fix only handled translation of tag names, the issue still exists for resource names. This is where the translation of the resource names happens last time I checked: https://invent.kde.org/graphics/krita/-/blob/c65b9e93e57651cd119ef759fee2e8ecfb0c3c43/libs/resources/KisResourceCacheDb.cpp#L1000 I'm beginning to see how to properly fix this. A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1503 I don't see a working solution that provides both keeping the translations up to date and keep the query fast, so I'm not going to work on this anymore. |