@flightdev/i18n 0.1.5 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +17 -17
  2. package/package.json +77 -71
  3. package/LICENSE +0 -21
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @flight-framework/i18n
1
+ # @flightdev/i18n
2
2
 
3
3
  Internationalization for Flight Framework. Supports multiple translation libraries with a unified API, automatic locale detection, and SSR-friendly design.
4
4
 
@@ -38,7 +38,7 @@ Internationalization for Flight Framework. Supports multiple translation librari
38
38
  ## Installation
39
39
 
40
40
  ```bash
41
- npm install @flight-framework/i18n
41
+ npm install @flightdev/i18n
42
42
 
43
43
  # Install your preferred adapter:
44
44
  npm install i18next # Most popular, feature-rich
@@ -55,8 +55,8 @@ npm install @lingui/core # Compile-time extraction
55
55
 
56
56
  ```typescript
57
57
  // src/i18n.ts
58
- import { createI18n } from '@flight-framework/i18n';
59
- import { i18next } from '@flight-framework/i18n/i18next';
58
+ import { createI18n } from '@flightdev/i18n';
59
+ import { i18next } from '@flightdev/i18n/i18next';
60
60
 
61
61
  export const i18n = createI18n(i18next({
62
62
  locales: ['en', 'es', 'fr', 'de'],
@@ -119,7 +119,7 @@ i18n.t('welcome'); // "Bienvenido a nuestra app"
119
119
  The most popular option with extensive features.
120
120
 
121
121
  ```typescript
122
- import { i18next } from '@flight-framework/i18n/i18next';
122
+ import { i18next } from '@flightdev/i18n/i18next';
123
123
 
124
124
  const adapter = i18next({
125
125
  locales: ['en', 'es', 'fr'],
@@ -143,7 +143,7 @@ const adapter = i18next({
143
143
  Compile-time translations for the smallest bundle size.
144
144
 
145
145
  ```typescript
146
- import { paraglide } from '@flight-framework/i18n/paraglide';
146
+ import { paraglide } from '@flightdev/i18n/paraglide';
147
147
  import * as messages from './paraglide/messages';
148
148
 
149
149
  const adapter = paraglide({
@@ -158,7 +158,7 @@ const adapter = paraglide({
158
158
  ICU message format with powerful formatting.
159
159
 
160
160
  ```typescript
161
- import { formatjs } from '@flight-framework/i18n/formatjs';
161
+ import { formatjs } from '@flightdev/i18n/formatjs';
162
162
 
163
163
  const adapter = formatjs({
164
164
  locales: ['en', 'es'],
@@ -175,7 +175,7 @@ const adapter = formatjs({
175
175
  Compile-time extraction with excellent developer experience.
176
176
 
177
177
  ```typescript
178
- import { lingui } from '@flight-framework/i18n/lingui';
178
+ import { lingui } from '@flightdev/i18n/lingui';
179
179
  import { messages as enMessages } from './locales/en/messages';
180
180
  import { messages as esMessages } from './locales/es/messages';
181
181
 
@@ -196,7 +196,7 @@ const adapter = lingui({
196
196
  Automatic detection from multiple sources:
197
197
 
198
198
  ```typescript
199
- import { createI18n, detectLocale } from '@flight-framework/i18n';
199
+ import { createI18n, detectLocale } from '@flightdev/i18n';
200
200
 
201
201
  const i18n = createI18n(adapter, {
202
202
  detection: {
@@ -218,7 +218,7 @@ const i18n = createI18n(adapter, {
218
218
  ### Server-Side Detection
219
219
 
220
220
  ```typescript
221
- import { getLocaleFromRequest } from '@flight-framework/i18n';
221
+ import { getLocaleFromRequest } from '@flightdev/i18n';
222
222
 
223
223
  export async function loader({ request }) {
224
224
  const locale = getLocaleFromRequest(request, {
@@ -234,7 +234,7 @@ export async function loader({ request }) {
234
234
 
235
235
  ```typescript
236
236
  // Routes: /en/about, /es/about, /fr/about
237
- import { createLocaleRouter } from '@flight-framework/i18n';
237
+ import { createLocaleRouter } from '@flightdev/i18n';
238
238
 
239
239
  const router = createLocaleRouter({
240
240
  locales: ['en', 'es', 'fr'],
@@ -250,7 +250,7 @@ const router = createLocaleRouter({
250
250
  ### React
251
251
 
252
252
  ```tsx
253
- import { I18nProvider, useTranslation, Trans } from '@flight-framework/i18n/react';
253
+ import { I18nProvider, useTranslation, Trans } from '@flightdev/i18n/react';
254
254
 
255
255
  function App() {
256
256
  return (
@@ -292,7 +292,7 @@ function Content() {
292
292
 
293
293
  ```vue
294
294
  <script setup>
295
- import { useI18n } from '@flight-framework/i18n/vue';
295
+ import { useI18n } from '@flightdev/i18n/vue';
296
296
 
297
297
  const { t, locale, setLocale, locales } = useI18n();
298
298
  </script>
@@ -313,7 +313,7 @@ const { t, locale, setLocale, locales } = useI18n();
313
313
 
314
314
  ```svelte
315
315
  <script>
316
- import { getI18n } from '@flight-framework/i18n/svelte';
316
+ import { getI18n } from '@flightdev/i18n/svelte';
317
317
 
318
318
  const { t, locale, setLocale, locales } = getI18n();
319
319
  </script>
@@ -331,7 +331,7 @@ const { t, locale, setLocale, locales } = useI18n();
331
331
  ### Solid
332
332
 
333
333
  ```tsx
334
- import { useI18n, Trans } from '@flight-framework/i18n/solid';
334
+ import { useI18n, Trans } from '@flightdev/i18n/solid';
335
335
 
336
336
  function Content() {
337
337
  const { t, locale, setLocale, locales } = useI18n();
@@ -365,7 +365,7 @@ import {
365
365
  formatTime,
366
366
  formatRelativeTime,
367
367
  formatList,
368
- } from '@flight-framework/i18n';
368
+ } from '@flightdev/i18n';
369
369
 
370
370
  // Numbers
371
371
  formatNumber(1234567.89, 'en-US'); // "1,234,567.89"
@@ -604,7 +604,7 @@ hydrateRoot(
604
604
  Implement the `I18nAdapter` interface:
605
605
 
606
606
  ```typescript
607
- import type { I18nAdapter } from '@flight-framework/i18n';
607
+ import type { I18nAdapter } from '@flightdev/i18n';
608
608
 
609
609
  export function myAdapter(config: MyConfig): I18nAdapter {
610
610
  return {
package/package.json CHANGED
@@ -1,72 +1,78 @@
1
- {
2
- "name": "@flightdev/i18n",
3
- "version": "0.1.5",
4
- "description": "Agnostic internationalization for Flight Framework. Choose your engine: i18next, Paraglide, FormatJS, Lingui, or custom.",
5
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.js"
10
- },
11
- "./i18next": {
12
- "types": "./dist/adapters/i18next.d.ts",
13
- "import": "./dist/adapters/i18next.js"
14
- },
15
- "./paraglide": {
16
- "types": "./dist/adapters/paraglide.d.ts",
17
- "import": "./dist/adapters/paraglide.js"
18
- },
19
- "./formatjs": {
20
- "types": "./dist/adapters/formatjs.d.ts",
21
- "import": "./dist/adapters/formatjs.js"
22
- },
23
- "./lingui": {
24
- "types": "./dist/adapters/lingui.d.ts",
25
- "import": "./dist/adapters/lingui.js"
26
- },
27
- "./routing": {
28
- "types": "./dist/routing.d.ts",
29
- "import": "./dist/routing.js"
30
- },
31
- "./middleware": {
32
- "types": "./dist/middleware.d.ts",
33
- "import": "./dist/middleware.js"
34
- },
35
- "./typegen": {
36
- "types": "./dist/typegen.d.ts",
37
- "import": "./dist/typegen.js"
38
- }
39
- },
40
- "files": [
41
- "dist"
42
- ],
43
- "peerDependencies": {
44
- "@formatjs/intl": ">=2.0.0",
45
- "@lingui/core": ">=5.0.0",
46
- "i18next": ">=23.0.0"
47
- },
48
- "peerDependenciesMeta": {
49
- "@formatjs/intl": {
50
- "optional": true
51
- },
52
- "@lingui/core": {
53
- "optional": true
54
- },
55
- "i18next": {
56
- "optional": true
57
- }
58
- },
59
- "devDependencies": {
60
- "@types/node": "^22.0.0",
61
- "tsup": "^8.0.0",
62
- "typescript": "^5.7.0",
63
- "vitest": "^2.0.0"
64
- },
65
- "license": "MIT",
66
- "scripts": {
67
- "build": "tsup",
68
- "dev": "tsup --watch",
69
- "test": "vitest run",
70
- "typecheck": "tsc --noEmit"
71
- }
1
+ {
2
+ "name": "@flightdev/i18n",
3
+ "version": "0.2.0",
4
+ "description": "Agnostic internationalization for Flight Framework. Choose your engine: i18next, Paraglide, FormatJS, Lingui, or custom.",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./i18next": {
12
+ "types": "./dist/adapters/i18next.d.ts",
13
+ "import": "./dist/adapters/i18next.js"
14
+ },
15
+ "./paraglide": {
16
+ "types": "./dist/adapters/paraglide.d.ts",
17
+ "import": "./dist/adapters/paraglide.js"
18
+ },
19
+ "./formatjs": {
20
+ "types": "./dist/adapters/formatjs.d.ts",
21
+ "import": "./dist/adapters/formatjs.js"
22
+ },
23
+ "./lingui": {
24
+ "types": "./dist/adapters/lingui.d.ts",
25
+ "import": "./dist/adapters/lingui.js"
26
+ },
27
+ "./routing": {
28
+ "types": "./dist/routing.d.ts",
29
+ "import": "./dist/routing.js"
30
+ },
31
+ "./middleware": {
32
+ "types": "./dist/middleware.d.ts",
33
+ "import": "./dist/middleware.js"
34
+ },
35
+ "./typegen": {
36
+ "types": "./dist/typegen.d.ts",
37
+ "import": "./dist/typegen.js"
38
+ }
39
+ },
40
+ "files": [
41
+ "dist"
42
+ ],
43
+ "scripts": {
44
+ "build": "tsup",
45
+ "dev": "tsup --watch",
46
+ "test": "vitest run",
47
+ "typecheck": "tsc --noEmit"
48
+ },
49
+ "peerDependencies": {
50
+ "@formatjs/intl": "\u003e=2.0.0",
51
+ "@lingui/core": "\u003e=5.0.0",
52
+ "i18next": "\u003e=23.0.0"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "@formatjs/intl": {
56
+ "optional": true
57
+ },
58
+ "@lingui/core": {
59
+ "optional": true
60
+ },
61
+ "i18next": {
62
+ "optional": true
63
+ }
64
+ },
65
+ "devDependencies": {
66
+ "@types/node": "^22.0.0",
67
+ "tsup": "^8.0.0",
68
+ "typescript": "^5.7.0",
69
+ "vitest": "^2.0.0"
70
+ },
71
+ "license": "MIT",
72
+ "homepage": "https://github.com/EliosLT/FlightDev",
73
+ "repository": {
74
+ "url": "https://github.com/EliosLT/FlightDev.git",
75
+ "directory": "packages/i18n",
76
+ "type": "git"
77
+ }
72
78
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024-2026 Flight Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.