Skip to content

Commit e41bb5a

Browse files
committed
Refactor i18n translation files into a view-based hierarchy and standardize module exports
- move dictionary.information_message.UNSAVED_CHANGES_TO_ITEM_WILL_BE_LOST to `apps/editor/src/i18n/translations/views/handlers/common.ts` - move dictionary.information_message.CONFIRM_DISCARD_UNSAVED_CHANGES to `apps/editor/src/i18n/translations/views/handlers/common.ts` - move `apps/editor/src/i18n/translations/handlers/panel/voice-input.ts` to `apps/editor/src/i18n/translations/views/panel/handlers/voice-input.ts`. Update translation keys if necessary. - move `apps/editor/src/i18n/translations/handlers/settings.ts` to `apps/editor/src/i18n/translations/views/settings/handlers/[handler name]` make necessary changes to translation keys - every translation file should export 'translations' constnant. assing unique names when importing. - move `apps/editor/src/i18n/translations/views/handlers/common.ts` to `apps/editor/src/i18n/translations/views/common/handlers/common.ts`, update key names as necessary - [Pasted text]
1 parent abf1284 commit e41bb5a

33 files changed

Lines changed: 319 additions & 216 deletions

‎apps/editor/src/i18n/index.ts‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
import * as vscode from 'vscode'
22
import { commands } from './translations/commands'
3-
import { common } from './translations/common'
4-
import { settings_handlers } from './translations/handlers/settings'
5-
import { panel_voice_input } from './translations/handlers/panel/voice-input'
3+
import { translations as common } from './translations/common'
4+
import { translations as views_settings_handlers_open_allow_patterns_settings } from './translations/views/settings/handlers/open-allow-patterns-settings'
5+
import { translations as views_settings_handlers_open_ignore_patterns_settings } from './translations/views/settings/handlers/open-ignore-patterns-settings'
6+
import { translations as views_settings_handlers_select_default_api_configuration } from './translations/views/settings/handlers/select-default-api-configuration'
7+
import { translations as views_panel_handlers_voice_input } from './translations/views/panel/handlers/voice-input'
8+
import { translations as views_handlers_common } from './translations/views/common/handlers/common'
69

710
export type TranslationKey = keyof typeof translations
811

912
const translations = {
1013
...commands,
1114
...common,
12-
...settings_handlers,
13-
...panel_voice_input
15+
...views_settings_handlers_open_allow_patterns_settings,
16+
...views_settings_handlers_open_ignore_patterns_settings,
17+
...views_settings_handlers_select_default_api_configuration,
18+
...views_panel_handlers_voice_input,
19+
...views_handlers_common
1420
}
1521

1622
export const t = (

‎apps/editor/src/i18n/translations/commands/add-file-to-context.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const add_file_to_context = {
1+
export const translations = {
22
'command.context.add.select-workspace': {
33
en: 'Select a workspace folder to browse files',
44
pl: 'Wybierz folder obszaru roboczego, aby przeglądać pliki',

‎apps/editor/src/i18n/translations/commands/apply-chat-response.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const apply_chat_response = {
1+
export const translations = {
22
'command.apply-chat-response.warning.no-code-blocks.title': {
33
en: 'No valid code blocks found',
44
pl: 'Nie znaleziono prawidłowych bloków z kodem',

‎apps/editor/src/i18n/translations/commands/code-at-cursor.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const code_at_cursor = {
1+
export const translations = {
22
'command.code-at-cursor.instructions.placeholder': {
33
en: 'Enter completion instructions',
44
pl: 'Wprowadź instrukcje ukończenia',

‎apps/editor/src/i18n/translations/commands/context-restoration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const context_restoration = {
1+
export const translations = {
22
'command.context-restoration.sources.workspace-state': {
33
en: 'Workspace state',
44
pl: 'Stan obszaru roboczego',

‎apps/editor/src/i18n/translations/commands/generate-commit-message.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const generate_commit_message = {
1+
export const translations = {
22
'command.commit-message.input.title': {
33
en: 'Commit Message',
44
pl: 'Wiadomość commita',

‎apps/editor/src/i18n/translations/commands/index.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { generate_commit_message } from './generate-commit-message'
2-
import { code_at_cursor } from './code-at-cursor'
3-
import { apply_chat_response } from './apply-chat-response'
4-
import { context_restoration } from './context-restoration'
5-
import { add_file_to_context } from './add-file-to-context'
6-
import { select_definition_file } from './select-definition-file'
7-
import { select_referencing_files } from './select-referencing-files'
8-
import { remove_file_from_context } from './remove-file-from-context'
9-
import { search_files } from './search-files'
10-
import { set_ranges } from './set-ranges'
11-
import { new_file } from './new-file'
12-
import { new_folder } from './new-folder'
13-
import { rename } from './rename'
14-
import { rate } from './rate'
1+
import { translations as generate_commit_message } from './generate-commit-message'
2+
import { translations as code_at_cursor } from './code-at-cursor'
3+
import { translations as apply_chat_response } from './apply-chat-response'
4+
import { translations as context_restoration } from './context-restoration'
5+
import { translations as add_file_to_context } from './add-file-to-context'
6+
import { translations as select_definition_file } from './select-definition-file'
7+
import { translations as select_referencing_files } from './select-referencing-files'
8+
import { translations as remove_file_from_context } from './remove-file-from-context'
9+
import { translations as search_files } from './search-files'
10+
import { translations as set_ranges } from './set-ranges'
11+
import { translations as new_file } from './new-file'
12+
import { translations as new_folder } from './new-folder'
13+
import { translations as rename } from './rename'
14+
import { translations as rate } from './rate'
1515

1616
export const commands = {
1717
...generate_commit_message,

‎apps/editor/src/i18n/translations/commands/new-file.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const new_file = {
1+
export const translations = {
22
'command.files.new-file.title': {
33
en: 'New File',
44
pl: 'Nowy plik',

‎apps/editor/src/i18n/translations/commands/new-folder.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const new_folder = {
1+
export const translations = {
22
'command.files.new-folder.title': {
33
en: 'New Folder',
44
pl: 'Nowy folder',

‎apps/editor/src/i18n/translations/commands/rate.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const rate = {
1+
export const translations = {
22
'command.rate.title': {
33
en: 'Rate Extension',
44
pl: 'Oceń rozszerzenie',

0 commit comments

Comments
 (0)