@sigma-file-manager/api 1.4.0 → 1.5.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/README.md +10 -0
- package/index.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,16 @@ async function activate(context) {
|
|
|
27
27
|
}
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
Bundled English defaults with locale JSON from `mergeFromPath`:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { extensionMessages } from './messages.js';
|
|
34
|
+
|
|
35
|
+
export const t = sigma.i18n.createExtensionTranslator(extensionMessages);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`formatMessage` for `{placeholder}` strings is available as `sigma.i18n.formatMessage` when needed.
|
|
39
|
+
|
|
30
40
|
## Manifest schema
|
|
31
41
|
|
|
32
42
|
Use this schema URL in your extension `package.json`:
|
package/index.d.ts
CHANGED
|
@@ -377,6 +377,10 @@ export interface SigmaExtensionAPI {
|
|
|
377
377
|
mergeMessages(messages: Record<string, Record<string, string>>): void;
|
|
378
378
|
mergeFromPath(basePath: string): Promise<void>;
|
|
379
379
|
extensionT(key: string, params?: Record<string, string | number>, fallback?: string): string;
|
|
380
|
+
formatMessage(template: string, params?: Record<string, string | number>): string;
|
|
381
|
+
createExtensionTranslator(
|
|
382
|
+
messages: Record<string, string>,
|
|
383
|
+
): (key: string, params?: Record<string, string | number>) => string;
|
|
380
384
|
};
|
|
381
385
|
contextMenu: {
|
|
382
386
|
registerItem(
|