@weedzcokie/i18n-preact
Advanced tools
Comparing version 3.0.0-alpha.15 to 3.0.0-alpha.16
@@ -1,1 +0,2 @@ | ||
export declare function useLanguage(): Readonly<import("./utils").StringValue>; | ||
import { StringValue } from "./utils"; | ||
export declare function useLanguage(): Readonly<StringValue>; |
@@ -20,5 +20,3 @@ import type { FunctionalComponent } from "preact"; | ||
export declare function is_str(key: string | number): key is keyof StringValue; | ||
export declare function mergeStrings(strings: StringValue, newStrings: Array<{ | ||
default: StringValue; | ||
} | StringValue>): void; | ||
export declare function mergeStrings(strings: StringValue, newStrings: Array<StringValue>): void; | ||
export declare function mergeLocales(newLocales: Locales): void; | ||
@@ -25,0 +23,0 @@ export declare function setLanguage(newLanguage: string): Promise<void>; |
@@ -32,3 +32,3 @@ export const strings = {}; | ||
for (const locale of locales) { | ||
mergeStrings(strings, await Promise.all(locale())); | ||
mergeStrings(strings, (await Promise.all(locale())).map(l => l.default || l)); | ||
} | ||
@@ -35,0 +35,0 @@ } |
{ | ||
"name": "@weedzcokie/i18n-preact", | ||
"version": "3.0.0-alpha.15", | ||
"version": "3.0.0-alpha.16", | ||
"description": "Small internationalization library for use with preact", | ||
@@ -12,12 +12,4 @@ "source": "src/index.ts", | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./hook": "./dist/hook.js" | ||
".": "./dist/index.js" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "rm -r dist; tsc", | ||
"dev": "tsc -w", | ||
"prepublish": "npm run build", | ||
"lint": "eslint ." | ||
}, | ||
"repository": { | ||
@@ -49,3 +41,10 @@ "type": "git", | ||
"preact": "^10.5.5" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "rm -r dist; tsc", | ||
"dev": "tsc -w", | ||
"prepublish": "npm run build", | ||
"lint": "eslint ." | ||
} | ||
} | ||
} |
@@ -173,3 +173,3 @@ # preact-i18n | ||
<p>{props.msg}</p> | ||
<p>{t("string-id")}</p> | ||
<p>{t["string-id"]}</p> | ||
</div> | ||
@@ -176,0 +176,0 @@ ); |
10882
139