@better-auth/i18n 1.6.19 → 1.6.20
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/dist/client.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-DNhCo2HA.mjs";
|
|
2
2
|
import { APIError, createAuthMiddleware, isAPIError } from "better-auth/api";
|
|
3
3
|
import { parseCookies } from "better-auth/cookies";
|
|
4
4
|
//#region src/index.ts
|
|
@@ -43,8 +43,7 @@ const i18n = (options) => {
|
|
|
43
43
|
const availableLocales = Object.keys(options.translations);
|
|
44
44
|
let defaultLocale;
|
|
45
45
|
if (options.defaultLocale && availableLocales.includes(options.defaultLocale)) defaultLocale = options.defaultLocale;
|
|
46
|
-
else if (availableLocales.
|
|
47
|
-
else if (availableLocales.length > 0) defaultLocale = availableLocales[0];
|
|
46
|
+
else if (availableLocales.length > 0) defaultLocale = "en";
|
|
48
47
|
else throw new Error("i18n plugin: translations object is empty. At least one locale must be provided.");
|
|
49
48
|
const opts = {
|
|
50
49
|
defaultLocale,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/i18n",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.20",
|
|
4
4
|
"description": "i18n plugin for Better Auth - translate error messages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"tsdown": "0.21.1",
|
|
54
|
-
"@better-auth/core": "1.6.
|
|
55
|
-
"better-auth": "1.6.
|
|
54
|
+
"@better-auth/core": "1.6.20",
|
|
55
|
+
"better-auth": "1.6.20"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@better-auth/core": "^1.6.
|
|
59
|
-
"better-auth": "^1.6.
|
|
58
|
+
"@better-auth/core": "^1.6.20",
|
|
59
|
+
"better-auth": "^1.6.20"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsdown",
|