Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Localization

    General and Desktop
    1
    2
    217
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dsba last edited by

      Hi,
      I am trying to localize audio of Qt android application. In order to this, I have written a say method in activity.java file..
      public static void say(String msg) {
      System.out.println("Say: " + msg);
      mtts.speak(msg, TextToSpeech.QUEUE_FLUSH, null, "msgId");
      mtts.speak(msg, TextToSpeech.QUEUE_ADD, null, "msgId");
      }
      When I switch language English works fine but when I change language to Japanese, then same English words are read in Japanese accent instead of reading whole Japanese translated string.

      Can anyone please help with this issue.

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • D
        dsba last edited by

        At this line System.out.println("Say: " + msg); translated text was not getting printed then I made QCoreApplication::translate on passing arguments.. this worked fine..

        Example:
        say(QCoreApplication::translate("MainWindowInput", inText.toStdString().c_str()));

        where MainWindowInput is context name and inText is const String&

        1 Reply Last reply Reply Quote 0
        • First post
          Last post