-1

I want to make some words and phrases in different languages from Google Translator without translating it's actual meaning.Is it possible to convert the text to other languages rather than translating it.

Example:

i want plain conversion like cambridge - كامبردج, कैंब्रिज ,cambridge ,剑桥,Кембридж

i donot want translation like university - جامعة ,विश्वविद्यालय,universitet,大学, Университет

Shervin
  • 1,936
  • 17
  • 27
  • Hello and welcome to Stack Overflow, please take a time to go through the [welcome tour](https://stackoverflow.com/tour) to know your way around here (and also to earn your first badge), read how to create a [mcve] example and also check [ask] so you increase your chances to get feedback and useful answers. – garfbradaz Aug 03 '17 at 14:26

1 Answers1

0

Yes. This is called "transliteration". There are multiple ways to do it programmatically depending on which programming language you are using. Here, for demonstration, I'm using ICU4J library in Groovy:

// https://mvnrepository.com/artifact/com.ibm.icu/icu4j
@Grapes(
    @Grab(group='com.ibm.icu', module='icu4j', version='59.1')
)

import com.ibm.icu.text.Transliterator;

String sourceString = "cambridge";
List<String> transformSchemes = ["Latin-Arabic", "Latin-Cyrillic", "Latin-Devanagari", "Latin-Hiragana"]

for (t in transformSchemes) {

    println "${t}: " + Transliterator.getInstance(t).transform(sourceString);

}

Which returns:

Latin-Arabic: كَمبرِدگِ
Latin-Cyrillic: цамбридге
Latin-Devanagari: चंब्रिद्गॆ
Latin-Hiragana: かんぶりでげ

Obviously, since these are rule-based transformations from one language to another, they tend to be imperfect.

Therefore, if you are looking for names of places (since you mentioned "Cambridge" as an example), you'll have better luck using a database of names of places; ICU has some names of cities and many names of countries. You could also use Wikidata API to retrieve such information; here is a sample call: https://www.wikidata.org/w/api.php?action=wbgetentities&ids=Q350

Shervin
  • 1,936
  • 17
  • 27