Bugzilla – Attachment 62521 Details for
Bug 50415
Shortcut names are not localized on Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-fdo-50415-and-fdo-34638-Fix-Shortcut-names-are-not-l.patch (text/plain), 3.71 KB, created by
Thomas Arnhold
on 2012-06-04 09:01:30 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Thomas Arnhold
Created:
2012-06-04 09:01:30 UTC
Size:
3.71 KB
patch
obsolete
>From 5ea912fea665d3b52f979021d1dca4a28ea3e755 Mon Sep 17 00:00:00 2001 >From: Thomas Arnhold <thomas@arnhold.org> >Date: Mon, 4 Jun 2012 17:56:19 +0200 >Subject: [PATCH] fdo#50415 and fdo#34638 Fix Shortcut names are not localized > on Linux > >This partially reverts commit 2233aa52da14ec85331aee1163b885fe9a9fb507 > >Before the keyboard name was used to determine the target language >for translation of UI shortcuts. With this patch the UI locale >is used to determine the language. > >Related to: >- 8d9e2d9a211f710e91ac7c607fea25895282d245 >- 04b9c2f633f0be1b676933943bdd0b1dc58b5471 > >Change-Id: Icb953e80ff44652236c4fb617652f5d2dfcf5202 >--- > vcl/Library_vclplug_gen.mk | 1 + > vcl/inc/unx/saldisp.hxx | 11 +++++++++++ > vcl/unx/generic/app/saldisp.cxx | 21 ++++++++++++++------- > 3 files changed, 26 insertions(+), 7 deletions(-) > >diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk >index 3ff257a..c018a9d 100644 >--- a/vcl/Library_vclplug_gen.mk >+++ b/vcl/Library_vclplug_gen.mk >@@ -73,6 +73,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ > vcl/unx/generic/app/i18n_status \ > vcl/unx/generic/app/i18n_wrp \ > vcl/unx/generic/app/i18n_xkb \ >+ vcl/unx/generic/app/keysymnames \ > vcl/unx/generic/app/randrwrapper \ > vcl/unx/generic/app/saldata \ > vcl/unx/generic/app/saldisp \ >diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx >index fce2a68..dbc6487 100644 >--- a/vcl/inc/unx/saldisp.hxx >+++ b/vcl/inc/unx/saldisp.hxx >@@ -434,6 +434,17 @@ public: > void SetupInput( SalI18N_InputMethod *pInputMethod ); > }; > >+/*---------------------------------------------------------- >+ keep track of correct size of the initial window >+ */ >+// get foreign key names >+namespace vcl_sal { >+ rtl::OUString getKeysymReplacementName( >+ rtl::OUString pLang, >+ KeySym nSymbol ); >+} >+ >+ > #endif // _SV_SALDISP_HXX > > /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ >diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx >index ee4f094..2c34fd0 100644 >--- a/vcl/unx/generic/app/saldisp.cxx >+++ b/vcl/unx/generic/app/saldisp.cxx >@@ -66,6 +66,9 @@ Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*); > > #include <tools/postx.h> > >+#include <svtools/langhelp.hxx> >+#include <vcl/svapp.hxx> >+ > #include <unx/salunx.h> > #include <sal/types.h> > #include "unx/i18n_im.hxx" >@@ -755,6 +758,7 @@ sal_uInt16 SalDisplay::GetIndicatorState() const > > rtl::OUString SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const > { >+ rtl::OUString aLang = Application::GetSettings().GetUILocale().Language; > rtl::OUString aRet; > > // return an empty string for keysyms that are not bound to >@@ -766,13 +770,16 @@ rtl::OUString SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const > aRet = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "???" ) ); > else > { >- const char *pString = XKeysymToString( nKeySym ); >- int n = strlen( pString ); >- >- if( n > 2 && pString[n-2] == '_' ) >- aRet = rtl::OUString( pString, n-2, RTL_TEXTENCODING_ISO_8859_1 ); >- else >- aRet = rtl::OUString( pString, n, RTL_TEXTENCODING_ISO_8859_1 ); >+ aRet = ::vcl_sal::getKeysymReplacementName( aLang, nKeySym ); >+ if( aRet.isEmpty() ) >+ { >+ const char *pString = XKeysymToString( nKeySym ); >+ int n = strlen( pString ); >+ if( n > 2 && pString[n-2] == '_' ) >+ aRet = rtl::OUString( pString, n-2, RTL_TEXTENCODING_ISO_8859_1 ); >+ else >+ aRet = rtl::OUString( pString, n, RTL_TEXTENCODING_ISO_8859_1 ); >+ } > } > } > return aRet; >-- >1.7.10.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 50415
:
62153
|
62178
|
62294
|
62341
|
62378
|
62521
|
62522
|
62523
|
63695
|
63696