kouchat icon indicating copy to clipboard operation
kouchat copied to clipboard

Translation support for the user interface

Open blurpy opened this issue 10 years ago • 1 comments

Add support for translating the user interface into different languages.

blurpy avatar Mar 16 '15 19:03 blurpy

Steps to do translations without source code:

  1. Download the newest snapshot of KouChat from the build server at: https://blurpy.ci.cloudbees.com/job/kouchat/lastStableBuild/net.usikkert.kouchat$kouchat/

  2. Put the jar in a folder, like "kouchat" (the name is not important).

  3. Inside the new folder, create another new folder called "messages" (must be this exact name). The folder "kouchat" should now contain the jar and the folder "messages".

  4. In the folder "messages", create an empty file called "swing_ru_orig.properties"

  5. In the properties file, add the line "swing.menu.file=Файл"

  6. Convert the properties file to the correct format using native2ascii. Run this command from the "kouchat" folder:

    native2ascii messages/swing_ru_orig.properties messages/swing_ru.properties
    

    I'm not sure if native2ascii is part of the Java Runtime (JRE). You might need to download the Java JDK to get it. If the characters look wrong in step 7, try experimenting with the -encoding parameter of native2ascii, documented here: http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/native2ascii.html

  7. Run KouChat with Russian language:

    java -Duser.language=ru -cp .:kouchat-1.3.0-SNAPSHOT.jar net.usikkert.kouchat.KouChat
    

    You probably don't need to use "-Duser.language=ru" if the operating system is configured to Russian by default. On Windows the -cp parameter will be "-cp .;kouchat-1.3.0-SNAPSHOT.jar" instead.

  8. The file menu should now be displayed in Russian. For more messages you can translate, see: https://github.com/blurpy/kouchat/blob/master/src/main/resources/messages/swing.properties

    Mnemonic are shortcut keys, for navigating to menu elements using the keyboard. Like alt+"mnemonic key". {0} and other numbers are parameters being passed from code into the messages.

blurpy avatar Aug 09 '15 09:08 blurpy