From 6d497b5edf9dd7d77e166ff50f6a039b52300ed7 Mon Sep 17 00:00:00 2001 From: Jack T Date: Sun, 14 Apr 2024 14:34:17 -0700 Subject: [PATCH] Disable AutoLocalize (#19) --- src/create.lua | 20 ++++++++++++++++++++ src/widgets/row.lua | 1 + src/widgets/spinner.lua | 2 ++ 3 files changed, 23 insertions(+) diff --git a/src/create.lua b/src/create.lua index 01e8a3e..4fb4247 100644 --- a/src/create.lua +++ b/src/create.lua @@ -53,6 +53,22 @@ local Runtime = require(script.Parent.Runtime) print(ref.button.Text) --> hi ``` ]=] + +local GUI_BASE_2D = { + "CanvasGroup", + "Frame", + "ImageLabel", + "ScrollingFrame", + "TextLabel", + "TextButton", + "ViewportFrame", + "TextBox", + "VideoFrame", + "ScreenGui", + "BillboardGui", + "SurfaceGui", +} + local function create(className, props) props = props or {} @@ -60,6 +76,10 @@ local function create(className, props) local instance = Instance.new(className) + if props["AutoLocalize"] == nil and table.find(GUI_BASE_2D, className) then + props["AutoLocalize"] = false + end + for key, value in pairs(props) do if type(value) == "function" then if eventCallback then diff --git a/src/widgets/row.lua b/src/widgets/row.lua index 962463f..cf9f123 100644 --- a/src/widgets/row.lua +++ b/src/widgets/row.lua @@ -28,6 +28,7 @@ return Runtime.widget(function(options, fn) local refs = Runtime.useInstance(function(ref) local Frame = Instance.new("Frame") Frame.BackgroundTransparency = 1 + Frame.AutoLocalize = false local UIListLayout = Instance.new("UIListLayout") UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder diff --git a/src/widgets/spinner.lua b/src/widgets/spinner.lua index 3b51591..7329b9e 100644 --- a/src/widgets/spinner.lua +++ b/src/widgets/spinner.lua @@ -16,6 +16,7 @@ return Runtime.widget(function() local Frame = Instance.new("Frame") Frame.BackgroundTransparency = 1 Frame.Size = UDim2.new(0, 100, 0, 100) + Frame.AutoLocalize = false local ImageLabel = Instance.new("ImageLabel") ImageLabel.AnchorPoint = Vector2.new(0.5, 0.5) @@ -23,6 +24,7 @@ return Runtime.widget(function() ImageLabel.Image = "rbxassetid://2689141406" ImageLabel.Position = UDim2.new(0.5, 0, 0.5, 0) ImageLabel.Size = UDim2.new(0, 100, 0, 100) + ImageLabel.AutoLocalize = false ImageLabel.Parent = Frame ref.frame = Frame