@primestyleai/tryon 3.8.0 → 3.9.1
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/PrimeStyleTryon.d.ts +1 -0
- package/dist/i18n/cs.d.ts +5 -0
- package/dist/i18n/da.d.ts +5 -0
- package/dist/i18n/de.d.ts +5 -0
- package/dist/i18n/en.d.ts +9 -0
- package/dist/i18n/es.d.ts +5 -0
- package/dist/i18n/fi.d.ts +5 -0
- package/dist/i18n/fr.d.ts +5 -0
- package/dist/i18n/index.d.ts +37 -0
- package/dist/i18n/it.d.ts +5 -0
- package/dist/i18n/ja.d.ts +5 -0
- package/dist/i18n/ko.d.ts +5 -0
- package/dist/i18n/nb.d.ts +5 -0
- package/dist/i18n/nl.d.ts +5 -0
- package/dist/i18n/pl.d.ts +5 -0
- package/dist/i18n/pt-br.d.ts +5 -0
- package/dist/i18n/pt-pt.d.ts +5 -0
- package/dist/i18n/sv.d.ts +5 -0
- package/dist/i18n/th.d.ts +5 -0
- package/dist/i18n/tr.d.ts +5 -0
- package/dist/i18n/zh-cn.d.ts +5 -0
- package/dist/i18n/zh-tw.d.ts +5 -0
- package/dist/index-B0KE3c8S.js +2951 -0
- package/dist/index.d.ts +2 -0
- package/dist/primestyle-tryon.js +35 -24
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +160 -132
- package/package.json +1 -1
- package/dist/image-utils-C9bJ1zKO.js +0 -186
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English (en) — master dictionary.
|
|
3
|
+
* Keys are the English strings themselves; values are identical.
|
|
4
|
+
* Other locale files reuse the same keys with translated values.
|
|
5
|
+
*
|
|
6
|
+
* ██ DO NOT reorder or remove keys — the generation script
|
|
7
|
+
* relies on this file as the canonical source of truth.
|
|
8
|
+
*/
|
|
9
|
+
export declare const en: Record<string, string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PrimeStyle SDK — Internationalisation module
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { createT, SUPPORTED_LOCALES } from "../i18n";
|
|
6
|
+
* const t = createT("ja");
|
|
7
|
+
* t("Virtual Try-On"); // → "バーチャル試着"
|
|
8
|
+
*
|
|
9
|
+
* The English dictionary doubles as the master key list.
|
|
10
|
+
* Every other locale file maps the same English keys to translated values.
|
|
11
|
+
* Missing keys fall back to the English string (the key itself).
|
|
12
|
+
*/
|
|
13
|
+
export type TranslateFn = (key: string) => string;
|
|
14
|
+
/** All locale codes the SDK ships translations for. */
|
|
15
|
+
export declare const SUPPORTED_LOCALES: string[];
|
|
16
|
+
/** Master list of translatable keys (= the English dictionary). */
|
|
17
|
+
export declare const TRANSLATION_KEYS: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Register an external dictionary at runtime.
|
|
20
|
+
* Useful for custom / community translations not bundled in the SDK.
|
|
21
|
+
*
|
|
22
|
+
* registerLocale("ar", { "Virtual Try-On": "تجربة افتراضية", … });
|
|
23
|
+
*/
|
|
24
|
+
export declare function registerLocale(locale: string, dict: Record<string, string>): void;
|
|
25
|
+
/**
|
|
26
|
+
* Auto-detect the user's language from the browser.
|
|
27
|
+
* Returns a locale code that matches a bundled dictionary.
|
|
28
|
+
*/
|
|
29
|
+
export declare function detectLanguage(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Create a translator function for the given locale.
|
|
32
|
+
*
|
|
33
|
+
* @param locale BCP-47 tag (e.g. "en", "ja", "pt-BR").
|
|
34
|
+
* Omit to auto-detect from browser.
|
|
35
|
+
* @returns `t(key)` — returns translated string, or the key itself as fallback.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createT(locale?: string): TranslateFn;
|