Here you can find all the functions that are provided in the script.
Not be confused, in the following examples this variable would be used:
SupportArabic = exports['support-arabic']
Convert LTR string to be RTL and vice-versa.
input
: string.- return: string.
local rtl = "اللاعب Yaser متصل اللآن"
print(SupportArabic:redirect(rtl)) -- "متصل اللآن Yaser اللاعب"
Raw linking & reversing.
sentence
: string.- return: string.
local aFullArabicText = "أهلا بك" -- (hello there)
AddTextEntry('AR_NOTIFICATION', SupAr:reverse(aFullArabicText)) -- ﻚﺑ ﻼﻫﺃ
Raw unlinking & irreversing.
sentence
: string.- return: string.
SendNUIMessage({
action = "notify",
text = SupAr:irreverseUnlink(GetLabelText('AR_NOTIFICATION')) -- أهلا بك
})
Linking & reversing a hybrid string (only link & reverse Arabic).
This function assumes that the input string is redirected.
input
: string.tags
: string (optional).font
: string (optional).- return: string.
local playerName = GetPlayerName(whoever) -- say it's Yaser
local hybridText = "يريد منازلتك " .. playerName .. "اللاعب الملقب بـ" -- (The player Yaser wants to compete you)
AddTextEntry('AR_NOTIFICATION', SupAr:escape(hybridText)) -- ـﺑ ﺐﻘﻠﻤﻟﺍ ﺐﻋﻼﻟﺍYaser ﻚﺘﻟﺯﺎﻨﻣ ﺪﻳﺮﻳ
Unlinking & irreversing a hybrid string (only unlink & irreverse Arabic).
This function assumes that the input string is redirected.
input
: string`.tags
: boolean.- return: string.
local escapedHybridText = GetLabelText('AR_NOTIFICATION') -- ـﺑ ﺐﻘﻠﻤﻟﺍ ﺐﻋﻼﻟﺍYaser ﻚﺘﻟﺯﺎﻨﻣ ﺪﻳﺮﻳ
local parsedHybridText = SupAr:parse(escapedHybridText) -- اللاعب الملقب بـYaser يريد منازلتك
print(parsedHybridText) -- this is still LTR, you can't use it in UI (HTML) notifications, we'll talk about this