docs: document plugin localization contract
This commit is contained in:
parent
9b3f3b6afc
commit
acabe340e9
|
|
@ -46,6 +46,13 @@ official.notes/
|
||||||
"apiVersion": "1",
|
"apiVersion": "1",
|
||||||
"description": "Markdown notes inside Verstak cases.",
|
"description": "Markdown notes inside Verstak cases.",
|
||||||
"source": "official",
|
"source": "official",
|
||||||
|
"localization": {
|
||||||
|
"defaultLocale": "en",
|
||||||
|
"locales": {
|
||||||
|
"en": "locales/en.json",
|
||||||
|
"ru": "locales/ru.json"
|
||||||
|
}
|
||||||
|
},
|
||||||
"provides": [
|
"provides": [
|
||||||
"workspace.notes",
|
"workspace.notes",
|
||||||
"entity.note"
|
"entity.note"
|
||||||
|
|
@ -85,6 +92,35 @@ official.notes/
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 3.1. Локализация
|
||||||
|
|
||||||
|
Локализуемый плагин объявляет собственные JSON-каталоги в `localization`.
|
||||||
|
Пути должны быть относительными, использовать `/` и оставаться внутри каталога
|
||||||
|
плагина. Все значения каталога — строки. Литеральные английские значения в
|
||||||
|
manifest остаются fallback, а переводы metadata используют стабильные ключи:
|
||||||
|
|
||||||
|
```text
|
||||||
|
manifest.name
|
||||||
|
manifest.description
|
||||||
|
contributions.views.<id>.title
|
||||||
|
contributions.commands.<id>.title
|
||||||
|
contributions.statusBarItems.<id>.label
|
||||||
|
```
|
||||||
|
|
||||||
|
Внутренний UI плагина получает текущий язык только через публичный API:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const locale = api.i18n.getLocale();
|
||||||
|
const title = api.i18n.t('ui.title', undefined, 'Notes');
|
||||||
|
const unsubscribe = api.i18n.onDidChangeLocale(nextLocale => {
|
||||||
|
// Обновить текст без перемонтирования компонента и потери состояния.
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Desktop поддерживает `system`, `en` и `ru`. В режиме `system` локали `ru-*`
|
||||||
|
выбирают русский язык, остальные — английский. Плагин отвечает за свои
|
||||||
|
переводы; desktop core не содержит тексты официальных плагинов.
|
||||||
|
|
||||||
## 4. Capabilities Instead Of Plugin Names
|
## 4. Capabilities Instead Of Plugin Names
|
||||||
|
|
||||||
Плагины не должны требовать конкретный плагин, если им нужна способность.
|
Плагины не должны требовать конкретный плагин, если им нужна способность.
|
||||||
|
|
@ -306,4 +342,3 @@ official.notes-0.1.0.vpkg
|
||||||
- checksums/signature later.
|
- checksums/signature later.
|
||||||
|
|
||||||
На первом этапе допустима ручная установка папкой в plugin directory.
|
На первом этапе допустима ручная установка папкой в plugin directory.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ Implemented:
|
||||||
- browser inbox local receiver and minimal official Browser Inbox plugin;
|
- browser inbox local receiver and minimal official Browser Inbox plugin;
|
||||||
- sync server with device/user auth and operation push/pull;
|
- sync server with device/user auth and operation push/pull;
|
||||||
- SDK manifest/types/schema coverage for current plugin APIs;
|
- SDK manifest/types/schema coverage for current plugin APIs;
|
||||||
|
- persisted System/English/Russian application language selection, localized
|
||||||
|
desktop shell, public `api.i18n` plugin contract, and bilingual catalogs for
|
||||||
|
all official plugins;
|
||||||
- automated Go, frontend, official plugin, SDK, and real-sync smoke checks.
|
- automated Go, frontend, official plugin, SDK, and real-sync smoke checks.
|
||||||
|
|
||||||
Known remaining gaps:
|
Known remaining gaps:
|
||||||
|
|
@ -67,6 +70,8 @@ Known remaining gaps:
|
||||||
records conversions. Chunked large-file attachment capture remains future
|
records conversions. Chunked large-file attachment capture remains future
|
||||||
work.
|
work.
|
||||||
- Packaging/update/release workflow is not product-grade yet.
|
- Packaging/update/release workflow is not product-grade yet.
|
||||||
|
- Browser extension UI localization is not yet migrated to the shared
|
||||||
|
multilingual product policy.
|
||||||
|
|
||||||
## 4. Implementation Phases
|
## 4. Implementation Phases
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue