Gamemaker - LanguageSystem
A downloadable LanguageSystem
HOW TO DOWNLOAD AND IMPORT
- Click the download button at the bottom of the page.
- Drag the downloaded yymps file into GameMaker.
Click the "Yes" button
Select the two folders, click the add button and press the Import button.
Optional Variables
Double-click the Language Script file.
If you want to change the default language;
If you want to change the name of the folder with the languages;
CREATE LANGUAGE FILES
To create your language files, open the menu from Assets browser. Included Files > Open In Explorer
In the window that appears, create a folder called the default language folder.
and by default, create en.json file.
and enter these values in it by default;
{"en": {
"LanguageName": "English"
}
}
Change "en" and "English" to your language file in this section. For example, if your file name is "tr.json", you should change the values here to "tr" and "Turkish".
The more languages you want to add to your game, the more files you have to create.
In order to translate the text in your game, you need to write the default and value to these json files. ex :"default" : "translated text"
For example, in my game, there are texts "Play","Options","Exit". then I have to write the following to the json files;
en.json
{
"en": {
"LanguageName": "English",
"Play": "Play",
"Options": "Options",
"Exit": "Exit"
}
}
tr.json
{
"tr": {
"LanguageName": "Turkish",
"Play": "Başla",
"Options": "Ayarlar",
"Exit": "Çıkış"
}
}
HOW TO USE
If you have created the language files you are now ready to use them in gamemaker
Put the object named "LanguageSystemController" in the room.
You can now use the "lang" function to translate a text!
lang("Play")
draw_text(10, 10, lang("Play") )
If you are creating your variables in the create event, you should use "lang_static" so that your text is updated when the language changes.
Create Event
LANGUAGE FUNCTIONS
lang(str)
Translate the text.
lang("Hello")
lang_set(lang_code)
Sets which language to translate all texts.
lang_set("en")
lang_length()
Returns the total number of languages.
var c = lang_length()
lang_static(variable_name, default_variable)
If you only translate a text once, it will automatically update the text when the language changes.
text = lang_length("text", "Hello")
langs_get_all()
Returns a list of all languages.
var langs = langs_get_all()
lang_get(index)
Returns the language, based on the given number.
var first_lang = lang_get(0)
Status | Released |
Category | Tool |
Rating | Rated 5.0 out of 5 stars (4 total ratings) |
Author | Enes Kaplan |
Made with | GameMaker |
Tags | GameMaker, language, tool |
Code license | MIT License |
Comments
Log in with itch.io to leave a comment.
guzel duruyor
Dostum bu bir harika!
Biliyorum 😂
Efsane bir otomatik ve manuel çeviri programı olmuş. Kesinlikle hayat kurtarıcı bir tool. Çalışmalarının devamını bekliyoruz ! 🖤🤍
Sağ ol 🖤🤍
It looks like super helpful and easy to use for Gamemaker users
Thanks!