Skip to content

Commit b58a4c6

Browse files
committed
Added missing localization and fixed some translations
1 parent 7b128b2 commit b58a4c6

File tree

6 files changed

+45
-23
lines changed

6 files changed

+45
-23
lines changed

Assets/Localization/String Tables/Game Text_ar.asset

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,19 @@ MonoBehaviour:
142142
m_Metadata:
143143
m_Items: []
144144
- m_Id: 36438190223360
145-
m_Localized: "\u0627\u0644\u0625\u0646\u062C\u0644\u064A\u0632\u064A\u0629"
145+
m_Localized: "\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064A\u0629 (English)"
146146
m_Metadata:
147147
m_Items: []
148148
- m_Id: 36495383752704
149-
m_Localized: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629"
149+
m_Localized: "\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064A\u0629"
150150
m_Metadata:
151151
m_Items: []
152152
- m_Id: 36529051430912
153-
m_Localized: "\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064A\u0629"
153+
m_Localized: "\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064A\u0629 (Espa\xF1ol)"
154154
m_Metadata:
155155
m_Items: []
156156
- m_Id: 36559753736192
157-
m_Localized: "\u0627\u0644\u064A\u0627\u0628\u0627\u0646\u064A\u0629"
157+
m_Localized: "\u0627\u0644\u064A\u0627\u0628\u0627\u0646\u064A\u0629 (\u65E5\u672C\u8A9E)"
158158
m_Metadata:
159159
m_Items: []
160160
- m_Id: 36785994493952

Assets/Localization/String Tables/Game Text_en.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ MonoBehaviour:
6868
m_Metadata:
6969
m_Items: []
7070
- m_Id: 3801748762624
71-
m_Localized: "\u0635\u0639\u0628"
71+
m_Localized: Easy,Hard
7272
m_Metadata:
7373
m_Items: []
7474
- m_Id: 17127719464960

Assets/Localization/String Tables/Game Text_es.asset

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ MonoBehaviour:
7272
m_Metadata:
7373
m_Items: []
7474
- m_Id: 3801748762624
75-
m_Localized: "\u304B\u3093\u305F\u3093,\u3080\u305A\u304B\u3057\u3044"
75+
m_Localized: "F\xE1cil,Dif\xEDcil"
7676
m_Metadata:
7777
m_Items: []
7878
- m_Id: 17127719464960
@@ -140,28 +140,28 @@ MonoBehaviour:
140140
m_Metadata:
141141
m_Items: []
142142
- m_Id: 36438190223360
143-
m_Localized: "Ingl\xE9s"
143+
m_Localized: "Ingl\xE9s (English)"
144144
m_Metadata:
145145
m_Items: []
146146
- m_Id: 36495383752704
147-
m_Localized: "\xC1rabe (Espa\xF1ol)"
147+
m_Localized: "\xC1rabe (\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064A\u0629)"
148148
m_Metadata:
149149
m_Items: []
150150
- m_Id: 36529051430912
151-
m_Localized: "Espa\xF1ol (Spanish)"
151+
m_Localized: "Espa\xF1ol"
152152
m_Metadata:
153153
m_Items: []
154154
- m_Id: 36559753736192
155-
m_Localized: "Japon\xE9s (Japon\xE9s)"
155+
m_Localized: "Japon\xE9s (\u65E5\u672C\u8A9E)"
156156
m_Metadata:
157157
m_Items: []
158158
- m_Id: 36785994493952
159159
m_Localized: Idioma
160160
m_Metadata:
161161
m_Items: []
162162
- m_Id: 45343066714112
163-
m_Localized: "\xA1El juego ha terminado!\\n\\nEncontraste {completedWords:plural:{}
164-
palabra|{} palabras} de un total de {totalWords}."
163+
m_Localized: "\xA1El juego ha terminado!\\n\\nEncontraste {orderedWordCount:plural:{}
164+
palabra|{} palabras} de un total de {totalWordCount}."
165165
m_Metadata:
166166
m_Items:
167167
- rid: 2216566543976235779

Assets/Localization/String Tables/Game Text_ja.asset

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ MonoBehaviour:
7272
m_Metadata:
7373
m_Items: []
7474
- m_Id: 3801748762624
75-
m_Localized: Easy,Hard
75+
m_Localized: "\u304B\u3093\u305F\u3093,\u3080\u305A\u304B\u3057\u3044"
7676
m_Metadata:
7777
m_Items: []
7878
- m_Id: 17127719464960
@@ -140,19 +140,19 @@ MonoBehaviour:
140140
m_Metadata:
141141
m_Items: []
142142
- m_Id: 36438190223360
143-
m_Localized: "\u82F1\u8A9E"
143+
m_Localized: "\u82F1\u8A9E (English)"
144144
m_Metadata:
145145
m_Items: []
146146
- m_Id: 36495383752704
147-
m_Localized: "\u30A2\u30E9\u30D3\u30A2\u8A9E (\u30B9\u30DA\u30A4\u30F3\u8A9E)"
147+
m_Localized: "\u30A2\u30E9\u30D3\u30A2\u8A9E (\u0627\u0644\u0625\u0633\u0628\u0627\u0646\u064A\u0629)"
148148
m_Metadata:
149149
m_Items: []
150150
- m_Id: 36529051430912
151-
m_Localized: "\u30B9\u30DA\u30A4\u30F3\u8A9E (\u30A8\u30B9\u30D1\u30CB\u30E7\u30FC\u30EB)"
151+
m_Localized: "\u30B9\u30DA\u30A4\u30F3\u8A9E (Espa\xF1ol)"
152152
m_Metadata:
153153
m_Items: []
154154
- m_Id: 36559753736192
155-
m_Localized: "\u65E5\u672C\u8A9E (\u306B\u307B\u3093\u3054)"
155+
m_Localized: "\u65E5\u672C\u8A9E"
156156
m_Metadata:
157157
m_Items: []
158158
- m_Id: 36785994493952

