Skip to content

Latest commit

 

History

History
70 lines (65 loc) · 2.86 KB

Exports.md

File metadata and controls

70 lines (65 loc) · 2.86 KB

Exported Functions

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.

I/O

  • input: string.
  • return: string.

Example

local rtl = "اللاعب Yaser متصل اللآن"
print(SupportArabic:redirect(rtl)) -- "متصل اللآن Yaser اللاعب"

Raw linking & reversing.

I/O

  • sentence: string.
  • return: string.

Example

local aFullArabicText = "أهلا بك" -- (hello there)
AddTextEntry('AR_NOTIFICATION', SupAr:reverse(aFullArabicText)) -- ﻚﺑ ﻼﻫﺃ

Raw unlinking & irreversing.

I/O

  • sentence: string.
  • return: string.

Example

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.

I/O

  • input: string.
  • tags: string (optional).
  • font: string (optional).
  • return: string.

Example

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.

I/O

  • input: string`.
  • tags: boolean.
  • return: string.

Example

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