[PATCH] RFC: Changing the language of individual KDE programs

Krzysztof Lichota krzysiek at lichota.net
Sun Mar 4 19:27:47 GMT 2007


I have implemented often-requested (327 votes) bug 24348: Changing the
language of individual KDE programs. Patch is attached (for KDE 3.5.x).
It uses infrastructure which has already been implemented (saving
language for app in its config file), so it is not touching KLocale code
(apart from making one function public, see below), just adding GUI.

I have a few doubts though regarding implementation, I am not sure my
choices were right:
1. I had to make one function (KLocale::isApplicationTranslatedInto())
public - it was previously private. It is not virtual, so I do not see
problem here, but if necessary, I can copy the implementation into
another function.
2. I have put "Switch application language" option in Help menu. It is
the only menu which appears in all applications and it is used for
example by Kubuntu to put common options (like "Translate this
application"), so I am not the only one. I admit that IMO better place
would be Settings menu, but it not always appears and I could not find
way to add command there so that it will be used by all apps.
3. UI is not awesome and I want to run it through kde-accessibility
before committing. Maybe they come up with better design.
4. I have added GUI source in khelpmenu.{h,cpp} files as I did not want
to create new files. If necessary I can put it into separate files.
5. I am assuming KGlobal::config() is always not-NULL. If it is not the
case, I will add check to not open dialog in such case.

Notes about implementation:
- Language change takes effect upon restart. User is warned about this.
- Multiple fallback languages are supported.

Screenshots
-----------
Modified Help menu:
http://lichota.net/~krzysiek/projects/kde/switch-app-language/menu.png
Switch language dialog:
http://lichota.net/~krzysiek/projects/kde/switch-app-language/konsole-british.png
Language selection:
http://lichota.net/~krzysiek/projects/kde/switch-app-language/language-selection-menu.png
Multiple fallback languages (you can see Esperanto, Polish and English
in various places):
http://lichota.net/~krzysiek/projects/kde/switch-app-language/konsole-esperanto-polish-english.png

More screenshots:
http://lichota.net/~krzysiek/projects/kde/switch-app-language/

Comments welcome :)

	Krzysztof Lichota
-------------- next part --------------
A non-text attachment was scrubbed...
Name: switch-app-language.diff
Type: text/x-patch
Size: 15398 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070304/74973646/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070304/74973646/attachment.sig>


More information about the kde-core-devel mailing list