LUA : how to get current language name ?

  • #1, by nelsoncFriday, 30. January 2015, 03:53 6 years ago
    How to get the current language name in LUA ?

    Newbie

    43 Posts


  • #2, by nelsoncFriday, 30. January 2015, 04:13 6 years ago
    if game:getLink(VGameSpeechLanguage):getName() == "English"
    doesn't seem to work

    Newbie

    43 Posts

  • #3, by afrlmeFriday, 30. January 2015, 12:14 6 years ago
    It's the standard language one. Speech language will return empty unless it is set. Speech language was added to 4.x so that you could define a different language for the speech instead of using the same language as the text / subtitles.

    shorthand example...
    if game.StandardLanguage:getName() == "English" then
    -- do something...
    elseif game.StandardLanguage:getName() == "German" then
    -- do something else
    end
    1
    2
    3
    4
    5
    6

    getobject example...
    if game:getLink(VGameStandardLanguage):getName() == "English" then
    -- do something...
    elseif game:getLink(VGameStandardLanguage):getName() == "German" then
    -- do something else...
    end
    1
    2
    3
    4
    5
    6

    Imperator

    6846 Posts

Write post