overrideLanguage doesn't work on build
- SweatyChair
- Topic Author
- Offline
- Junior Member
- We made innovative mobile games.
4 years 11 months ago - 4 years 11 months ago #4031
by SweatyChair
Always remember you're unique, just like everyone else.
overrideLanguage doesn't work on build was created by SweatyChair
I wanted to get a term in other lanuage, I use:
It's working fine in Editor, but not in an Android build, it returns the translation for CURRENT language.
Expected Output: 遊戯
Actual Output: Spiel (currently in Germany language)
I2.Loc.LocalizationManager.GetTranslation("Game", overrideLanguage: "Japanese")
It's working fine in Editor, but not in an Android build, it returns the translation for CURRENT language.
Expected Output: 遊戯
Actual Output: Spiel (currently in Germany language)
Always remember you're unique, just like everyone else.
Last edit: 4 years 11 months ago by SweatyChair.
Please Log in or Create an account to join the conversation.
- SweatyChair
- Topic Author
- Offline
- Junior Member
- We made innovative mobile games.
4 years 11 months ago - 4 years 11 months ago #4032
by SweatyChair
Always remember you're unique, just like everyone else.
Replied by SweatyChair on topic overrideLanguage doesn't work on build
After running some debug, I can find that the Languages in LanguageSource is empty except the current language:
Results in Editor:
Results in Android build:
var index = I2.Loc.LocalizationManager.Sources[0].GetLanguageIndex("Japanese");
print("japanese index=" + index);
var data = I2.Loc.LocalizationManager.Sources[0].GetTermData("Game");
print("data.Languages=" + StringUtils.ArrayToString(data.Languages));
var t = data.GetTranslation(index);
print("t=" + t);
Results in Editor:
japanese index=12
data.Languages=[Game,Juego,Jeu,Gioco,jogos,Spiel,oyun,Gra,Игра,гри,遊戲,游戏,ゲーム,경기,trò chơi,Тоглоом,laro,เกม]
t=Spiel
Results in Android build:
japanese index=12
data.Languages=[,,,,Spiel,,,,,,,,,,,,,,,]
t=
Always remember you're unique, just like everyone else.
Last edit: 4 years 11 months ago by SweatyChair.
Please Log in or Create an account to join the conversation.
4 years 10 months ago #4033
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic overrideLanguage doesn't work on build
Hi,
To save memory, I2 localization unloads the languages that are not in use, and loads them back when the current language is changed.
If you need to access some of the languages even if they are not the active language, then you need to set them to never unload. That can be done in the Languages tab of the Language source.
Hope that helps,
Frank
To save memory, I2 localization unloads the languages that are not in use, and loads them back when the current language is changed.
If you need to access some of the languages even if they are not the active language, then you need to set them to never unload. That can be done in the Languages tab of the Language source.
Hope that helps,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
- SweatyChair
- Topic Author
- Offline
- Junior Member
- We made innovative mobile games.
4 years 10 months ago #4034
by SweatyChair
Always remember you're unique, just like everyone else.
Replied by SweatyChair on topic overrideLanguage doesn't work on build
I see that means sense.
I just need 1 term so it seems not worth doing that, i may just hard code it for now.
I just need 1 term so it seems not worth doing that, i may just hard code it for now.
Always remember you're unique, just like everyone else.
Please Log in or Create an account to join the conversation.
Time to create page: 0.133 seconds