I’m working on custom localization and i tried testing changing the language by clicking a button. When I clicked on it when it said Spanish, it worked. But when I clicked on it when it said english it had delayed until the status value is different. Here’s how it worked:
Video: https://gyazo.com/f54117f746ebb4fcea463ce2412d99f7
Code:
for a,b in pairs(Holder:GetDescendants()) do
for d,c in pairs(DataPack) do
if c[2] == Holder.Name then
if c[1] == b.Name then
if d == b.Text or (d == OgDataPack[d]) then
print("C")
local HolderName = Holder.Name
local Obj = b.Name
local OGText = b.Text
if OgDataPack[OGText] and OgDataPack[OGText][1] == Obj and OgDataPack[OGText][2] == HolderName then
print(Lang)
b.Text = c[3]
end
end
end
end
end
end
Please use the inbuilt code system on the dev form, it’s very hard to read code like that!
for a,b in pairs(Holder:GetDescendants()) do
for d,c in pairs(DataPack) do
if c[2] == Holder.Name then
if c[1] == b.Name then
if d == b.Text or (d == OgDataPack[d]) then
print("C")
local HolderName = Holder.Name
local Obj = b.Name
local OGText = b.Text
if OgDataPack[OGText] and OgDataPack[OGText][1] == Obj and OgDataPack[OGText][2] == HolderName then
print(Lang)
b.Text = c[3]
end
end
end
end
end
end
Can you please elaborate on what you mean? Are you trying to tackle the amount of time it takes for it to show the new language text? What exactly is your issue? Can you please explain what Holder is, and give us more info on the setup? Thanks
Until the status value is changed, the text would stay in spanish, even if you switched it back to english. Holder is the gui that holds the object thats inside it.
Theres more code but i dont think they have anything to do with it. And the button event is innocent too. The datapacks are what cotain the translations for ex
[“OGText”] = {“Obj”,”Holder”,”Translation”}