Dostum bu bir harika!
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.
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;
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;
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!
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.
Translate the text.
Sets which language to translate all texts.
Returns the total number of languages.
var c = lang_length()
If you only translate a text once, it will automatically update the text when the language changes.
text = lang_length("text", "Hello")
Returns a list of all languages.
var langs = langs_get_all()
Returns the language, based on the given number.
var first_lang = lang_get(0)
Log in with itch.io to leave a comment.