@functionalcms/svelte-components 4.11.10 → 4.12.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.
package/dist/index.d.ts CHANGED
@@ -41,4 +41,4 @@ export { default as EasyTools } from './components/integrations/EasyTools.svelte
41
41
  /**
42
42
  * Translations
43
43
  */
44
- export { translator } from './translations/translator.js';
44
+ export { translator, prefixedTranslator } from './translations/translator.js';
package/dist/index.js CHANGED
@@ -62,4 +62,4 @@ export { default as EasyTools } from './components/integrations/EasyTools.svelte
62
62
  /**
63
63
  * Translations
64
64
  */
65
- export { translator } from './translations/translator.js';
65
+ export { translator, prefixedTranslator } from './translations/translator.js';
@@ -1 +1,2 @@
1
1
  export declare const translator: (translations: any) => (key: string) => any;
2
+ export declare const prefixedTranslator: (prefix: string, translations: any) => (key: string) => any;
@@ -3,3 +3,9 @@ export const translator = (translations) => {
3
3
  return translations[key] || key;
4
4
  };
5
5
  };
6
+ export const prefixedTranslator = (prefix, translations) => {
7
+ return (key) => {
8
+ const prefixedKey = `${prefix}.${key}`;
9
+ return translations[prefixedKey] || key;
10
+ };
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.11.10",
3
+ "version": "4.12.0",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [