Hello!
I’m wondering how I would go about translating a string that constantly changes.
For example, this code:
local replicatedFirst = script.Parent
local contentProvider = game:GetService('ContentProvider')
local players = game:GetService('Players')
local playerUI = players.LocalPlayer.PlayerGui
replicatedFirst:RemoveDefaultLoadingScreen()
local UI = Instance.new('ScreenGui', playerUI)
UI = Instance.new('Frame', UI)
UI.Size = UDim2.new(1,0,2,0)
UI.Position = UDim2.new(0,0,-1,0)
UI = Instance.new('TextLabel')
UI.Text = 'Waiting for assets'
UI.Size = UDim2.new(1,0,0.5,0)
UI.Position = UDim2.new(0,0,0.5,0)
UI.TextSize = 40
UI.AutoLocalize = true
UI.Visible = true
UI.BackgroundColor3 = Color3.new(1,1,1)
UI.TextXAlignment = 'Center'
UI.TextYAlignment = 'Center'
local assetsToPreLoad = {}
for i,v in ipairs(game:GetChildren()) do
local s,e = pcall(function()
service = game:GetService(v.Name)
end)
if s then
table.insert(assetsToPreLoad, #assetsToPreLoad + 1, service)
end
end
local t = {
[1] = '.';
[2] = '..';
[3] = '...';
}
for i = 1, math.huge do
UI.Text = 'Waiting for assets'..t[(i % 3) + 1]
wait(.5)
end
The text changes to ‘Waiting for assets.’, ‘…’, ‘…’
The problem is that when translating, it should change to ‘En attente des objets de jeu.’, ‘…’, ‘…’ but it stays in English.
Now, when I make it say ‘Waiting for assets’ and keep the text the same, it translates properly.
Any help?