@xuda.io/drive_module 1.1.978 → 1.1.980

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.
Files changed (2) hide show
  1. package/index.js +7 -3
  2. 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,17 +1734,21 @@ 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 "en";
1744
+ return lang;
1742
1745
  }
1743
1746
  let lang = detectLanguageByCountry(doc.country);
1744
1747
  if (lang !== "en") {
1745
1748
  lang += "+en";
1746
1749
  }
1747
1750
  const generalConfig = { oem: 1, psm: 3, lang };
1751
+ debugger;
1748
1752
  switch (doc.mime.split("/")[0]) {
1749
1753
  case "image": {
1750
1754
  ocr = await tesseract.recognize(target_file, generalConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.978",
3
+ "version": "1.1.980",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {