plainheart / bing-translate-api

A simple and free API for Bing & Microsoft Translator for Node.js
https://github.com/plainheart/bing-translate-api
MIT License
161 stars 28 forks source link

source language NL not recognized #13

Closed dmzoneill closed 1 year ago

dmzoneill commented 2 years ago

It translates from English to other languages fine. But it doesn't seem to want to translate from Dutch to English?

It seems to ignore that i'm using dutch and chooses German instead, either way i don't get English.

I'm using https://www.npmjs.com/package/bing-translate-api

code

      console.log(msg);
      console.log(source_lang);
      console.log(target_lang);

      translate(msg, source_lang, target_lang, true, true).then(res => {
        console.log(res);
      }).catch(err => {
        console.error(err);
      });

result

was sold ichor sagen
nl
en

{
  text: 'was sold ichor sagen',
  userLang: 'nl',
  translation: 'was sold ichor sagen',
  language: { from: 'de', to: 'en', score: 1 },
  correctedText: 'was soll ich sagen',
  raw: [ { translations: [Array], detectedLanguage: [Object] } ]
}
dmzoneill commented 2 years ago

works fine from PT -> EN

something going on with NL

plainheart commented 2 years ago

I'm not sure but it seems 'was sold ichor sagen' is not nl but de?