-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: translation server provides project name and source file path
- Loading branch information
1 parent
6b89208
commit c5823e5
Showing
17 changed files
with
116 additions
and
148 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
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,20 @@ | ||
export class DebounceScheduler<T> { | ||
private readonly _scheduleMap = new Map<T, NodeJS.Timeout>(); | ||
|
||
constructor( | ||
private readonly _action: (trigger: T) => Promise<void>, | ||
private readonly _debounceTime = 500 | ||
) {} | ||
|
||
schedule(trigger: T) { | ||
const entry = this._scheduleMap.get(trigger); | ||
if (entry !== undefined) { | ||
clearTimeout(entry); | ||
} | ||
|
||
this._scheduleMap.set( | ||
trigger, | ||
setTimeout(() => this._action(trigger), this._debounceTime) | ||
); | ||
} | ||
} |
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
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
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,13 +1,18 @@ | ||
import { logging } from '@angular-devkit/core'; | ||
|
||
import { TranslationSerializer } from './serialization/translation-serializer'; | ||
import { TranslationSource } from './translation-source'; | ||
import { TranslationTarget } from './translation-target'; | ||
|
||
export interface TranslationContextConfiguration { | ||
logger: logging.LoggerApi; | ||
project: string; | ||
encoding: string; | ||
includeContextInTarget: boolean; | ||
source: TranslationSource; | ||
sourceFile: string; | ||
targets: Map<string, TranslationTarget>; | ||
serializer: TranslationSerializer; | ||
original: string; | ||
filenameFactory: (target: TranslationTarget) => string; | ||
filenameFactory: (language: string) => string; | ||
} |
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
Oops, something went wrong.