Bug 432699 - Effects list's filter field does not work for CJK characters
Summary: Effects list's filter field does not work for CJK characters
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: Effects & Transitions (show other bugs)
Version: 20.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: erjiang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-09 19:25 UTC by Tyson Tan
Modified: 2022-07-27 11:48 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kdenlive effect name translations incomplete (116.92 KB, image/png)
2022-05-09 17:16 UTC, Tyson Tan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2021-02-09 19:25:17 UTC
Kdenlive's Effects list has a filter input field, but it doesn't work for CJK characters.

For example, we have Mute in the list, it was translated into "静音" for Simplified Chinese locale. When I'm using Simplified Chinese locale, inputting the letter "静" doesn't filter anything. While inputting "Mute" returns nothing.

It's impractical to navigate all those items without the aid of a filter, this bug makes the Effect list basically useless for CJK users.
Comment 1 emohr 2021-02-15 18:24:18 UTC
As far as I know we never tested Kdenlive with CJK characters. Do you know if KRITA work with CJK characters? If so can you give a hint how to solve this in Kdenlive?
Comment 2 Tyson Tan 2021-02-17 09:14:33 UTC
Krita 4.4.x haven't yet support unicode for its resource items. The upcoming Krita 5.0.0 was said to have unicode support, but the lastest nightly version still haven't implemented the feature.

digiKam have a working implementation of CJK-enabled text filter. I've just tested it on digiKam 7.2.0 RC. I can assign a CJK tag, then filter the result using the text filter. But I'm not sure the differences between a user-assigned tag and resource names.

I'm not a programmer, so I might not be of much help here. Last time something similar happened on https://docs.krita.org/ , which was built using Sphinx. It can't tell a keyword without space, or it can't search letter by letter (which is how CJK search behaves) which might be a common cause of this kind of bugs. The bug report can be found here: https://bugs.kde.org/show_bug.cgi?id=419321
Comment 3 erjiang 2022-05-09 05:44:28 UTC
Is there a way to run Kdenlive in a specific language, maybe with an environment variable?  I tried using LANGUAGE=zh which seemed to make some strings Chinese but most of the UI, including the effects list, was still in English.
Comment 4 emohr 2022-05-09 14:57:43 UTC
@Eric Jiang: Do you are on Windows?
Comment 5 erjiang 2022-05-09 16:00:18 UTC
(In reply to emohr from comment #4)
> @Eric Jiang: Do you are on Windows?

No, I'm using Kdenlive on Linux.
Comment 6 Tyson Tan 2022-05-09 16:58:15 UTC
The Windows version has a package issue causing translation to be missing for all dialogues, for years now.

On my Arch Linux, the official appimage shows SOME translations for the effects. There are some effects that don't seem to have been properly i18n. Like Pan, Fade-in, Fade-out, etc.

I swear to god I have translated 100% of the thing, and I have translated these names, but they just won't show up.

Other effect names like Normalization, Gain, etc shows proper translations.

This is definitely not an issue that can be solved by merely an environment variable...
Comment 7 Tyson Tan 2022-05-09 17:16:15 UTC
Created attachment 148682 [details]
kdenlive effect name translations incomplete
Comment 8 Jean-Baptiste Mardelle 2022-05-10 09:32:05 UTC
So to start Kdenlive in another language, you must first ensure that the translations are correctly installed, which can be painful.
If you compile Kdenlive yourself, you need to install "ruby" and "svn" (subversion), then call cmake with the following param:
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DKDE_L10N_SYNC_TRANSLATIONS=ON
(the important part being "-DKDE_L10N_SYNC_TRANSLATIONS=ON")
Then make and make install.

After this, in Kdenlive, go to Settings > Configure Language and click "Default", then close the app.
After this, from a terminal:

LANG=fr_FR.UTF-8 kdenlive

will start as french (replace fr_FR with whatever language code you want).
Comment 9 Shinjo Park 2022-05-10 14:31:55 UTC
Can confirm also in Korean language too. Some effect names are translated as of 21.12.3, but searching using translation does not work.
Comment 10 erjiang 2022-07-27 04:11:39 UTC
Looks like the code tries to normalize the text (for better searchability) by removing all alphanum and space characters, but it specifies "[^a-zA-Z0-9\\s]" and doesn't account for non-English names.
Comment 11 erjiang 2022-07-27 07:37:51 UTC
Git commit d7a8c463f60e9b5fe757c9af4acf9ebbe672c530 by Eric Jiang.
Committed on 27/07/2022 at 05:29.
Pushed by mardelle into branch 'master'.

Fix filtering TreeItem lists by non-ASCII strings

AssetFilter tries to normalize the TreeItem's text by removing any
punctuation and symbols, but it was done using a simple [^a-zA-Z0-9\s]
character class which removed any non-ASCII characters, breaking the
search for many non-English languages. Replacing this with [^\w\s]
didn't work, but iterating through the string and using
isLetterOrNumber() does work.

M  +16   -4    src/assets/assetlist/model/assetfilter.cpp
M  +8    -0    src/assets/assetlist/model/assetfilter.hpp
M  +16   -2    tests/treetest.cpp

https://invent.kde.org/multimedia/kdenlive/commit/d7a8c463f60e9b5fe757c9af4acf9ebbe672c530
Comment 12 Tyson Tan 2022-07-27 07:40:24 UTC
Thank you Eric! :D
Comment 13 Jean-Baptiste Mardelle 2022-07-27 11:48:05 UTC
Git commit 9648cb12294da4295654d4e7abc03e1d7b0b2903 by Jean-Baptiste Mardelle, on behalf of Eric Jiang.
Committed on 27/07/2022 at 11:47.
Pushed by mardelle into branch 'release/22.08'.

Fix filtering TreeItem lists by non-ASCII strings

AssetFilter tries to normalize the TreeItem's text by removing any
punctuation and symbols, but it was done using a simple [^a-zA-Z0-9\s]
character class which removed any non-ASCII characters, breaking the
search for many non-English languages. Replacing this with [^\w\s]
didn't work, but iterating through the string and using
isLetterOrNumber() does work.

M  +16   -4    src/assets/assetlist/model/assetfilter.cpp
M  +8    -0    src/assets/assetlist/model/assetfilter.hpp
M  +16   -2    tests/treetest.cpp

https://invent.kde.org/multimedia/kdenlive/commit/9648cb12294da4295654d4e7abc03e1d7b0b2903