@@ -3,11 +3,12 @@ import { RendererEvent } from "../events.js";
33import { copySync , readFile , writeFileSync } from "../../utils/fs.js" ;
44import { DefaultTheme } from "../themes/default/DefaultTheme.js" ;
55import { getStyles } from "../../utils/highlighter.js" ;
6- import { Option } from "../../utils/index.js" ;
6+ import { getEnumKeys , Option , type EnumKeys } from "../../utils/index.js" ;
77import { existsSync } from "fs" ;
88import { extname , join } from "path" ;
99import { fileURLToPath } from "url" ;
1010import type { Renderer } from "../index.js" ;
11+ import { ReflectionKind } from "../../models/index.js" ;
1112
1213/**
1314 * A plugin that copies the subdirectory ´assets´ from the current themes
@@ -30,14 +31,24 @@ export class AssetsPlugin extends RendererComponent {
3031 }
3132
3233 getTranslatedStrings ( ) {
33- return {
34- copy : this . application . i18n . theme_copy ( ) ,
35- copied : this . application . i18n . theme_copied ( ) ,
36- normally_hidden : this . application . i18n . theme_normally_hidden ( ) ,
37- hierarchy_expand : this . application . i18n . theme_hierarchy_expand ( ) ,
38- hierarchy_collapse :
39- this . application . i18n . theme_hierarchy_collapse ( ) ,
34+ const inter = this . application . internationalization ;
35+ const i18n = this . application . i18n ;
36+
37+ const translations : Record < string , string > = {
38+ copy : i18n . theme_copy ( ) ,
39+ copied : i18n . theme_copied ( ) ,
40+ normally_hidden : i18n . theme_normally_hidden ( ) ,
41+ hierarchy_expand : i18n . theme_hierarchy_expand ( ) ,
42+ hierarchy_collapse : i18n . theme_hierarchy_collapse ( ) ,
43+ folder : i18n . theme_folder ( ) ,
4044 } ;
45+
46+ for ( const key of getEnumKeys ( ReflectionKind ) ) {
47+ const kind = ReflectionKind [ key as EnumKeys < typeof ReflectionKind > ] ;
48+ translations [ `kind_${ kind } ` ] = inter . kindSingularString ( kind ) ;
49+ }
50+
51+ return translations ;
4152 }
4253
4354 private onRenderBegin ( event : RendererEvent ) {
0 commit comments