@akanjs/next 0.0.142 → 0.0.144
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/cjs/makePageProto.js +3 -0
- package/esm/makePageProto.js +3 -0
- package/makePageProto.d.ts +1 -0
- package/package.json +1 -1
package/cjs/makePageProto.js
CHANGED
|
@@ -128,6 +128,9 @@ const makePageProto = (locales) => {
|
|
|
128
128
|
const key = `${model}.qargdesc-${queryKey}-${arg}`;
|
|
129
129
|
return l(key);
|
|
130
130
|
};
|
|
131
|
+
l.trans = (translation) => {
|
|
132
|
+
return translation[lang] ?? "unknown translation";
|
|
133
|
+
};
|
|
131
134
|
return { path, l, lang };
|
|
132
135
|
};
|
|
133
136
|
};
|
package/esm/makePageProto.js
CHANGED
|
@@ -106,6 +106,9 @@ const makePageProto = (locales) => {
|
|
|
106
106
|
const key = `${model}.qargdesc-${queryKey}-${arg}`;
|
|
107
107
|
return l(key);
|
|
108
108
|
};
|
|
109
|
+
l.trans = (translation) => {
|
|
110
|
+
return translation[lang] ?? "unknown translation";
|
|
111
|
+
};
|
|
109
112
|
return { path, l, lang };
|
|
110
113
|
};
|
|
111
114
|
};
|
package/makePageProto.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare const makePageProto: <Locale extends {
|
|
|
25
25
|
qrydesc<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey]): string;
|
|
26
26
|
qarg<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey], arg: string): string;
|
|
27
27
|
qargdesc<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey], arg: string): string;
|
|
28
|
+
trans(translation: Record<"en" | "ko" | (string & {}), ReactNode>): ReactNode;
|
|
28
29
|
};
|
|
29
30
|
lang: string;
|
|
30
31
|
};
|