How to add Arabic Support

Hello, I am looking to add Arabic support for my game, I just don’t know how due to language limitations.

1 Like

I can’t understand your topic at all, so here is a question.

What is it releated to

Do you want to add a option to translate arabic chat-text?
Or is it a language translating in a textbox/frame, etc,
else what is it?

1 Like

textbox/frame translations is what I need

1 Like

Sorry for delay, if i understanded you right you want to translate a text from your frame/textbox to arabic.

There’s no option for this, however you could do the following:

Use an API for language translating

There are multiple api’s for this take examples like: Translized, Google Translate API
However they’re paid.
If you’d prefer a locally run project you could use something like this: OpenNMT

Create your own translation via scripts

If you want to create it for certian words this is great for you!
Here’s an example on how you could create this

local word = "Hey, how are you doing?" -- assuming this is your text
function BuiltInTranslation(selword)
 -- translation goes here
     if string.match(selword, word) then
         return "مهلا كيف حالك؟"
     end
end

This is the most basic example, however if you want to make it organized you can create a modulescript with it’s translations, here’s how:

-- module/script
return {
	["Hey, how are you doing?"] = "مهلا كيف حالك؟",
	["I love arabic people!"] = "أحب الشعب العربي!",
	-- etc here..
}

Your localscript is primary for this, you can implement it like this:

-- local/script
local ArabicTranslation = require(script:FindFirstChild("ArabicTranslation")) -- assuming it's parented in the script and is named arabic translation
local IsArabic = true -- assuming you have checks for the player's country and they are arabic

task.spawn(function()
	while true do task.wait(0.1)
		local element = script.Parent:FindFirstChild("TextBox")
		if string.match(element.Text, "Hey, how are you doing?") then
			element.Text = ArabicTranslation["Hey, how are you doing?"]
		else
			return
		end
	end
end)

I do not gaurantee that this will work, there are better examples than this.
You could also only do this on your localscript/script by defining a table like:

local ArabicTranslation = {
	["Hey, how are you doing?"] = "مهلا كيف حالك؟",
	["I love arabic people!"] = "أحب الشعب العربي!",
}

If you have questions feel free to ask