-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve TranslationService integration
- Loading branch information
1 parent
f5632fb
commit 1bf1592
Showing
12 changed files
with
60 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,26 @@ | ||
import { IIndexManagerSymbol, IKeyValueStoreSymbol, IObjectStoreSymbol, ITranslationServiceSymbol } from 'ipmc-interfaces'; | ||
import { IIndexManagerSymbol, IKeyValueStoreSymbol, IObjectStoreSymbol, ITranslationServiceSymbol, ITranslationsSymbol } from 'ipmc-interfaces'; | ||
import { MemoryKeyValueStore } from '../Services/MemoryKeyValueStore'; | ||
import { ObjectStore } from '../Services/ObjectStore'; | ||
import { IModule } from './IModule'; | ||
import { IndexManager } from '../Services/IndexManager'; | ||
import { TaskManager } from '../Services/TaskManager'; | ||
import { ITaskManagerSymbol } from 'ipmc-interfaces'; | ||
import { TranslationService } from '../Services/TranslationService'; | ||
import en from '../translations/en.json'; | ||
import de from '../translations/de.json'; | ||
|
||
export const CoreModule: IModule = (app) => { | ||
app.register(MemoryKeyValueStore, IKeyValueStoreSymbol); | ||
app.register(ObjectStore, IObjectStoreSymbol); | ||
app.register(IndexManager, IIndexManagerSymbol); | ||
app.register(TaskManager, ITaskManagerSymbol); | ||
app.register(TranslationService, ITranslationServiceSymbol); | ||
app.registerConstantMultiple({ | ||
en: { | ||
translation: en, | ||
}, | ||
de: { | ||
translation: de, | ||
} | ||
}, ITranslationsSymbol); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"UpdatingLibrary": "Aktualisieren von {{name}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"UpdatingLibrary": "Updating library {{name}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/interfaces/src/Services/ITranslationService/ITranslation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const ITranslationsSymbol = Symbol.for('ITranslations'); | ||
|
||
export type ITranslation = { | ||
[key: string]: { | ||
translation: { | ||
[key: string]: string; | ||
}; | ||
}; | ||
}; |
2 changes: 0 additions & 2 deletions
2
...faces/src/Services/ITranslationService.ts → ...TranslationService/ITranslationService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
export const ITranslationServiceSymbol = Symbol.for('ITranslationService'); | ||
|
||
export const ITranslationsSymbol = Symbol.for('ITranslations'); | ||
|
||
export interface ITranslationService { | ||
translate(key: string, values?: { [key: string]: string; }): string; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/interfaces/src/Services/ITranslationService/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { type ITranslation, ITranslationsSymbol } from './ITranslation'; | ||
export { type ITranslationService, ITranslationServiceSymbol } from './ITranslationService'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export * from './ITaskManager'; | ||
export * from './ITranslationService'; | ||
export { type IConfigurationService } from './IConfigurationService'; | ||
export { IHotkeyServiceSymbol, type IHotkeyService, type IHotkey } from './IHotkeyService'; | ||
export { type IIndexManager, IIndexManagerSymbol } from './IIndexManager'; | ||
export { type IIpfsService, IIpfsServiceSymbol } from './IIpfsService'; | ||
export { type IKeyValueStore, IKeyValueStoreSymbol } from './IKeyValueStore'; | ||
export { type INodeService } from './INodeService'; | ||
export { type IObjectStore, IObjectStoreSymbol } from './IObjectStore'; | ||
export { type ITranslationService, ITranslationServiceSymbol, ITranslationsSymbol } from './ITranslationService'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters