Skip to main content

python แปลภาษา ด้วย googletrans ใน google colab


เขียน python แปลภาษา ใน google colab

!pip install googletrans==4.0.0-rc1

import googletrans
from googletrans import Translator

print(googletrans.LANGUAGES)

output
{'af': 'afrikaans', 'sq': 'albanian', 'am': 'amharic', 'ar': 'arabic', 'hy': 'armenian', 'az': 'azerbaijani', 'eu': 'basque', 'be': 'belarusian', 'bn': 'bengali', 'bs': 'bosnian', 'bg': 'bulgarian', 'ca': 'catalan', 'ceb': 'cebuano', 'ny': 'chichewa', 'zh-cn': 'chinese (simplified)', 'zh-tw': 'chinese (traditional)', 'co': 'corsican', 'hr': 'croatian', 'cs': 'czech', 'da': 'danish', 'nl': 'dutch', 'en': 'english', 'eo': 'esperanto', 'et': 'estonian', 'tl': 'filipino', 'fi': 'finnish', 'fr': 'french', 'fy': 'frisian', 'gl': 'galician', 'ka': 'georgian', 'de': 'german', 'el': 'greek', 'gu': 'gujarati', 'ht': 'haitian creole', 'ha': 'hausa', 'haw': 'hawaiian', 'iw': 'hebrew', 'he': 'hebrew', 'hi': 'hindi', 'hmn': 'hmong', 'hu': 'hungarian', 'is': 'icelandic', 'ig': 'igbo', 'id': 'indonesian', 'ga': 'irish', 'it': 'italian', 'ja': 'japanese', 'jw': 'javanese', 'kn': 'kannada', 'kk': 'kazakh', 'km': 'khmer', 'ko': 'korean', 'ku': 'kurdish (kurmanji)', 'ky': 'kyrgyz', 'lo': 'lao', 'la': 'latin', 'lv': 'latvian', 'lt': 'lithuanian', 'lb': 'luxembourgish', 'mk': 'macedonian', 'mg': 'malagasy', 'ms': 'malay', 'ml': 'malayalam', 'mt': 'maltese', 'mi': 'maori', 'mr': 'marathi', 'mn': 'mongolian', 'my': 'myanmar (burmese)', 'ne': 'nepali', 'no': 'norwegian', 'or': 'odia', 'ps': 'pashto', 'fa': 'persian', 'pl': 'polish', 'pt': 'portuguese', 'pa': 'punjabi', 'ro': 'romanian', 'ru': 'russian', 'sm': 'samoan', 'gd': 'scots gaelic', 'sr': 'serbian', 'st': 'sesotho', 'sn': 'shona', 'sd': 'sindhi', 'si': 'sinhala', 'sk': 'slovak', 'sl': 'slovenian', 'so': 'somali', 'es': 'spanish', 'su': 'sundanese', 'sw': 'swahili', 'sv': 'swedish', 'tg': 'tajik', 'ta': 'tamil', 'te': 'telugu', 'th': 'thai', 'tr': 'turkish', 'uk': 'ukrainian', 'ur': 'urdu', 'ug': 'uyghur', 'uz': 'uzbek', 'vi': 'vietnamese', 'cy': 'welsh', 'xh': 'xhosa', 'yi': 'yiddish', 'yo': 'yoruba', 'zu': 'zulu'}

translator = Translator()
text = "hello"
translated = translator.translate(text, src='en', dest='th')
print(translated)
print(translated.src)
print(translated.dest)
print(translated.origin)
print(translated.text)
print(translated.pronunciation)

output
Translated(src=en, dest=th, text=สวัสดี, pronunciation=S̄wạs̄dī, extra_data="{'confiden...") en th hello สวัสดี S̄wạs̄dī

Comments

Popular posts from this blog

FURY (2014 film)

                    Fury 2014 film is an American war film . more than $100 million dollar budgets , film based on true story during the last month of World War II in April 1945. Cast   Brad Pitt  (from World War Z and Inglourious Basterds) as Wardaddy  Shia LaBeouf (from transformer 1,2,3) as Boyd Swan Logan Lerman (from Percy Jackson 1,2) as Norman Ellison                     Fury is film in last month of World War II in April 1945. Allied forces of the United States tried to storm the city of Berlin,Germany.But faced with a tight defense and can't penetrate.it is the duty of Wardaddy(Brad Pitt ).Sergeant Major of the Army and his team 4 peoples in tank name "FURY".Mission penetrate into stronghold of Nazi.The results of their mission became a major turning point that made United States won  the war.                     Fury film is first war film this used more than 60 vehicles Tank . for The main tank is "FURY"  , stuff get per

Best Makeup tips to Korea style

               Korea Makup Style                     안녕하세요 , Now, Korea trend coming around the world. whether to be learning Korea language. or Korea fashion along to makeup style also Korea. do you have to notice!  why korean girls makeup their face very cute and clean. look like not makeup. but they focus to natural look. so how they do ? Ok let see the tip of korean girls makeup.                     BB Cream, is indispensable. many people may do not know what is BB cream. and how to use BB cream.                      BB Cream is a sunscreen cream mix makeup base and primer all in one. you can instead normal primer. excellent !, good for women who have rush all the time anyway, here's  tip of korean girls, they use one BB cream only.                     Eyeliner , Korean usually focus on the eye makeup eyeliner. so eyeliner it is a "Must Have" item indispensable. probably because they has a weakness in the eye. that relatively small and