Skip to content

Commit 60f5c20

Browse files
authored
Merge pull request #10 from CreativeHandOficial/feat/OrganizationAndImprovements
Feat/organization and improvements
2 parents d9df4f7 + 3ec9784 commit 60f5c20

File tree

12 files changed

+180
-171
lines changed

12 files changed

+180
-171
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This function is responsible for configuring the creation of the locations confi
4444

4545
> I recommend using the object `oSetupi18n` to speed up initial setup
4646
47-
```
47+
```js
4848
@desc Method for configuring in18 within your project, using locations as parameters. The default location. And a return location if there is no requested structure.
4949
@param {array} _locales* Required Locales configuration array, must contain code, file and lang
5050
@param {string} _defaultLocale* Required Setting the default location
@@ -70,12 +70,12 @@ gmi18nSetup(locales, defaultLocale, fallBackLocale);
7070

7171
This function is responsible for returning the text that was configured in the json file of the chosen location
7272

73-
```
74-
@desc Method responsible for returning the text within the .json file of the previously chosen location
75-
@param {string} _param* | Required | Structure created within your .json localization file
76-
@param {string} _varName | Optional | The name of the variable that must remain static
77-
@returns {string} Returns the text chosen in the parameter
78-
@example
73+
```js
74+
// @desc Method responsible for returning the text within the .json file of the previously chosen location
75+
// @param {string} _param* | Required | Structure created within your .json localization file
76+
// @param {string} _varName | Optional | The name of the variable that must remain static
77+
// @returns {string} Returns the text chosen in the parameter
78+
// @example
7979

8080
// Search for the welcome text according to the chosen location
8181
draw_text(x, y, useTranslation('welcome'));
@@ -93,7 +93,7 @@ It is possible to abbreviate the `useTranslation()` call, to make the code less
9393

9494
Example:
9595

96-
```
96+
```js
9797
// Create
9898
t = method(self, useTranslation);
9999

@@ -106,7 +106,7 @@ draw_text(x, y, t('welcome'));
106106

107107
Method responsible for updating objects' create event variables
108108

109-
```
109+
```js
110110
// Begin Step
111111

112112
reloadValuesWhenExchanged();
@@ -117,10 +117,10 @@ reloadValuesWhenExchanged();
117117

118118
Change your current location
119119

120-
```
121-
@desc Method responsible for making the language localization change
122-
@param {string} _locale* Required Location to be changed
123-
@example
120+
```js
121+
// @desc Method responsible for making the language localization change
122+
// @param {string} _locale* Required Location to be changed
123+
// @example
124124

125125
// Changing the language to pt-BR
126126

@@ -131,7 +131,7 @@ switchLocale("pt-BR");
131131

132132
Returns the current location code
133133

134-
```
134+
```js
135135
@desc Returns the current chosen location
136136
@returns {string} _locale Return the code
137137
@example
@@ -145,10 +145,10 @@ getCurrentLocale();
145145

146146
Returns an array with all the locations configured during setup
147147

148-
```
149-
@desc Returns an array with all the locations configured during setup
150-
@returns {Array} _locales Return all locations configured in the setup
151-
@example
148+
```js
149+
// @desc Returns an array with all the locations configured during setup
150+
// @returns {Array} _locales Return all locations configured in the setup
151+
// @example
152152

153153
// Returns the following array:
154154
// [

datafiles/en-US.json renamed to datafiles/GMi18n/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"welcome": "Welcome",
2+
"welcome": "Welcome {0} {1}",
33
"item": {
44
"potion": {
55
"hp": "Potion HP"

datafiles/es-ES.json renamed to datafiles/GMi18n/es-ES.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"welcome": "Bienvenido",
2+
"welcome": "Bienvenido {0} {1}",
33
"item": {
44
"potion": {
55
"hp": "Pocion",

datafiles/PT-br.json renamed to datafiles/GMi18n/pt-BR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"welcome": "Bem vindo",
2+
"welcome": "Bem vindo {0} {1}",
33
"item": {
44
"potion": {
55
"hp": "Pocao"

gm-i18n.resource_order

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
{"name":"Fonts","order":7,"path":"folders/Fonts.yy",},
44
{"name":"Objects","order":9,"path":"folders/Objects.yy",},
55
{"name":"Rooms","order":10,"path":"folders/Rooms.yy",},
6-
{"name":"Scripts","order":11,"path":"folders/Scripts.yy",},
7-
{"name":"gmi18n","order":1,"path":"folders/Scripts/gmi18n.yy",},
86
{"name":"Sprites","order":1,"path":"folders/Sprites.yy",},
7+
{"name":"GMi18n","order":12,"path":"folders/GMi18n.yy",},
8+
{"name":"Objects","order":3,"path":"folders/GMi18n/Objects.yy",},
9+
{"name":"Scripts","order":4,"path":"folders/GMi18n/Scripts.yy",},
910
],
1011
"ResourceOrderSettings": [
1112
{"name":"utilsGmI18n","order":1,"path":"scripts/utilsGmI18n/utilsGmI18n.yy",},
1213
{"name":"oDebug","order":2,"path":"objects/oDebug/oDebug.yy",},
1314
{"name":"rText","order":1,"path":"rooms/rText/rText.yy",},
1415
{"name":"oText","order":3,"path":"objects/oText/oText.yy",},
16+
{"name":"oSetupi18n","order":1,"path":"objects/oSetupi18n/oSetupi18n.yy",},
1517
{"name":"oWelcome","order":4,"path":"objects/oWelcome/oWelcome.yy",},
1618
{"name":"sBrand","order":1,"path":"sprites/sBrand/sBrand.yy",},
1719
{"name":"oLang","order":1,"path":"objects/oLang/oLang.yy",},

gm-i18n.yyp

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objects/oSetupi18n/oSetupi18n.yy

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objects/oWelcome/Draw_0.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/// @description Test
1+
/// @description Test
22
draw_set_valign(fa_middle);
3-
draw_text(32, room_height / 2, nameVar);
3+
draw_text(32, room_height / 2, string_ext(nameVar, ["Creative", "Hand"]));

0 commit comments

Comments
 (0)