Browse Source

Translate Text and text for commands

eels 4 years ago
parent
commit
c48dc42a60
1 changed files with 7 additions and 4 deletions
  1. 7 4
      packages/fileeditor-extension/src/commands.ts

+ 7 - 4
packages/fileeditor-extension/src/commands.ts

@@ -884,13 +884,16 @@ export namespace Commands {
   ): void {
     commands.addCommand(CommandIDs.createNew, {
       label: args => {
+        const fileTypeName = args.fileTypeName ?? trans.__('Text');
         if (args.isPalette) {
-          return trans.__('New %1 File', args.fileTypeName ?? 'Text');
+          return trans.__('New %1 File', fileTypeName);
         }
-        return trans.__('%1 File', args.fileTypeName ?? 'Text');
+        return trans.__('%1 File', fileTypeName);
+      },
+      caption: args => {
+        const fileTypeName = args.fileTypeName ?? trans.__('text');
+        return trans.__('Create a new %1 file', fileTypeName);
       },
-      caption: args =>
-        trans.__('Create a new %1 file', args.fileTypeName ?? 'text'),
       icon: args =>
         args.isPalette
           ? undefined