You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Fakemon/Locale.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Locale
2
-
The Locale extension allows developers to manualy register translations for text rather than using an external server like the Translate extension. It is designed for those who want control over the translations.
2
+
Locale allows developers to manually register translations of text and get information about languages. It was designed to simplify the process of including manually-curated translations in projects and mitigate the need for automatic translations such as those provided by the Translate extension.
3
3
4
4
> [!NOTE]
5
-
> Some of these blocks use JSON, a format for storing data in key-value pairs. The JSON extension will make these blocks much easier to use, especially for beginners.
5
+
> Many of these blocks use JSON, a format for storing data in key-value pairs. The JSON extension will make these blocks much easier to use, especially for beginners.
6
6
7
7
8
8
## Working With Translation Information
@@ -34,7 +34,7 @@ If you need to merge the existing the existing information with something new, u
34
34
```scratchblocks
35
35
merge current translation information with JSON [{}] ::#2a5fa0
36
36
```
37
-
This block takes the current translation information and sets the values of the keys defined in the input to their new values. This can both replace and add new keys.
37
+
This block uses the newly-provided JSON to update the existing global translation information by keeping the information that only exists in the original object and adding the new object's values from there. Keys from both objects will use the new values.
38
38
39
39
You can get the global information with this block:
When updating this extension's block info, make sure to also update the documentation (/docs/Fakemon/Locale.md).
9
-
This is most important for adding new blocks, but should also be done for changing block text to avoid confusion.
10
-
11
-
Additionally, do NOT remove the TypeScript comments (//@ts-ignore); it doesn't like my code :(
8
+
When updating this extension's block info, please also update the documentation (/docs/Fakemon/Locale.md). Thanks!
12
9
*/
13
10
14
11
(asyncfunction(Scratch){
@@ -31,7 +28,7 @@ Additionally, do NOT remove the TypeScript comments (//@ts-ignore); it doesn't l
31
28
*/
32
29
letlanguageNameAndCodeLookupTableGLOBALIZED;
33
30
// This is a backup of the lookup table in case the user is offline. It may not always be up-to-date.
34
-
// TODO: use a build script to automatically get the latest version of the table to put in here (and maybe also make a version of Locale without this hefty object)
31
+
// TODO: use a build script to automatically get the latest version of the table to put in here (and maybe also make a version of Locale without this hefty chonker)
35
32
constbackupTable={
36
33
menuMap: {
37
34
am: [
@@ -15659,7 +15656,7 @@ Additionally, do NOT remove the TypeScript comments (//@ts-ignore); it doesn't l
defaultValue: `{"${Scratch.translate("Apples and bananas")}":"Manzanas y plátanos"}`,
15730
15727
},
15731
15728
},
15732
15729
},
@@ -15933,7 +15930,7 @@ Additionally, do NOT remove the TypeScript comments (//@ts-ignore); it doesn't l
15933
15930
Scratch.translate(
15934
15931
`This button will ${showRecreatableBlocks ? "hide" : "show"} blocks that can be recreated with other extensions or require values set by these blocks.`
15935
15932
)
15936
-
);// Explain what the button does
15933
+
);
15937
15934
if(
15938
15935
confirm(
15939
15936
Scratch.translate(
@@ -15997,7 +15994,10 @@ Additionally, do NOT remove the TypeScript comments (//@ts-ignore); it doesn't l
15997
15994
mergePerLangLocaleJSON(args){
15998
15995
letbackupLocaleObject=localeObject;// Save a backup in case something breaks
0 commit comments