Version: (using Devel) Installed from: Compiled sources These untranslatable items in Tools -> External Tools are taken from kdesdk/kate/plugins/externaltools/externaltools: name=Compare Current Document to Version Control System name=Compare Directory of Current Document to Version Control System name=Email CVS Diff for Current Document name=Google Selection name=Run Script These messages are not extracted for translation since afaik KDE 3.3.0 How to fix this issue: 1. Patch the i18n tool chain aka scripty to process this file (add externaltools to the filelist in less l10n-kde4/scripts/findfiles) -> I can do that 2. Change "name" to "Name" in externaltools, because that is one of the keywords defined in l10n-kde4/scripts/applycontext.cpp to enable scripty to extract these values to the message catalog desktop_kdesdk and merge the translation back into the file externaltools 3. kate has to be patch to read the localized Name string (via KDesktopFile?) and display them in the menu.
Created attachment 57471 [details] Replaced 'name' to 'Name' in externaltools
This problem seems fixed in 4.6.1. Can I close this bug?
(In reply to comment #2) > This problem seems fixed in 4.6.1. Can I close this bug? Using kate using locale x-test in master + 4.6 I still see untranslatable menu items.
Lamarque why do you say it's fixed? Here I don't see any translation inside kate/plugins/externaltools/externaltools nor those texts extracted to kate.pot
Because when I tested it I did not see anything unstranslated, but externaltools is not enabled by default. When it is enabled I see the unstranslated strings.
External Tools is removed for 4.8, lack of maintainer, closing bugs, asking for somebody to step up, all bugs to look at listed there for archiving. http://kate-editor.org/2011/08/09/maintainer-needed-kate-external-tools-plugin/
PS: It's back. We have to check translation issues, though. https://kate-editor.org/post/2019/2019-09-21-external-tools-plugin/
Tested with Kate 19.11.90 on ArchLinux with Russian and Ukrainian translations, still does not work (menu items are all in English), I don't know why. The messages are correctly extracted into kateexternaltoolsplugin.pot by kate.git/addons/externaltools/Messages.sh
Git commit df460443bf6e651812acb17d31ec1a9d26c71c6a by Dominik Haumann. Committed on 02/12/2019 at 20:31. Pushed by dhaumann into branch 'fix-translation'. Fix: Do not translate KActionCollection identifier M +1 -1 addons/externaltools/kateexternaltoolsview.cpp https://invent.kde.org/kde/kate/commit/df460443bf6e651812acb17d31ec1a9d26c71c6a
Git commit df460443bf6e651812acb17d31ec1a9d26c71c6a by Dominik Haumann. Committed on 02/12/2019 at 20:31. Pushed by scmsync into branch 'fix-translation'. Fix: Do not translate KActionCollection identifier M +1 -1 addons/externaltools/kateexternaltoolsview.cpp https://commits.kde.org/kate/df460443bf6e651812acb17d31ec1a9d26c71c6a
I think I know how to fix it: these must be i18nc() calls, not just i18n() because strings are extracted with contexts "External tool name" or "External tool category". diff --git a/addons/externaltools/kateexternaltool.cpp b/addons/externaltools/kateexternaltool.cpp index 3a8ce0e31..45c0ac879 100644 --- a/addons/externaltools/kateexternaltool.cpp +++ b/addons/externaltools/kateexternaltool.cpp @@ -144,12 +144,12 @@ void KateExternalTool::save(KConfigGroup &cg) const QString KateExternalTool::translatedName() const { - return name.isEmpty() ? QString() : i18n(name.toUtf8().data()); + return name.isEmpty() ? QString() : i18nc("External tool name", name.toUtf8().data()); } QString KateExternalTool::translatedCategory() const { - return category.isEmpty() ? QString() : i18n(category.toUtf8().data()); + return category.isEmpty() ? QString() : i18nc("External tool category", category.toUtf8().data()); } bool operator==(const KateExternalTool &lhs, const KateExternalTool &rhs)
Ah I think that makes a lot of sense! Thanks, will post a patch.
Quite a hacky approach, huh? I would use the standard translatable .json files if I was implementing this from scratch, like this one https://cgit.kde.org/purpose.git/tree/src/plugins/twitter/metadata.json
Git commit f65192bbe6a6d259e13a2bab9408442b7f4dbe6b by Dominik Haumann. Committed on 02/12/2019 at 20:45. Pushed by dhaumann into branch 'ext-tools-fix-translation'. Fix translation of external tools M +2 -2 addons/externaltools/kateexternaltool.cpp https://invent.kde.org/kde/kate/commit/f65192bbe6a6d259e13a2bab9408442b7f4dbe6b
Git commit f65192bbe6a6d259e13a2bab9408442b7f4dbe6b by Dominik Haumann. Committed on 02/12/2019 at 20:45. Pushed by scmsync into branch 'ext-tools-fix-translation'. Fix translation of external tools M +2 -2 addons/externaltools/kateexternaltool.cpp https://commits.kde.org/kate/f65192bbe6a6d259e13a2bab9408442b7f4dbe6b
OTOH those JSONs assume that you are using KPlugin while here we won't ever use a plugin per external command...
Merge request: https://invent.kde.org/kde/kate/merge_requests/50