-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtranslations.js
More file actions
296 lines (253 loc) · 9.29 KB
/
translations.js
File metadata and controls
296 lines (253 loc) · 9.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
// Translations for TUIcsv Viewer
// Supported languages: English (en), Spanish (es), Portuguese (pt)
const translations = {
en: {
// Menu Bar
menuOpen: 'Open',
menuSearch: 'Search',
menuFilterCols: 'Filter Cols',
menuSort: 'Sort',
menuExport: 'Export',
menuInfo: 'Info',
menuSettings: 'Settings',
menuQuit: 'Quit',
// Status Bar
statusLoading: 'Loading...',
statusReady: 'Ready',
statusError: 'Error',
statusRows: 'Rows',
statusVisible: 'Visible',
statusSearch: 'Search',
statusWorking: 'Working',
statusSaving: 'Saving',
statusSaved: 'Saved',
// File Manager
fileManagerTitle: 'Select CSV File (Esc to Cancel)',
fileManagerCancel: 'Cancel',
fileManagerInvalidType: 'Invalid file type. Please select a .csv file.',
// Search
searchTitle: 'Search',
searchLabel: 'Search Term',
searchButton: 'Search (Ctrl+s)',
searchClear: 'Clear (Ctrl+l)',
searchCancel: 'Cancel (Esc)',
// Column Filter
columnFilterTitle: 'Toggle Columns (Space to toggle, Enter to save)',
columnFilterSave: 'Save',
// Sort
sortTitle: 'Select Column to Sort',
// Export
exportTitle: 'Export Filename',
exportLabel: 'Filename',
exportButton: 'Save (Ctrl+s)',
exportCancel: 'Cancel (Esc)',
exportSuccess: 'Exported to',
// Info
infoTitle: 'App Info',
infoVersion: 'Version',
infoCreator: 'Creator',
infoGithub: 'Github',
infoInstructions: 'Use Arrow Keys to scroll.\nSearch filters data globally.\n\nPress {bold}Enter{/bold} or Click to close.',
// Settings
settingsTitle: 'Settings',
settingsBorders: 'Show Table Borders',
settingsTheme: 'Select Theme:',
settingsLanguage: 'Select Language:',
settingsReset: 'Reset All (Ctrl+r)',
settingsCancel: 'Cancel (Esc)',
settingsSave: 'Save (Ctrl+s)',
settingsThemeUpdated: 'Theme updated!\nPlease restart the app if you see visual artifacts.',
settingsLanguageUpdated: 'Language updated!',
settingsResetMessage: 'Settings Reset. Please restart app.',
// Languages
languages: {
en: 'English',
es: 'Español',
pt: 'Português'
},
// Error Messages
errorTitle: 'Error',
errorFileOpen: 'Could not open file:',
errorParsing: 'Error parsing CSV:',
errorUnexpected: 'Unexpected error:',
// Confirm Exit
confirmExitTitle: 'Confirm Exit',
confirmExitMessage: 'Are you sure you want to quit?',
// Loading Messages
loadingFile: 'Loading',
loadedRows: 'Loaded',
loadedRowsSuffix: 'rows'
},
es: {
// Menu Bar
menuOpen: 'Abrir',
menuSearch: 'Buscar',
menuFilterCols: 'Filtrar Cols',
menuSort: 'Ordenar',
menuExport: 'Exportar',
menuInfo: 'Info',
menuSettings: 'Ajustes',
menuQuit: 'Salir',
// Status Bar
statusLoading: 'Cargando...',
statusReady: 'Listo',
statusError: 'Error',
statusRows: 'Filas',
statusVisible: 'Visible',
statusSearch: 'Buscar',
statusWorking: 'Trabajando',
statusSaving: 'Guardando',
statusSaved: 'Guardado',
// File Manager
fileManagerTitle: 'Seleccionar archivo CSV (Esc para cancelar)',
fileManagerCancel: 'Cancelar',
fileManagerInvalidType: 'Tipo de archivo inválido. Por favor seleccione un archivo .csv.',
// Search
searchTitle: 'Buscar',
searchLabel: 'Término de búsqueda',
searchButton: 'Buscar (Ctrl+s)',
searchClear: 'Limpiar (Ctrl+l)',
searchCancel: 'Cancelar (Esc)',
// Column Filter
columnFilterTitle: 'Alternar Columnas (Espacio para alternar, Enter para guardar)',
columnFilterSave: 'Guardar',
// Sort
sortTitle: 'Seleccionar Columna para Ordenar',
// Export
exportTitle: 'Nombre de archivo de exportación',
exportLabel: 'Nombre de archivo',
exportButton: 'Guardar (Ctrl+s)',
exportCancel: 'Cancelar (Esc)',
exportSuccess: 'Exportado a',
// Info
infoTitle: 'Información de la App',
infoVersion: 'Versión',
infoCreator: 'Creador',
infoGithub: 'Github',
infoInstructions: 'Use las teclas de flecha para desplazarse.\nLa búsqueda filtra datos globalmente.\n\nPresione {bold}Enter{/bold} o haga clic para cerrar.',
// Settings
settingsTitle: 'Ajustes',
settingsBorders: 'Mostrar bordes de tabla',
settingsTheme: 'Seleccionar Tema:',
settingsLanguage: 'Seleccionar Idioma:',
settingsReset: 'Restablecer Todo (Ctrl+r)',
settingsCancel: 'Cancelar (Esc)',
settingsSave: 'Guardar (Ctrl+s)',
settingsThemeUpdated: '¡Tema actualizado!\nReinicie la aplicación si ve artefactos visuales.',
settingsLanguageUpdated: '¡Idioma actualizado!',
settingsResetMessage: 'Ajustes Restablecidos. Por favor reinicie la aplicación.',
// Languages
languages: {
en: 'English',
es: 'Español',
pt: 'Português'
},
// Error Messages
errorTitle: 'Error',
errorFileOpen: 'No se pudo abrir el archivo:',
errorParsing: 'Error al analizar CSV:',
errorUnexpected: 'Error inesperado:',
// Confirm Exit
confirmExitTitle: 'Confirmar Salida',
confirmExitMessage: '¿Está seguro de que desea salir?',
// Loading Messages
loadingFile: 'Cargando',
loadedRows: 'Cargado',
loadedRowsSuffix: 'filas'
},
pt: {
// Menu Bar
menuOpen: 'Abrir',
menuSearch: 'Pesquisar',
menuFilterCols: 'Filtrar Cols',
menuSort: 'Ordenar',
menuExport: 'Exportar',
menuInfo: 'Info',
menuSettings: 'Configurações',
menuQuit: 'Sair',
// Status Bar
statusLoading: 'Carregando...',
statusReady: 'Pronto',
statusError: 'Erro',
statusRows: 'Linhas',
statusVisible: 'Visível',
statusSearch: 'Pesquisar',
statusWorking: 'Trabalhando',
statusSaving: 'Salvando',
statusSaved: 'Salvo',
// File Manager
fileManagerTitle: 'Selecionar arquivo CSV (Esc para cancelar)',
fileManagerCancel: 'Cancelar',
fileManagerInvalidType: 'Tipo de arquivo inválido. Por favor, selecione um arquivo .csv.',
// Search
searchTitle: 'Pesquisar',
searchLabel: 'Termo de pesquisa',
searchButton: 'Pesquisar (Ctrl+s)',
searchClear: 'Limpar (Ctrl+l)',
searchCancel: 'Cancelar (Esc)',
// Column Filter
columnFilterTitle: 'Alternar Colunas (Espaço para alternar, Enter para salvar)',
columnFilterSave: 'Salvar',
// Sort
sortTitle: 'Selecionar Coluna para Ordenar',
// Export
exportTitle: 'Nome do arquivo de exportação',
exportLabel: 'Nome do arquivo',
exportButton: 'Salvar (Ctrl+s)',
exportCancel: 'Cancelar (Esc)',
exportSuccess: 'Exportado para',
// Info
infoTitle: 'Informações do App',
infoVersion: 'Versão',
infoCreator: 'Criador',
infoGithub: 'Github',
infoInstructions: 'Use as teclas de seta para rolar.\nA pesquisa filtra dados globalmente.\n\nPressione {bold}Enter{/bold} ou clique para fechar.',
// Settings
settingsTitle: 'Configurações',
settingsBorders: 'Mostrar bordas da tabela',
settingsTheme: 'Selecionar Tema:',
settingsLanguage: 'Selecionar Idioma:',
settingsReset: 'Redefinir Tudo (Ctrl+r)',
settingsCancel: 'Cancelar (Esc)',
settingsSave: 'Salvar (Ctrl+s)',
settingsThemeUpdated: 'Tema atualizado!\nReinicie o aplicativo se você ver artefatos visuais.',
settingsLanguageUpdated: 'Idioma atualizado!',
settingsResetMessage: 'Configurações Redefinidas. Por favor, reinicie o aplicativo.',
// Languages
languages: {
en: 'English',
es: 'Español',
pt: 'Português'
},
// Error Messages
errorTitle: 'Erro',
errorFileOpen: 'Não foi possível abrir o arquivo:',
errorParsing: 'Erro ao analisar CSV:',
errorUnexpected: 'Erro inesperado:',
// Confirm Exit
confirmExitTitle: 'Confirmar Saída',
confirmExitMessage: 'Tem certeza de que deseja sair?',
// Loading Messages
loadingFile: 'Carregando',
loadedRows: 'Carregado',
loadedRowsSuffix: 'linhas'
}
};
// Helper function to get translation
function t(key, lang = 'en') {
const keys = key.split('.');
let value = translations[lang];
for (const k of keys) {
if (value && typeof value === 'object') {
value = value[k];
} else {
return translations.en[key] || key; // Fallback to English
}
}
return value || translations.en[key] || key;
}
module.exports = {
translations,
t,
availableLanguages: ['en', 'es', 'pt']
};