The SCG messaging API provide functionality to translate the message’s text from a source language to destination language at delivery time, sending the translated the messages to the recipients numbers in the selected destination language.
This document describes how to use the SCG API to send translated messages, specifically the fields related to language translation used when posting a message request.
Using translation service
We can send a translated message by the SCG Messaging API: the fields "translate", "src_language" and "dst_language" must be specified with the selected values for the message’s text translation to deliver the message accordingly.
- translate: boolean: When translate attribute is set to 'true', translation of message body is enabled.
- src_language: string: This is the source language of the message. The default is English 'en'.
- dst_language: string: Translate the message to this language. If not set, only messages to contacts with language preference will be translated.
Example
Let’s say we want to send a SMS with the message: “First in time first in rights” translated to Spanish for a recipient. The curl command to request this SMS translated to Spanish is:
curl -L -X POST 'https://api.syniverse.com/scg-external-api/api/v1/messaging/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer [token]' \
-d '{
"from":"channel:1KJPMkuHQkair_o15etpmg",
"to":"+1346706XXXX",
"body": "First in time first in rights.",
"translate": true,
"src_language": "en",
"dst_language": "es"
}'
The mobile device will display the translated message:
List of supported languages
Language | Code |
---|---|
Abkhaz | ab |
Acehnese | ace |
Acholi | ach |
Afrikaans | af |
Albanian | sq |
Alur | alz |
Amharic | am |
Arabic | ar |
Armenian | hy |
Assamese | as |
Awadhi | awa |
Aymara | ay |
Azerbaijani | az |
Balinese | ban |
Bambara | bm |
Bashkir | ba |
Basque | eu |
Batak Karo | btx |
Batak Simalungun | bts |
Batak Toba | bbc |
Belarusian | be |
Bemba | bem |
Bengali | bn |
Betawi | bew |
Bhojpuri | bho |
Bikol | bik |
Bosnian | bs |
Breton | br |
Bulgarian | bg |
Buryat | bua |
Cantonese | yue |
Catalan | ca |
Cebuano | ceb |
Chichewa (Nyanja) | ny |
Chinese (Simplified) | zh-CN or zh |
Chinese (Traditional) | zh-TW |
Chuvash | cv |
Corsican | co |
Crimean Tatar | crh |
Croatian | hr |
Czech | cs |
Danish | da |
Dinka | din |
Divehi | dv |
Dogri | doi |
Dombe | dov |
Dutch | nl |
Dzongkha | dz |
English | en |
Esperanto | eo |
Estonian | et |
Ewe | ee |
Fijian | fj |
Filipino | tl |
Finnish | fi |
French | fr |
Frisian | fy |
Fulani | ff |
Ga | gaa |
Galician | gl |
Georgian | ka |
German | de |
Greek | el |
Guarani | gn |
Gujarati | gu |
Haitian Creole | ht |
Hakha Chin | cnh |
Hausa | ha |
Hawaiian | haw |
Hebrew | iw or he |
Hiligaynon | hil |
Hindi | hi |
Hmong | hmn |
Hungarian | hu |
Hunsrik | hrx |
Icelandic | is |
Igbo | ig |
Ilocano | ilo |
Indonesian | id |
Irish | ga |
Italian | it |
Japanese | ja |
Javanese | jw or jv |
Kannada | kn |
Kapampangan | pam |
Kazakh | kk |
Khmer | km |
Kiga | cgg |
Kinyarwanda | rw |
Kituba | ktu |
Konkani | gom |
Korean | ko |
Krio | kri |
Kurdish (Kurmanji) | ku |
Kurdish (Sorani) | ckb |
Kyrgyz | ky |
Lao | lo |
Latgalian | ltg |
Latin | la |
Latvian | lv |
Ligurian | lij |
Limburgish | li |
Lingala | ln |
Lithuanian | lt |
Lombard | lmo |
Luganda | lg |
Luo | luo |
Luxembourgish | lb |
Macedonian | mk |
Maithili | mai |
Makassar | mak |
Malagasy | mg |
Malay | ms |
Malay (Jawi) | ms-Arab |
Malayalam | ml |
Maltese | mt |
Maori | mi |
Marathi | mr |
Meadow Mari | chm |
Meiteilon (Manipuri) | mni-Mtei |
Minang | min |
Mizo | lus |
Mongolian | mn |
Myanmar (Burmese) | my |
Ndebele (South) | nr |
Nepalbhasa (Newari) | new |
Nepali | ne |
Norwegian | no |
Nuer | nus |
Occitan | oc |
Odia (Oriya) | or |
Oromo | om |
Pangasinan | pag |
Papiamento | pap |
Pashto | ps |
Persian | fa |
Polish | pl |
Portuguese | pt |
Portuguese (Brazil) | pt |
Punjabi (Gurmukhi) | pa |
Punjabi (Shahmukhi) | pa-Arab |
Quechua | qu |
Romani | rom |
Romanian | ro |
Rundi | rn |
Russian | ru |
Samoan | sm |
Sango | sg |
Sanskrit | sa |
Scots Gaelic | gd |
Sepedi | nso |
Serbian | sr |
Sesotho | st |
Seychellois Creole | crs |
Shan | shn |
Shona | sn |
Sicilian | scn |
Silesian | szl |
Sindhi | sd |
Sinhala | si |
Slovak | sk |
Slovenian | sl |
Somali | so |
Spanish | es |
Sundanese | su |
Swahili | sw |
Swati | ss |
Swedish | sv |
Tajik | tg |
Tamil | ta |
Tatar | tt |
Telugu | te |
Tetum | tet |
Thai | th |
Tigrinya | ti |
Tsonga | ts |
Tswana | tn |
Turkish | tr |
Turkmen | tk |
Twi | ak |
Ukrainian | uk |
Urdu | ur |
Uyghur | ug |
Uzbek | uz |
Vietnamese | vi |
Welsh | cy |
Xhosa | xh |
Yiddish | yi |
Yoruba | yo |
Yucatec Maya | yua |
Zulu | zu |
0 Comments