Insality / defold-lang

Defold Localization Helper
MIT License
17 stars 0 forks source link

Add method for getting next language #3

Closed boruok closed 1 month ago

boruok commented 1 month ago

Is possible to add new method for getting next lang?

current workaround is

local get_next_lang = function()
    local langs = lang.get_langs()
    for i, _ in ipairs(langs) do
        if langs[i] == lang.get_lang() then
            return langs[(i % #langs) + 1]
        end
    end
end
Insality commented 1 month ago

Sounds neat to add it. Can be useful for some cases

Insality commented 1 month ago

Solver in release 3 https://github.com/Insality/defold-lang/archive/refs/tags/3.zip