@open-xchange/vite-plugin-i18next-gettext 1.2.1 → 1.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## `1.3.0` – 2025-Sep-23
4
+
5
+ - changed: placeholder in output files changed from `$NAMESPACE` to `[NAMESPACE]`
6
+
3
7
  ## `1.2.1` – 2025-Sep-09
4
8
 
5
9
  - chore: bump dependencies
package/README.md CHANGED
@@ -30,7 +30,7 @@ export default defineConfig(() => {
30
30
  i18nextPlugin({
31
31
  poFiles: "i18n/*.po",
32
32
  srcFiles: "src/**/*.{js,jsx,ts,tsx}",
33
- potFile: "$NAMESPACE.pot",
33
+ potFile: "dist/[NAMESPACE].pot",
34
34
  projectName: "My Project",
35
35
  }),
36
36
  ],
@@ -43,5 +43,5 @@ export default defineConfig(() => {
43
43
  | - | - | - | - |
44
44
  | `poFiles` | `string\|string[]` | _required_ | Glob pattern(s) for all PO files containing the translations. |
45
45
  | `srcFiles` | `string\|string[]` | _required_ | Glob pattern(s) for all source files to be scanned for UI strings. |
46
- | `potFile` | `string` | _required_ | Path to the POT files to be generated when building the project, relative to the build output directory. Should contain the placeholder `$NAMESPACE` if the project contains translation strings in different i18next namespaces. |
47
- | `projectName` | `string` | _required_ | The project name to be inserted into the POT file under the key "Project-Id-Version". May contain the placeholder `$NAMESPACE`. |
46
+ | `potFile` | `string` | _required_ | Path to the POT files to be generated when building the project, relative to the build output directory. Should contain the placeholder `[NAMESPACE]` if the project contains translation strings in different i18next namespaces. |
47
+ | `projectName` | `string` | _required_ | The project name to be inserted into the POT file under the key "Project-Id-Version". May contain the placeholder `[NAMESPACE]` |
package/dist/index.d.ts CHANGED
@@ -25,20 +25,20 @@ export interface VitePluginI18nextGettextOptions {
25
25
  srcFiles: string | string[];
26
26
  /**
27
27
  * Path to the POT files generated when building the project, relative to
28
- * the build output directory. Should contain the placeholder `$NAMESPACE`
28
+ * the build output directory. Should contain the placeholder `[NAMESPACE]`
29
29
  * if the project contains translation strings in different i18next
30
30
  * namespaces.
31
31
  *
32
32
  * @example
33
33
  * {
34
- * potFile: "i18n/$NAMESPACE.pot",
34
+ * potFile: "i18n/[NAMESPACE].pot",
35
35
  * // ...
36
36
  * }
37
37
  */
38
38
  potFile: string;
39
39
  /**
40
40
  * The project name to be inserted into the POT files under the key
41
- * "Project-Id-Version". May contain the placeholder `$NAMESPACE`.
41
+ * "Project-Id-Version". May contain the placeholder `[NAMESPACE]`.
42
42
  */
43
43
  projectName: string;
44
44
  }
package/dist/index.js CHANGED
@@ -44,12 +44,12 @@ export default function vitePluginI18nextGettext(options) {
44
44
  // parse all source files, extract translations, collect into POT catalogs
45
45
  const catalogs = await parse({ project: options.projectName, files: options.srcFiles });
46
46
  // warn when writing multiple POT files to same file location
47
- if ((catalogs.size > 1) && !options.potFile.includes("$NAMESPACE")) {
48
- this.warn("multiple POT files written to same file location (missing placeholder '$NAMESPACE' in option 'potFile')");
47
+ if ((catalogs.size > 1) && !options.potFile.includes("[NAMESPACE]")) {
48
+ this.warn("multiple POT files written to same file location (missing placeholder '[NAMESPACE]' in option 'potFile')");
49
49
  }
50
50
  // add all POT files as assets to the bundle
51
51
  for (const [namespace, source] of catalogs) {
52
- const fileName = options.potFile.replaceAll("$NAMESPACE", namespace);
52
+ const fileName = options.potFile.replaceAll("[NAMESPACE]", namespace);
53
53
  this.emitFile({ type: "asset", fileName, source });
54
54
  }
55
55
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/vite-plugin-i18next-gettext",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Vite integration of i18next using gettext",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,13 +25,13 @@
25
25
  "lint": "tsc && tsc --project src/tsconfig.json --noEmit && eslint ."
26
26
  },
27
27
  "dependencies": {
28
- "@open-xchange/i18next-po-parser": "^1.0.0",
28
+ "@open-xchange/i18next-po-parser": "^1.1.0",
29
29
  "gettext-converter": "^1.3.0",
30
30
  "picomatch": "^4.0.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@open-xchange/linter-presets": "^1.9.0",
34
- "@types/node": "^24.3.1",
33
+ "@open-xchange/linter-presets": "^1.9.5",
34
+ "@types/node": "^24.5.2",
35
35
  "eslint": "^9.35.0",
36
36
  "jiti": "^2.5.1",
37
37
  "premove": "^4.0.0",