-2

The translator works fine for the phrases and word but doesn't convert the English numbers into other languages

if I did this

nep= translator.translate('12', dest='nepali')
print(nep.text)

the output will be :

 12

but it should be:

 १२
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
javaNoob
  • 86
  • 1
  • 9

1 Answers1

1

The Hindu-Arabic counting system (google this) is not English, it is used by many languages, and has existed well before the English language did. I would think that translate would know this. What you need to do is translate the Hindu-Arabic numbers into English words first, then you can translate them.

>> pip install num2words
import num2words
print(num2words.num2words(5))
print(num2words.num2words(57))
Bobby Ocean
  • 3,120
  • 1
  • 8
  • 15