Assets/Resources/UITk/MainView.uxml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
<ui:VisualElement name="root" style="flex-grow: 1;">
44
<ui:VisualElement name="background" style="flex-grow: 1; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background-color: rgb(11, 163, 109);"/>
55
<ui:VisualElement name="viewContainer" style="flex-grow: 1;">
6-
<Unity.Samples.LetterSpell.StackView name="stackView" index="4" style="flex-grow: 1;">
6+
<Unity.Samples.LetterSpell.StackView name="stackView" index="0" style="flex-grow: 1;">
77
<ui:VisualElement name="splashView" style="flex-grow: 1; background-image: url(&quot;project://database/Assets/UI/Images/Splash-Screen.png?fileID=4602334432413793429&amp;guid=364b68ded9ed04f07848b6c7de25fdad&amp;type=3#Intro Screen_0&quot;);">
8-
<ui:Label text="A fun spelling game" name="splashSubTitle"/>
8+
<ui:Label text="A fun spelling game" name="splashSubTitle">
9+
<Bindings>
10+
<UnityEngine.Localization.LocalizedString property="text" table="GUID:cc1d194facb1d9d4380a9ea2032c10ca" entry="Id(1486964262072320)"/>
11+
</Bindings>
12+
</ui:Label>
913
</ui:VisualElement>
1014
<ui:VisualElement name="loginView" style="flex-grow: 1; align-items: center; justify-content: center;">
1115
<ui:VisualElement name="logo" class="lsp-logo"/>
@@ -126,10 +130,11 @@
126130
</Bindings>
127131
</ui:RadioButton>
128132
</ui:VisualElement>
129-
<ui:Toggle label="Show Spelling Clues" name="settingsShowSpellingClues" text="On">
133+
<ui:Toggle label="Show Spelling Clues" name="settingsShowSpellingClues">
130134
<Bindings>
131135
<ui:DataBinding property="value" data-source-path="showsSpellingClues" binding-mode="TwoWay"/>
132136
<UnityEngine.Localization.LocalizedString property="label" table="GUID:cc1d194facb1d9d4380a9ea2032c10ca" entry="Id(17491977990144)"/>
137+
<UnityEngine.Localization.LocalizedString property="text" table="GUID:cc1d194facb1d9d4380a9ea2032c10ca" entry="Id(1784705072656384)"/>
133138
</Bindings>
134139
</ui:Toggle>
135140
<UnityEngine.Localization.LanguageSelection table-name="Game Text">

Assets/Scripts/UITk/MainView.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public float displaySize
178178

179179
public event EventHandler<BindablePropertyChangedEventArgs> propertyChanged;
180180

181-
void Notify([CallerMemberName] string property = "")
181+
public void Notify([CallerMemberName] string property = "")
182182
{
183183
propertyChanged?.Invoke(this, new BindablePropertyChangedEventArgs(property));
184184
}
@@ -357,7 +357,12 @@ void SetupUI()
357357
m_GameView = m_StackView.Q("gameView");
358358

359359
m_ClueLabel = m_GameView.Q<Label>("clueLabel");
360-
m_ClueLabel.GetOrCreateAccessibleProperties().label = LocalizationSettings.StringDatabase.GetLocalizedString("Game Text", "CLUE_LABEL");
360+
var localizedClue = new LocalizedString
361+
{
362+
TableReference = "Game Text",
363+
TableEntryReference = "CLUE_LABEL"
364+
};
365+
localizedClue.StringChanged += s => m_ClueLabel.GetOrCreateAccessibleProperties().label = s;
361366

362367
m_SuccessPill = m_GameView.Q("successPill");
363368
m_SuccessPill.GetOrCreateAccessibleProperties().ignored = true;
@@ -368,7 +373,12 @@ void SetupUI()
368373

369374
m_PauseGameButton = m_GameView.Q<Button>("pauseGameButton");
370375
m_PauseGameButton.clicked += ShowExitGamePopup;
371-
m_PauseGameButton.GetOrCreateAccessibleProperties().label = LocalizationSettings.StringDatabase.GetLocalizedString("Game Text", "PAUSE_LABEL");
376+
var localizedPause = new LocalizedString
377+
{
378+
TableReference = "Game Text",
379+
TableEntryReference = "PAUSE_LABEL"
380+
};
381+
localizedPause.StringChanged += s => m_PauseGameButton.GetOrCreateAccessibleProperties().label = s;
372382

373383
m_NextWordButton = m_GameView.Q<Button>("nextWordButton");
374384
m_NextWordButton.clicked += ShowNextWord;
@@ -416,6 +426,13 @@ void SetupUI()
416426
OnClosedCaptioningStatusChanged(AccessibilitySettings.isClosedCaptioningEnabled);
417427
OnFontScaleValueChanged(AccessibilitySettings.fontScale);
418428

429+
LocalizationSettings.SelectedLocaleChanged += loc =>
430+
{
431+
// Trigger the bound strings to update.
432+
m_PlayerSettings.Notify("boldTextEnabledText");
433+
m_PlayerSettings.Notify("closedCaptionsEnabledText");
434+
};
435+
419436
ShowSplash();
420437
}
421438

0 commit comments

Comments
 (0)