Ask Your Question
2

Shortcut for changing language? [closed]

asked 2012-10-06 11:55:41 +0200

anonymous user

Anonymous

updated 2015-11-13 05:57:46 +0200

Alex Kemp gravatar image

The problem I initially faced is the exact opposite of this one. Using LibreOffice 3.5 on Linux (Mint 13), when I switch keyboard language between EN and GR (I suppose it's the same for all other non-latin alphabet languages) the "input language" in Libre Office doesn't change, which means that my GR text is considered EN or vice-versa. Given that the solutions proposed to similar questions so far don't work (Xneur doesn't recognize GR, and apparently there's no way to connect the system language to the document language in Linux, which is strange because that's exactly what happens in Windows), I decided to try a different approach and create a shortcut for switching languages, so that I don't have to manually select each and every EN word that pops up in a GR document (or vice versa). Unfortunately although I navigated through the multitude of categories and functions under Customize/keyboard, I've yet to find a "switch/change" languages command.

Can anyone help me create a keyboard shortcut for the command "switch/change language" in Libre office?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-13 05:57:59.814777

Comments

1

2 Answers

Sort by » oldest newest most voted
1

answered 2013-02-21 21:10:34 +0200

manj_k gravatar image

updated 2013-02-21 21:39:42 +0200

That's an "Windows-only" feature, see:
(1) http://www.openoffice.org/specs/appwide/linguistic/ → Set_Language_Attribute_for_Text.odt
1.5 Set Text Language to Input Language Automatically ... (page 12)
(2) OOo issue 1035

You may create a macro (via "Record Macro") with these steps (mouse clicks):

Menu "Tools → Language → For Selection → Language xyz"
(repeat it for each needed language).

Assign each macro to a shortcut key
(I have used Ctrl+Shift+6, ..., Ctrl+Shift+9,
see also: http://ask.libreoffice.org/en/question/3527/special-characters/?answer=3579#post-id-3579).

Apply the corresponding shortcut key to switch the language while typing ...

Sample
Recorded macro "Language → For Selection → French" (assigned to Ctrl+Shift+8):

sub select_fr
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Language"
args1(0).Value = "Current_French (France)"

dispatcher.executeDispatch(document, ".uno:LanguageStatus", "", 0, args1())

end sub
edit flag offensive delete link more
1

answered 2013-11-06 14:45:57 +0200

cipricus gravatar image

updated 2013-11-06 15:58:52 +0200

~via.

As the other answer, this is about creating macros for each language and starting the macro with shortcuts.

  • Enable recording macros.

3.5.x Menu Tools > Options > LibreOffice > General ☑ Enable experimental (unstable) features.

4.0.x Menu Tools → Options → LibreOffice → Advanced Optional (unstable) options ☑ Enable macro recording

More here.

  • Tools > Macros > Record macro

  • Select text, then go to Tools > Language, and chose the way you want the language to be applied with that specific macro: For selection, For paragraph or For all text - and chose the language. Then click 'Stop recording' in the floating window that appeared. An window should open to save the macro with a specific name. Do the same for different languages.

  • To assign shortcuts to each macro go to Tools > Customize > Keyboard, select the shortcut keys, and under Functions > Category > Libreoffice macros - etc - select the macro (as seen in the image below) and click modify.

Then click OK and you're done.

image description

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-10-06 11:55:41 +0200

Seen: 5,628 times

Last updated: Nov 06 '13