matheuss / google-translate-api

A free and unlimited API for Google Translate :dollar::no_entry_sign:
https://npmjs.com/package/google-translate-api
MIT License
2.89k stars 609 forks source link

No support for Punjabi language? #68

Closed voidpls closed 3 years ago

voidpls commented 6 years ago

When attempting to translate to Punjabi, there's no error, yet it returns the English text inputted.

vmau6 1

Using Punjabi's ISO code (pa), on the other hand, returns an error.

qdjzi 1
brolnickij commented 6 years ago

@voidpls Hi! Use 'ma' translate('Hello World', {from: 'en', to: 'ma'});

https://github.com/matheuss/google-translate-api/blob/master/languages.js#L84

voidpls commented 6 years ago

@gamexxx

languages.js

The languages that Google Translate supports (as of 5/15/16) alongside with their ISO 639-1 codes

However, Punjabi's ISO 639-1 Code is 'pa'

loc.gov:

hqgcd 1

Wikipedia:

21dwc 1

Also, using 'ma' still translates it English, no matter the starting language.

cancamilo commented 6 years ago

I have noticed the same issue. It works replacing with "pa" in langauges file

rawr51919 commented 5 years ago

I have PRed this fix into a maintained fork of this repo (vitalets/google-translate-api).

rawr51919 commented 5 years ago

This has been fixed as of v2.8.0 in https://github.com/vitalets/google-translate-api.