From 2f646ffcafebe4bc0fd8cdf82e3f5961ac7a9461 Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Wed, 25 Mar 2026 18:26:03 +0300 Subject: [PATCH] Translate more visible UI strings --- packages/vue/src/i18n/messages.ts | 9 ++++++++- packages/vue/src/locales/ru.json | 9 ++++++++- src/components/CodePanel.vue | 7 ++++--- src/components/MobileHud.vue | 5 +++-- src/components/VariablesDialog.vue | 14 ++++++++------ 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/packages/vue/src/i18n/messages.ts b/packages/vue/src/i18n/messages.ts index ffc8b6fa6..c0e858315 100644 --- a/packages/vue/src/i18n/messages.ts +++ b/packages/vue/src/i18n/messages.ts @@ -143,6 +143,13 @@ export const dialogMessages = i18n('dialogs', { apply: 'Apply', close: 'Close', ok: 'OK', + copy: 'Copy', + copied: 'Copied', + createCollection: 'Create collection', + localVariables: 'Local variables', + noVariableCollections: 'No variable collections', + selectLayerForJSX: 'Select a layer to see its JSX code', search: 'Search…', - noResults: 'No results' + noResults: 'No results', + share: 'Share' }) diff --git a/packages/vue/src/locales/ru.json b/packages/vue/src/locales/ru.json index 8fdb8a869..aa5340445 100644 --- a/packages/vue/src/locales/ru.json +++ b/packages/vue/src/locales/ru.json @@ -124,7 +124,14 @@ "apply": "Применить", "close": "Закрыть", "ok": "ОК", + "copy": "Копировать", + "copied": "Скопировано", + "createCollection": "Создать коллекцию", + "localVariables": "Локальные переменные", + "noVariableCollections": "Нет коллекций переменных", + "selectLayerForJSX": "Выберите слой, чтобы увидеть его JSX-код", "search": "Поиск…", - "noResults": "Ничего не найдено" + "noResults": "Ничего не найдено", + "share": "Поделиться" } } diff --git a/src/components/CodePanel.vue b/src/components/CodePanel.vue index fa169fc4d..ebc265d86 100644 --- a/src/components/CodePanel.vue +++ b/src/components/CodePanel.vue @@ -6,7 +6,7 @@ import { useClipboard } from '@vueuse/core' import { computed, ref } from 'vue' import { selectionToJSX } from '@open-pencil/core' -import { useSceneComputed } from '@open-pencil/vue' +import { useI18n, useSceneComputed } from '@open-pencil/vue' import { useEditorStore } from '@/stores/editor' @@ -14,6 +14,7 @@ import type { JSXFormat } from '@open-pencil/core' const store = useEditorStore() const { copy, copied } = useClipboard({ copiedDuring: 2000 }) +const { dialogs } = useI18n() const jsxFormat = ref('openpencil') function toggleFormat() { @@ -44,7 +45,7 @@ function copyCode() { data-test-id="code-panel-empty" class="flex flex-1 items-center justify-center px-4 text-center" > - Select a layer to see its JSX code + {{ dialogs.selectLayerForJSX }}
@@ -69,7 +70,7 @@ function copyCode() { > - {{ copied ? 'Copied' : 'Copy' }} + {{ copied ? dialogs.copied : dialogs.copy }}
diff --git a/src/components/MobileHud.vue b/src/components/MobileHud.vue index f322e17ea..599735c79 100644 --- a/src/components/MobileHud.vue +++ b/src/components/MobileHud.vue @@ -27,7 +27,7 @@ import { toast } from '@/utils/toast' import { useEditorStore } from '@/stores/editor' import Tip from '@/components/ui/Tip.vue' import { colorToCSS } from '@open-pencil/core' -import { useEditorCommands } from '@open-pencil/vue' +import { useEditorCommands, useI18n } from '@open-pencil/vue' import { toolIcons } from '@/utils/tools' import { initials } from '@/utils/text' @@ -37,6 +37,7 @@ const router = useRouter() const collab = useCollabInjected() const store = useEditorStore() const { copy } = useClipboard() +const { dialogs } = useI18n() const collabState = computed(() => collab?.state.value ?? DEFAULT_COLLAB_STATE) const collabPeers = computed(() => collab?.remotePeers.value ?? []) @@ -217,7 +218,7 @@ const onlineCount = computed(() => collabPeers.value.length + 1) @click="onShare" > - Share + {{ dialogs.share }} diff --git a/src/components/VariablesDialog.vue b/src/components/VariablesDialog.vue index fd8c82ca6..9783b9b7d 100644 --- a/src/components/VariablesDialog.vue +++ b/src/components/VariablesDialog.vue @@ -14,7 +14,7 @@ import { } from 'reka-ui' import { FlexRender } from '@tanstack/vue-table' -import { useVariablesEditor } from '@open-pencil/vue' +import { useI18n, useVariablesEditor } from '@open-pencil/vue' import IconHash from '~icons/lucide/hash' import IconPalette from '~icons/lucide/palette' @@ -35,6 +35,8 @@ const variableTypeIcons: Record = { BOOLEAN: IconToggleLeft } +const { dialogs } = useI18n() + const ctx = useVariablesEditor({ colorInput: ColorInput, icons: variableTypeIcons, @@ -50,7 +52,7 @@ const ctx = useVariablesEditor({
- Local variables + {{ dialogs.localVariables }} @@ -59,13 +61,13 @@ const ctx = useVariablesEditor({
-

No variable collections

+

{{ dialogs.noVariableCollections }}

@@ -107,10 +109,10 @@ const ctx = useVariablesEditor({ v-model="ctx.searchTerm.value" data-test-id="variables-search-input" class="w-24 border-none bg-transparent text-xs text-surface outline-none placeholder:text-muted" - placeholder="Search" + :placeholder="dialogs.search" />
- +