Skip to content

Commit db778ab

Browse files
authored
Allow $schema in external translation bundles (#151)
1 parent 17dacdf commit db778ab

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
declare module '*.reactodia-translation.json' {
2-
const value: Record<string, Record<string, string>>;
2+
const value: {
3+
[group: string]: Record<string, string> | string;
4+
};
35
export default value;
46
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reactodia/workspace",
3-
"version": "0.34.0",
3+
"version": "0.34.0-next",
44
"description": "Reactodia Workspace -- library for visual interaction with graphs in a form of a diagram.",
55
"repository": {
66
"type": "git",

src/coreUtils/i18n.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type * as Rdf from '../data/rdf/rdfModel';
88

99
import DefaultTranslationBundle from '../../i18n/translations/en.reactodia-translation.json';
1010

11-
type DefaultBundleData = Omit<typeof DefaultTranslationBundle, '$schema'>;
11+
type DefaultBundleData = typeof DefaultTranslationBundle;
1212

1313
/**
1414
* Translation strings bundle (content).
@@ -197,7 +197,7 @@ type TranslationPartial<T> = {
197197
[K in keyof T]?: Partial<T[K]>;
198198
};
199199

200-
type TranslationKeyOf<T> = DeepPath<T>;
200+
type TranslationKeyOf<T> = DeepPath<Omit<T, '$schema'>>;
201201

202202
type DeepPath<T> = T extends object ? (
203203
{

0 commit comments

Comments
 (0)