@astroscope/i18n 0.4.2 → 0.4.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025-2026 Simon Bobrov
3
+ Copyright (c) 2025-2026 entwico GmbH
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/index.js CHANGED
@@ -65,6 +65,10 @@ function createI18nChunkMiddleware() {
65
65
  if (!pathname.startsWith(I18N_ENDPOINT_PREFIX)) {
66
66
  return next();
67
67
  }
68
+ if (!i18n.isConfigured()) {
69
+ console.warn(`[@astroscope/i18n] not configured, passing through: ${pathname}`);
70
+ return next();
71
+ }
68
72
  const path = pathname.slice(I18N_ENDPOINT_PREFIX.length);
69
73
  const slashIdx = path.indexOf("/");
70
74
  if (slashIdx === -1) {
@@ -110,6 +114,10 @@ function createI18nMiddleware(options) {
110
114
  if (shouldExclude(ctx, options.exclude ?? RECOMMENDED_EXCLUDES)) {
111
115
  return next();
112
116
  }
117
+ if (!i18n.isConfigured()) {
118
+ console.warn(`[@astroscope/i18n] not configured, passing through: ${ctx.url.pathname}`);
119
+ return next();
120
+ }
113
121
  const locale = options.locale(ctx);
114
122
  const context = {
115
123
  locale,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astroscope/i18n",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "i18n for Astro + React islands — MessageFormat 2, automatic tree-shaking, parallel loading, any translation source",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "repository": {
62
62
  "type": "git",
63
- "url": "git+https://github.com/smnbbrv/astroscope.git",
63
+ "url": "https://github.com/entwico/astroscope",
64
64
  "directory": "packages/i18n"
65
65
  },
66
66
  "keywords": [
@@ -75,12 +75,12 @@
75
75
  "islands",
76
76
  "ssr"
77
77
  ],
78
- "author": "smnbbrv",
78
+ "author": "admin@entwico.com",
79
79
  "license": "MIT",
80
80
  "bugs": {
81
- "url": "https://github.com/smnbbrv/astroscope/issues"
81
+ "url": "https://github.com/entwico/astroscope/issues"
82
82
  },
83
- "homepage": "https://github.com/smnbbrv/astroscope/tree/main/packages/i18n#readme",
83
+ "homepage": "https://github.com/entwico/astroscope/tree/main/packages/i18n#readme",
84
84
  "dependencies": {
85
85
  "@astrojs/compiler": "^3.0.1",
86
86
  "@babel/core": "^7.29.0",
@@ -98,7 +98,7 @@
98
98
  },
99
99
  "peerDependencies": {
100
100
  "astro": "^6.0.0",
101
- "@astroscope/excludes": "^0.3.0"
101
+ "@astroscope/excludes": "^0.3.1"
102
102
  },
103
103
  "scripts": {
104
104
  "build": "tsup src/index.ts src/internal.ts src/extraction/index.ts src/server/translate.ts src/client/translate.ts src/client/directives/load.ts src/client/directives/idle.ts src/client/directives/visible.ts src/client/directives/media.ts src/client/directives/only.ts src/client/directives/utils.ts --format esm --dts --external astro --external astro/client/load.js --external astro/client/idle.js --external astro/client/visible.js --external astro/client/media.js --external astro/client/only.js --external virtual:@astroscope/i18n/manifest --external @babel/core",