File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ export default class Translation extends Constant implements TranslationBase {
5454 static IGNORE = this . Toast ( 'ignore' , 1 ) ;
5555 static UNDO = this . Toast ( 'undo' ) ;
5656
57+ static CLOSE = this . Vanilla ( 'dialog-close' ) ;
58+
5759 private args : string [ ] ;
5860
5961 constructor ( key : string , {
@@ -120,4 +122,12 @@ export default class Translation extends Constant implements TranslationBase {
120122 const args = typeof hasArgs === 'string' ? [ hasArgs , ...rest ] : rest ;
121123 return new Translation ( `toast.${ key } ` , { args } ) ;
122124 }
125+
126+ static Vanilla ( key : string ) : Translation ;
127+ static Vanilla < N extends number > ( key : string , hasArgs : N ) : TranslationWithArgs < N > ;
128+ static Vanilla < N extends number > ( key : string , ...args : Tuple < string , N > ) : TranslationWithArgs < N > ;
129+ static Vanilla < N extends number > ( key : string , hasArgs ?: string | N , ...rest : string [ ] ) : TranslationBase | TranslationWithArgs < N > {
130+ const args = typeof hasArgs === 'string' ? [ hasArgs , ...rest ] : rest ;
131+ return new Translation ( key , { args, prefix : null } ) ;
132+ }
123133}
Original file line number Diff line number Diff line change 1+ import Translation from 'src/structures/constants/translation' ;
12import eventEmitter from './eventEmitter.js' ;
23
34export default class DialogHelper {
@@ -25,8 +26,7 @@ export default class DialogHelper {
2526 ...buttons ,
2627 {
2728 cssClass : 'btn-primary' ,
28- // TODO: Translate
29- label : 'Close' ,
29+ label : Translation . CLOSE . translate ( ) ,
3030 action : ( ) => this . close ( ) ,
3131 } ,
3232 ] ,
You can’t perform that action at this time.
0 commit comments