From 0d9b6d33e3b587b6e060a258f87dc5843a1d0a07 Mon Sep 17 00:00:00 2001
From: schwarper <75811921+schwarper@users.noreply.github.com>
Date: Tue, 11 Jun 2024 22:20:25 +0300
Subject: [PATCH] Added lang support
---
Store/lang/ch.json | 4 ++++
Store/lang/en.json | 6 +++++-
Store/lang/pt-BR.json | 6 +++++-
Store/lang/ru.json | 6 +++++-
Store/lang/sl.json | 6 +++++-
Store/lang/tr.json | 6 +++++-
Store/lang/ua.json | 6 +++++-
Store/src/menu/WASDMenu/Classes/WasdMenuPlayer.cs | 13 ++++---------
8 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/Store/lang/ch.json b/Store/lang/ch.json
index 5b91117..4dbcba1 100644
--- a/Store/lang/ch.json
+++ b/Store/lang/ch.json
@@ -26,6 +26,10 @@
"Speed expired": "{white}你的加速时间已过.",
"menu.bottom.text": " [ WASD - 移动 ]
[ - 退出 ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Store [你的积分: {0}]",
diff --git a/Store/lang/en.json b/Store/lang/en.json
index bdb4ac4..1a927b0 100644
--- a/Store/lang/en.json
+++ b/Store/lang/en.json
@@ -25,7 +25,11 @@
"Godmode expired": "{white}Your godmode time is expired.",
"Speed expired": "{white}Your speed time is expired.",
- "menu_store": " [ WASD - To Move ]
[ - To Exit ]",
+ "menu.buttom.text": " [ WASD - To Move ]
[ - To Exit ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Store [Your credits: {0}]",
diff --git a/Store/lang/pt-BR.json b/Store/lang/pt-BR.json
index 008a451..2daf93f 100644
--- a/Store/lang/pt-BR.json
+++ b/Store/lang/pt-BR.json
@@ -25,7 +25,11 @@
"Godmode expired": "{white}Seu tempo de godmode expirou.",
"Speed expired": "{white}Seu tempo de velocidade expirou.",
- "menu_store": " [ WASD - Para mover ]
[ - Sair ]",
+ "menu.buttom.text": " [ WASD - Para mover ]
[ - Sair ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Loja [Seus créditos: {0}]",
diff --git a/Store/lang/ru.json b/Store/lang/ru.json
index b462812..8f76cb4 100644
--- a/Store/lang/ru.json
+++ b/Store/lang/ru.json
@@ -25,7 +25,11 @@
"Godmode expired": "{white}Время вашего бессмертия истекло.",
"Speed expired": "{white}Время вашей скорости истекло.",
- "menu_store": " [ WASD - Чтобы переехать ]
[ - Выйти с сайта ]",
+ "menu.buttom.text": " [ WASD - Чтобы переехать ]
[ - Выйти с сайта ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Магазин [Ваши кредиты: {0}]",
diff --git a/Store/lang/sl.json b/Store/lang/sl.json
index bbf10f3..2544bee 100644
--- a/Store/lang/sl.json
+++ b/Store/lang/sl.json
@@ -25,7 +25,11 @@
"Godmode expired": "{white}Vaš čas boga načina je potekel.",
"Speed expired": "{white}Vaš hitrostni čas je potekel.",
- "menu_store": " [ WASD - Premikanje ]
[ - Izstopite iz ]",
+ "menu.buttom.text": " [ WASD - Premikanje ]
[ - Izstopite iz ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Trgovina [Vaši krediti: {0}]",
diff --git a/Store/lang/tr.json b/Store/lang/tr.json
index c6756ea..91699a5 100644
--- a/Store/lang/tr.json
+++ b/Store/lang/tr.json
@@ -25,7 +25,11 @@
"Godmode expired": "{white}Godmode süreniz bitti.",
"Speed expired": "{white}Hızlı koşma süreniz bitti.",
- "menu_store": " [ WASD - Hareket ]
[ - Çıkış ]",
+ "menu.buttom.text": " [ WASD - Hareket ]
[ - Çıkış ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Market [Krediniz: {0}]",
diff --git a/Store/lang/ua.json b/Store/lang/ua.json
index 2a844b5..05f918f 100644
--- a/Store/lang/ua.json
+++ b/Store/lang/ua.json
@@ -25,7 +25,11 @@
"Godmode expired": "{white}Час вашого богомоду закінчився.",
"Speed expired": "{white}Час вашої швидкості закінчився.",
- "menu_store": " [ WASD - Перемістити ]
[ - Виходьте ]",
+ "menu.bottom.text": " [ WASD - Перемістити ]
[ - Виходьте ]",
+ "menu.selection.left": " ",
+ "menu.selection.right": " ",
+ "menu.selection.prefix": "",
+ "menu.selection.optionsbelow": " ",
"menu_store": "Магазин [Ваші кредити: {0}]",
diff --git a/Store/src/menu/WASDMenu/Classes/WasdMenuPlayer.cs b/Store/src/menu/WASDMenu/Classes/WasdMenuPlayer.cs
index 990ec56..f30e6a9 100644
--- a/Store/src/menu/WASDMenu/Classes/WasdMenuPlayer.cs
+++ b/Store/src/menu/WASDMenu/Classes/WasdMenuPlayer.cs
@@ -7,11 +7,6 @@ namespace Store;
public class WasdMenuPlayer
{
- public const string MenuSelectionLeft = "";
- public const string MenuSelectionRight = "";
- public const string Prefix = "";
- public const string OptionsBelow = " ";
-
public CCSPlayerController player = null!;
public WasdMenu? MainMenu = null;
public LinkedListNode? CurrentChoice = null;
@@ -128,13 +123,13 @@ private void UpdateCenterHtml()
LinkedListNode? option = MenuStart!;
if (option.Value.Parent?.Title != "")
{
- builder.AppendLine($"{Prefix}{option.Value.Parent?.Title}
");
+ builder.AppendLine($"{Instance.Localizer["menu.prefix"]}{option.Value.Parent?.Title}
");
}
while (i < VisibleOptions && option != null)
{
if (option == CurrentChoice)
- builder.AppendLine($"{MenuSelectionLeft} {option.Value.OptionDisplay} {MenuSelectionRight}
");
+ builder.AppendLine($"{Instance.Localizer["menu.selection.left"]} {option.Value.OptionDisplay} {Instance.Localizer["menu.selection.right"]}
");
else
builder.AppendLine($"{option.Value.OptionDisplay}
");
option = option.Next;
@@ -144,11 +139,11 @@ private void UpdateCenterHtml()
if (option != null)
{
builder.AppendLine(
- $"{OptionsBelow}");
+ $"{Instance.Localizer["menu.selection.optionsbelow"]}");
}
builder.AppendLine("
" +
- $"{Instance.Localizer["menu_store"]}
");
+ $"{Instance.Localizer["menu.bottom.text"]}
");
builder.AppendLine("");
CenterHtml = builder.ToString();
}