meetDeveloper / freeDictionaryAPI

There was no free Dictionary API on the web when I wanted one for my friend, so I created one.
https://dictionaryapi.dev/
GNU General Public License v3.0
2.56k stars 258 forks source link

pt-BR is not return any result #115

Open zehfernandes opened 2 years ago

zehfernandes commented 2 years ago

pt-BR is a support language https://github.com/meetDeveloper/freeDictionaryAPI/blob/87b6ebabde3ec59b02932c448bb89acb473a985a/modules/utils.js#L24

But the api is not return the definition: https://api.dictionaryapi.dev/api/v2/entries/pt-BR/teste https://api.dictionaryapi.dev/api/v2/entries/pt-br/teste

paulorcvieira commented 2 years ago

The value received in let { word, language, version } = req.params in app.js on line 70 is converted to lowercase on line 91 language = language.toLowerCase(); however when checking if this value exists on line 94 if (!utils.isLanguageSupported(language)) { return handleError.call(res, new errors.NoDefinitionsFound()); } is returned false due to the value being in capital letters in modules/utils.js ('pt-BR', // Brazilian Portuguese), thus an error is returned

img1 img2