Development/Tutorials/Localization/Language Change: Difference between revisions

From KDE TechBase
No edit summary
No edit summary
Line 6: Line 6:


<code>
<code>
  <Menu name="help">
<Menu name="help">
     <Action name="switch_application_language"/>
     <Action name="switch_application_language"/>
  </Menu>
</Menu>
</code>
</code>


And that is it!  You will now have a Switch Application Language option in the Help menu.
And that is it!  You will now have a Switch Application Language option in the Help menu.

Revision as of 19:49, 23 October 2007

It can be extremely useful for a user to be able to change the language of a specific application. It is fortunately extremely easy to add such functionality to your program.

If you are using the KXmlGuiWindow class for your main window, then you will already have an associated programname.rc file for it.

Simply modify this file to contain:

<Menu name="help">

   <Action name="switch_application_language"/>

</Menu>

And that is it! You will now have a Switch Application Language option in the Help menu.