@xuda.io/drive_module 1.1.979 → 1.1.981
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1726,7 +1726,7 @@ const ocr_drive_file = async function (app_id, doc) {
|
|
|
1726
1726
|
|
|
1727
1727
|
function detectLanguageByCountry(cfCountry) {
|
|
1728
1728
|
const countryData = countryLanguage.getCountry(cfCountry);
|
|
1729
|
-
|
|
1729
|
+
let lang = "en";
|
|
1730
1730
|
// Check if the country data is available
|
|
1731
1731
|
if (
|
|
1732
1732
|
countryData &&
|
|
@@ -1734,16 +1734,17 @@ const ocr_drive_file = async function (app_id, doc) {
|
|
|
1734
1734
|
countryData.languages.length > 0
|
|
1735
1735
|
) {
|
|
1736
1736
|
// Return the first official language of the country
|
|
1737
|
-
return countryData.languages[0].iso639_1;
|
|
1737
|
+
// return countryData.languages[0].iso639_1;
|
|
1738
|
+
for (let language of countryData.languages) {
|
|
1739
|
+
lang += `+${language.iso639_1}`;
|
|
1740
|
+
}
|
|
1738
1741
|
}
|
|
1739
1742
|
|
|
1740
1743
|
// Default to English if no language found
|
|
1741
|
-
return
|
|
1744
|
+
return lang;
|
|
1742
1745
|
}
|
|
1743
1746
|
let lang = detectLanguageByCountry(doc.country);
|
|
1744
|
-
|
|
1745
|
-
lang += "+en";
|
|
1746
|
-
}
|
|
1747
|
+
|
|
1747
1748
|
const generalConfig = { oem: 1, psm: 3, lang };
|
|
1748
1749
|
debugger;
|
|
1749
1750
|
switch (doc.mime.split("/")[0]) {
|