M
m4meteor
Guest
In my game I have setup a localization system using an included .ini file. The strings.ini file looks like this
Now in my game i have set-up a script, that looks like this
So, now when I want to have a string translated to russian and english, for example, instead of putting
, I would put
Which would still be equal to "Resume" if global.language = lang.english but if global.language = lang.russian it would be equal to "Продолжить" which is the translation I want. Until here it is all ok, but when I get to print the string in Russian it prints boxes.
Please note: I have a font that supports all Cyrillic letters and I have added a range for all the cyrrilic letters, yet still this problem happens. I also know that the problem isn't in the font because when I simply print a russian string without using the string_lang script it prints it perfectly.
From my debug testing I know that the problem is when the string_lang reads the Russian strings from the .ini file. I know that because i've setup a variable be equal to string_lang(101) when language is Russian and from the debugger I can see that the variable is equal to "����������" instead of "Продолжить".
Briefly:
The problem is when I read a cyrillic string from a .ini file, Gamemaker returns it as strange boxes ("��������")
How do I fix this?
Code:
[english]
101=Resume
102=Settings
103=Quit
104=Video
105=Audio
106=Controls
107=Back
108=Resolution
109=Fullscreen mode
110=Master
111=SFX
112=Music
113=Walk left
114=Walk right
115=Jump
116=Climb/Up
117=Descend/Down
118=General
119=Language
120=English
121=Russian
122=On
123=Off
[russian]
101=Продолжить
102=Настройки
103=Выйти
104=Видео
105=Аудио
106=Управление
107=Назад
108=Расшерение экрана
109=Полноэкранный режим
110=Мастер
111=Эффекты
112=Музыка
113=Идти налево
114=Идти направо
115=Прыгать
116=Подниматься/Вверх
117=Спускаться/Вниз
118=Основные
119=Язык
120=Англиский
121=Русский
122=Вкл
123=Выкл
Code:
///@desc string_lang(ini_index)
///@arg ini_index
var search = argument0;
switch (global.language)
{
case lang.english: var language = "english"; break;
case lang.russian: var language = "russian"; break;
}
ini_open("strings.ini");
var find_string = ini_read_string(language, string(search), "Error");
ini_close();
return find_string;
Code:
var text = "Resume"
Code:
var text = string_lang(101)
Please note: I have a font that supports all Cyrillic letters and I have added a range for all the cyrrilic letters, yet still this problem happens. I also know that the problem isn't in the font because when I simply print a russian string without using the string_lang script it prints it perfectly.
From my debug testing I know that the problem is when the string_lang reads the Russian strings from the .ini file. I know that because i've setup a variable be equal to string_lang(101) when language is Russian and from the debugger I can see that the variable is equal to "����������" instead of "Продолжить".
Briefly:
The problem is when I read a cyrillic string from a .ini file, Gamemaker returns it as strange boxes ("��������")
How do I fix this?
Last edited by a moderator: