lingo-linter-tool 1.0.4 → 1.0.5

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.
@@ -42,12 +42,17 @@ async function healIssues(issues, localesDir) {
42
42
  console.log(chalk_1.default.yellow("⚠️ i18n.json not found. Auto-generating default config..."));
43
43
  const defaultConfig = {
44
44
  source: "en",
45
- targets: ["fr", "de", "es"],
46
- localesDir: "./" + path.basename(localesDir),
45
+ targets: ["fr", "de"],
46
+ buckets: [
47
+ {
48
+ path: "./" + path.basename(localesDir),
49
+ pattern: "{locale}.json",
50
+ },
51
+ ],
47
52
  provider: "openai",
48
53
  };
49
54
  fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2));
50
- console.log(chalk_1.default.green("✅ Created i18n.json"));
55
+ console.log(chalk_1.default.green("✅ Created valid i18n.json with buckets"));
51
56
  }
52
57
  const enPath = path.join(localesDir, "en.json");
53
58
  let enContent = {};
@@ -60,13 +65,14 @@ async function healIssues(issues, localesDir) {
60
65
  missingKeys.forEach((issue) => {
61
66
  if (issue.key && !enContent[issue.key]) {
62
67
  const humanText = issue.key.split(".").pop() || issue.key;
63
- enContent[issue.key] = humanText;
68
+ const formattedText = humanText.charAt(0).toUpperCase() + humanText.slice(1);
69
+ enContent[issue.key] = formattedText;
64
70
  hasChanges = true;
65
71
  }
66
72
  });
67
73
  if (hasChanges) {
68
74
  fs.writeFileSync(enPath, JSON.stringify(enContent, null, 2));
69
- console.log(chalk_1.default.gray(" ➕ Injected missing keys into source (en.json)"));
75
+ console.log(chalk_1.default.gray(` ➕ Injected ${missingKeys.length} missing keys into en.json`));
70
76
  }
71
77
  try {
72
78
  console.log(chalk_1.default.magenta("🚀 Triggering Lingo.dev AI Translation..."));
@@ -77,7 +83,8 @@ async function healIssues(issues, localesDir) {
77
83
  console.log(chalk_1.default.green("\n✅ Auto-Healing Complete!"));
78
84
  }
79
85
  catch (error) {
80
- console.error(chalk_1.default.red("❌ Failed to run lingo.dev CLI."));
86
+ console.error(chalk_1.default.red("\n❌ Failed to run lingo.dev CLI."));
87
+ console.error(chalk_1.default.yellow(" Ensure you have an OpenAI API Key in your .env or GitHub Secrets."));
81
88
  }
82
89
  }
83
90
  exports.healIssues = healIssues;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lingo-linter-tool",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Localization linter and self-healing tool",
5
5
  "bin": {
6
6
  "lingo-lint": "./dist/cli.js"