Skip to content

Commit

Permalink
Merge pull request #4 from GenZmeY/default_lang
Browse files Browse the repository at this point in the history
Default lang + more localization (BoxPainterLib)
  • Loading branch information
GenZmeY committed Jun 27, 2023
2 parents 049a101 + fdf420a commit ac4f2cf
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 3 deletions.
Binary file added Localization/CHN/YAS.CHN
Binary file not shown.
Binary file added Localization/CHT/YAS.CHT
Binary file not shown.
Binary file added Localization/CZE/YAS.CZE
Binary file not shown.
Binary file added Localization/DAN/YAS.DAN
Binary file not shown.
Binary file added Localization/DEU/YAS.DEU
Binary file not shown.
Binary file added Localization/ESN/YAS.ESN
Binary file not shown.
Binary file added Localization/FRA/YAS.FRA
Binary file not shown.
Binary file added Localization/HUN/YAS.HUN
Binary file not shown.
Binary file modified Localization/INT/YAS.INT
Binary file not shown.
Binary file added Localization/ITA/YAS.ITA
Binary file not shown.
Binary file added Localization/JPN/YAS.JPN
Binary file not shown.
Binary file added Localization/KOR/YAS.KOR
Binary file not shown.
Binary file added Localization/POL/YAS.POL
Binary file not shown.
Binary file added Localization/POR/YAS.POR
Binary file not shown.
Binary file added Localization/PTB/YAS.PTB
Binary file not shown.
Binary file modified Localization/RUS/YAS.RUS
Binary file not shown.
Binary file added Localization/TUR/YAS.TUR
Binary file not shown.
Binary file added Localization/UKR/YAS.UKR
Binary file not shown.
34 changes: 34 additions & 0 deletions YAS/Classes/YAS_LocalMessage.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class YAS_LocalMessage extends Object
abstract;

var const String PlayersDefault;
var private localized String Players;

var const String SpectatorsDefault;
var private localized String Spectators;

enum E_YAS_LocalMessageType
{
YAS_Players,
YAS_Spectators
};

public static function String GetLocalizedString(E_YAS_LocalMessageType LMT)
{
switch (LMT)
{
case YAS_Players:
return (default.Players != "" ? default.Players : default.PlayersDefault);
case YAS_Spectators:
return (default.Spectators != "" ? default.Spectators : default.SpectatorsDefault);
}

return "";
}

defaultproperties
{
PlayersDefault = "Players"
SpectatorsDefault = "Spectators"
}
8 changes: 5 additions & 3 deletions YAS/Classes/YAS_ScoreBoard.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class YAS_ScoreBoard extends KFGUI_Page
dependson(YAS_Types);

const LocalMessage = class'YAS_LocalMessage';

const HeaderWidthRatio = 0.30f;
const PlayerListWidthRatio = 0.6f;
const PlayerEntryHeightMod = 1.05f;
Expand Down Expand Up @@ -50,8 +52,6 @@ var KFPlayerController OwnerPC;
var Color PingColor;
var float PingBars;

var localized String Players, Spectators;

// Cache
var public Array<YAS_RepInfoPlayer> RepInfos;

Expand Down Expand Up @@ -430,7 +430,9 @@ function DrawMenu()
*/
Canvas.SetDrawColorStruct(Settings.Style.PlayerCountTextColor);
S = Players $ ":" @ NumPlayer @ "/" @ KFGRI.MaxHumanCount $ " " $ Spectators $ ": " $ NumSpec; ;
S = LocalMessage.static.GetLocalizedString(YAS_Players) $ ":"
@ NumPlayer @ "/" @ KFGRI.MaxHumanCount $ " "
$ LocalMessage.static.GetLocalizedString(YAS_Spectators) $ ": " $ NumSpec; ;
Canvas.TextSize(S, XL, YL, FontScalar, FontScalar);
DrawTextShadowHLeftVCenter(S, BoxX + EdgeSize, YPos, BoxH, FontScalar);
Expand Down

0 comments on commit ac4f2cf

Please sign in to comment.