The use field calculator, first define a key:value
map with matching values for latic/arabic characters. Something like this (here demonstrated with cyrillic characters, as I don't know arabic ones):
map('a','а','b','б','d','д')
meaning:
a -> а
b -> б
d -> д
Then you can create an array of all the characters of your input strings and for each look up the corresponding value
to this key
character. As we use an array, we have to convert it back to a string and remove the separating commas.
So the whole expression looks like what follows, where line 6 contains the map that you should adapt. text
in lines 4 and 7 is the input string.
As an option, you can define lines 5 and 6 (the key:value map with matching characters) as a project variable, let's call it translit
and then replace lines 5/6 in the following expression with eval(@translit)
(see second screenshot).
replace (
array_to_string (
array_foreach (
generate_series (1,length(text)),
map_get(
map('a','а','b','б','d','д','e','е','g','г','ž','ж','v','в','z','з','i','и','j','й','p','п','P','П','r','р','s','с','o','о','L','Л','n','н','B','Б','R','Р','m','м','M','М'),
substr( text, @element,1)
)
)
),
',',
''
)

