@@ -2,6 +2,7 @@ import type {NavigationTreeNodeType} from 'ydb-ui-components';
22
33import { EPathSubType , EPathType } from '../../../types/api/schema' ;
44import type { ETenantType } from '../../../types/api/tenant' ;
5+ import i18n from '../i18n' ;
56
67// this file contains verbose mappings that are typed in a way that ensures
78// correctness when a new node type or a new path type is added
@@ -62,8 +63,12 @@ export const mapPathTypeToNavigationTreeType = (
6263// ====================
6364
6465const pathSubTypeToEntityName : Record < EPathSubType , string | undefined > = {
65- [ EPathSubType . EPathSubTypeSyncIndexImplTable ] : 'Secondary Index Table' ,
66- [ EPathSubType . EPathSubTypeAsyncIndexImplTable ] : 'Secondary Index Table' ,
66+ get [ EPathSubType . EPathSubTypeSyncIndexImplTable ] ( ) {
67+ return i18n ( 'entity-name_secondary-index-table' ) ;
68+ } ,
69+ get [ EPathSubType . EPathSubTypeAsyncIndexImplTable ] ( ) {
70+ return i18n ( 'entity-name_secondary-index-table' ) ;
71+ } ,
6772
6873 [ EPathSubType . EPathSubTypeStreamImpl ] : undefined ,
6974 [ EPathSubType . EPathSubTypeEmpty ] : undefined ,
@@ -72,26 +77,58 @@ const pathSubTypeToEntityName: Record<EPathSubType, string | undefined> = {
7277const pathTypeToEntityName : Record < EPathType , string | undefined > = {
7378 [ EPathType . EPathTypeInvalid ] : undefined ,
7479
75- [ EPathType . EPathTypeSubDomain ] : 'Database' ,
76- [ EPathType . EPathTypeExtSubDomain ] : 'Database' ,
77-
78- [ EPathType . EPathTypeDir ] : 'Directory' ,
79- [ EPathType . EPathTypeTable ] : 'Table' ,
80- [ EPathType . EPathTypeSysView ] : 'System view' ,
81- [ EPathType . EPathTypeTableIndex ] : 'Secondary Index' ,
82- [ EPathType . EPathTypeColumnStore ] : 'Tablestore' ,
83- [ EPathType . EPathTypeColumnTable ] : 'Column-oriented table' ,
84- [ EPathType . EPathTypeCdcStream ] : 'Changefeed' ,
85- [ EPathType . EPathTypePersQueueGroup ] : 'Topic' ,
86-
87- [ EPathType . EPathTypeExternalDataSource ] : 'External Data Source' ,
88- [ EPathType . EPathTypeExternalTable ] : 'External Table' ,
89-
90- [ EPathType . EPathTypeView ] : 'View' ,
91-
92- [ EPathType . EPathTypeReplication ] : 'Async Replication' ,
93- [ EPathType . EPathTypeTransfer ] : 'Transfer' ,
94- [ EPathType . EPathTypeResourcePool ] : 'Resource Pool' ,
80+ get [ EPathType . EPathTypeSubDomain ] ( ) {
81+ return i18n ( 'entity-name_database' ) ;
82+ } ,
83+ get [ EPathType . EPathTypeExtSubDomain ] ( ) {
84+ return i18n ( 'entity-name_database' ) ;
85+ } ,
86+
87+ get [ EPathType . EPathTypeDir ] ( ) {
88+ return i18n ( 'entity-name_directory' ) ;
89+ } ,
90+ get [ EPathType . EPathTypeTable ] ( ) {
91+ return i18n ( 'entity-name_table' ) ;
92+ } ,
93+ get [ EPathType . EPathTypeSysView ] ( ) {
94+ return i18n ( 'entity-name_system-view' ) ;
95+ } ,
96+ get [ EPathType . EPathTypeTableIndex ] ( ) {
97+ return i18n ( 'entity-name_secondary-index' ) ;
98+ } ,
99+ get [ EPathType . EPathTypeColumnStore ] ( ) {
100+ return i18n ( 'entity-name_tablestore' ) ;
101+ } ,
102+ get [ EPathType . EPathTypeColumnTable ] ( ) {
103+ return i18n ( 'entity-name_column-oriented-table' ) ;
104+ } ,
105+ get [ EPathType . EPathTypeCdcStream ] ( ) {
106+ return i18n ( 'entity-name_changefeed' ) ;
107+ } ,
108+ get [ EPathType . EPathTypePersQueueGroup ] ( ) {
109+ return i18n ( 'entity-name_topic' ) ;
110+ } ,
111+
112+ get [ EPathType . EPathTypeExternalDataSource ] ( ) {
113+ return i18n ( 'entity-name_external-data-source' ) ;
114+ } ,
115+ get [ EPathType . EPathTypeExternalTable ] ( ) {
116+ return i18n ( 'entity-name_external-table' ) ;
117+ } ,
118+
119+ get [ EPathType . EPathTypeView ] ( ) {
120+ return i18n ( 'entity-name_view' ) ;
121+ } ,
122+
123+ get [ EPathType . EPathTypeReplication ] ( ) {
124+ return i18n ( 'entity-name_async-replication' ) ;
125+ } ,
126+ get [ EPathType . EPathTypeTransfer ] ( ) {
127+ return i18n ( 'entity-name_transfer' ) ;
128+ } ,
129+ get [ EPathType . EPathTypeResourcePool ] ( ) {
130+ return i18n ( 'entity-name_resource-pool' ) ;
131+ } ,
95132} ;
96133
97134export const mapPathTypeToEntityName = (
0 commit comments