Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert (NOT TRANSLATE) Farsi letters to English letters like Google Translate in PHP

I want to convert Farsi letters to English letters in PHP and I don't want to translate them. In Farsi we call it Finglish or Pinglish as you can see here :

سلام -> Salam
علی -> Ali

and so on, I searched the web but didn't find any useful API to use. Any idea?

like image 404
Alireza Avatar asked Nov 16 '15 08:11

Alireza


People also ask

Does Google Translate have Farsi?

Google has also added Persian (Farsi) to Google Translate, making it easy to translate any text from Farsi into English and from English into Farsi.

How to enable google transliteration?

Clicking on the icon to toggle on/off the current transliteration or clicking on the arrow next to it to select another input tool. When Transliteration is toggled on, the button becomes a darker grey . When using a transliteration, type the word phonetically in Latin characters.

How do you say 12 months in Estonian Google Translate?

In the Estonian language, the phrase "12 months" is said "kaksteist kuud."


1 Answers

What you're describing is called transliteration or Romanization. You might want to try using Transliterator::transliterate, which uses ICU transliteration.

like image 110
rmtheis Avatar answered Oct 21 '22 09:10

rmtheis