Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/30512-plugin-approvals-locales-b.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/plugin-approvals': patch
---

i18n(plugin-approvals): the approval objects, notifications, record page and e-mail link line ship in Russian, German and Korean

Clause-②: no
Metadata-protocol: none

The approval objects (`sys_approval_request`, `sys_approval_action`, `sys_approval_delegation`), the approval notifications' sentences, the approval request record page (its label and its Details / Timeline tabs) and the line that opens an approval from its e-mail now carry `ru`, `de` and `ko` as well, so the package ships all eleven platform languages. Each new locale is registered under its platform-table tag with its source-hash companion, its page entry and its messages, and the package's extract command lists the tags, so the existing `check:i18n` bundle check covers them. The e-mail templates' shape, the template selection and `EMAIL_TEMPLATE_FLOOR_LOCALE` are unchanged; only the link line is added per locale. Second half of package 9 of #30512.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* strings were seeded from @objectstack/platform-objects.)
*
* os i18n extract packages/plugins/plugin-approvals/scripts/i18n-extract.config.ts \
* --locales=zh-CN,ja-JP,es-ES,zh-Hant,ar,fr,pt-BR --fill=default --objects-only --no-metadata-forms \
* --locales=zh-CN,ja-JP,es-ES,zh-Hant,ar,fr,pt-BR,ru,de,ko --fill=default --objects-only --no-metadata-forms \
* --source-hashes \
* --out=packages/plugins/plugin-approvals/src/translations
*
Expand Down Expand Up @@ -64,6 +64,9 @@ import { zhHantObjects } from '../src/translations/zh-Hant.objects.generated.js'
import { arObjects } from '../src/translations/ar.objects.generated.js';
import { frObjects } from '../src/translations/fr.objects.generated.js';
import { ptBRObjects } from '../src/translations/pt-BR.objects.generated.js';
import { ruObjects } from '../src/translations/ru.objects.generated.js';
import { deObjects } from '../src/translations/de.objects.generated.js';
import { koObjects } from '../src/translations/ko.objects.generated.js';
import { approvalsPageTranslations } from '../src/translations/pages.js';

/**
Expand Down Expand Up @@ -92,6 +95,9 @@ const config: ObjectStackDefinition = defineStack({
{ ar: { objects: arObjects, pages: approvalsPageTranslations['ar'] } },
{ fr: { objects: frObjects, pages: approvalsPageTranslations['fr'] } },
{ 'pt-BR': { objects: ptBRObjects, pages: approvalsPageTranslations['pt-BR'] } },
{ ru: { objects: ruObjects, pages: approvalsPageTranslations['ru'] } },
{ de: { objects: deObjects, pages: approvalsPageTranslations['de'] } },
{ ko: { objects: koObjects, pages: approvalsPageTranslations['ko'] } },
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import { zhHantObjects } from './translations/zh-Hant.objects.generated.js';
import { arObjects } from './translations/ar.objects.generated.js';
import { frObjects } from './translations/fr.objects.generated.js';
import { ptBRObjects } from './translations/pt-BR.objects.generated.js';
import { ruObjects } from './translations/ru.objects.generated.js';
import { deObjects } from './translations/de.objects.generated.js';
import { koObjects } from './translations/ko.objects.generated.js';

/** The design-record vocabulary an admin-facing string must not carry. */
const DESIGN_RECORD_VOCABULARY: ReadonlyArray<readonly [string, RegExp]> = [
Expand Down Expand Up @@ -97,7 +100,7 @@ function isObjectSchema(v: unknown): v is ObjectLike {
&& !!(v as ObjectLike).fields && typeof (v as ObjectLike).fields === 'object';
}

const OBJECT_BUNDLES = { en: enObjects, 'zh-CN': zhCNObjects, 'ja-JP': jaJPObjects, 'es-ES': esESObjects, 'zh-Hant': zhHantObjects, 'ar': arObjects, 'fr': frObjects, 'pt-BR': ptBRObjects } as const;
const OBJECT_BUNDLES = { en: enObjects, 'zh-CN': zhCNObjects, 'ja-JP': jaJPObjects, 'es-ES': esESObjects, 'zh-Hant': zhHantObjects, 'ar': arObjects, 'fr': frObjects, 'pt-BR': ptBRObjects, 'ru': ruObjects, 'de': deObjects, 'ko': koObjects } as const;

describe('approval objects: admin-facing copy carries no design-record vocabulary', () => {
it('the matcher recognises each kind of vocabulary it exists to keep out', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const APPROVAL_EMAIL_CHANNELS: readonly string[] = Object.freeze(['inbox'
* The line that opens the request, per locale the approval catalog carries
* (`translations/messages.ts`). `{{approvalUrl}}` is the payload member.
*/
export const APPROVAL_EMAIL_LINK_LINES: Readonly<Record<'en' | 'zh-CN' | 'ja-JP' | 'es-ES' | 'zh-Hant' | 'ar' | 'fr' | 'pt-BR', string>> = {
export const APPROVAL_EMAIL_LINK_LINES: Readonly<Record<'en' | 'zh-CN' | 'ja-JP' | 'es-ES' | 'zh-Hant' | 'ar' | 'fr' | 'pt-BR' | 'ru' | 'de' | 'ko', string>> = {
en: 'Open the approval: {{approvalUrl}}',
'zh-CN': '打开审批:{{approvalUrl}}',
'ja-JP': '承認を開く: {{approvalUrl}}',
Expand All @@ -61,6 +61,9 @@ export const APPROVAL_EMAIL_LINK_LINES: Readonly<Record<'en' | 'zh-CN' | 'ja-JP'
ar: 'افتح الموافقة: {{approvalUrl}}',
fr: 'Ouvrir l’approbation : {{approvalUrl}}',
'pt-BR': 'Abrir a aprovação: {{approvalUrl}}',
ru: 'Открыть согласование: {{approvalUrl}}',
de: 'Genehmigung öffnen: {{approvalUrl}}',
ko: '승인 열기: {{approvalUrl}}',
};

/** The e-mail templates: every emailed topic in every catalog locale. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe('sys_approval_request detail page — its label in the translation bund

it('every served locale carries the label, and a translated locale serves its translation', () => {
const locales = Object.keys(ApprovalsTranslations).sort();
expect(locales).toEqual(['ar', 'en', 'es-ES', 'fr', 'ja-JP', 'pt-BR', 'zh-CN', 'zh-Hant']);
expect(locales).toEqual(['ar', 'de', 'en', 'es-ES', 'fr', 'ja-JP', 'ko', 'pt-BR', 'ru', 'zh-CN', 'zh-Hant']);
for (const locale of locales) {
const served = (ApprovalsTranslations as AnyRec)[locale]?.pages?.[NAME]?.label;
const authored = (approvalsPageTranslations as AnyRec)[locale]?.[NAME]?.label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ export const SysApprovalRequestDetailPage: Page = {
position: 'top',
items: [
{
label: { en: 'Details', 'zh-CN': '详情', 'ja-JP': '詳細', 'es-ES': 'Detalles', 'zh-Hant': '詳細資料', 'ar': 'التفاصيل', 'fr': 'Détails', 'pt-BR': 'Detalhes' },
label: { en: 'Details', 'zh-CN': '详情', 'ja-JP': '詳細', 'es-ES': 'Detalles', 'zh-Hant': '詳細資料', 'ar': 'التفاصيل', 'fr': 'Détails', 'pt-BR': 'Detalhes', 'ru': 'Подробности', 'de': 'Details', 'ko': '세부 정보' },
icon: 'file-text',
children: [{ type: 'record:details' }],
},
{
label: { en: 'Timeline', 'zh-CN': '时间线', 'ja-JP': 'タイムライン', 'es-ES': 'Cronología', 'zh-Hant': '時間軸', 'ar': 'المخطط الزمني', 'fr': 'Chronologie', 'pt-BR': 'Linha do tempo' },
label: { en: 'Timeline', 'zh-CN': '时间线', 'ja-JP': 'タイムライン', 'es-ES': 'Cronología', 'zh-Hant': '時間軸', 'ar': 'المخطط الزمني', 'fr': 'Chronologie', 'pt-BR': 'Linha do tempo', 'ru': 'Хронология', 'de': 'Verlauf', 'ko': '타임라인' },
icon: 'history',
children: [
{
Expand All @@ -139,7 +139,7 @@ export const SysApprovalRequestDetailPage: Page = {
sort: [{ field: 'created_at', order: 'desc' }],
limit: 50,
showViewAll: true,
title: { en: 'Timeline', 'zh-CN': '时间线', 'ja-JP': 'タイムライン', 'es-ES': 'Cronología', 'zh-Hant': '時間軸', 'ar': 'المخطط الزمني', 'fr': 'Chronologie', 'pt-BR': 'Linha do tempo' },
title: { en: 'Timeline', 'zh-CN': '时间线', 'ja-JP': 'タイムライン', 'es-ES': 'Cronología', 'zh-Hant': '時間軸', 'ar': 'المخطط الزمني', 'fr': 'Chronologie', 'pt-BR': 'Linha do tempo', 'ru': 'Хронология', 'de': 'Verlauf', 'ko': '타임라인' },
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe('approval status vocabulary (#7232)', () => {
// Ratchet for statuses and locales added later: a new entry that reaches a
// bundle un-translated is seeded from the source text, which is the enum
// value itself, so this case catches it without naming it.
for (const locale of ['en', 'zh-CN', 'ja-JP', 'es-ES', 'zh-Hant', 'ar', 'fr', 'pt-BR']) {
for (const locale of ['en', 'zh-CN', 'ja-JP', 'es-ES', 'zh-Hant', 'ar', 'fr', 'pt-BR', 'ru', 'de', 'ko']) {
const labels = resolvedStatusLabels(locale);
expect(Object.keys(labels).sort()).toEqual([...APPROVAL_STATUSES].sort());
const raw = Object.entries(labels)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import { zhHantObjects } from './zh-Hant.objects.generated.js';
import { arObjects } from './ar.objects.generated.js';
import { frObjects } from './fr.objects.generated.js';
import { ptBRObjects } from './pt-BR.objects.generated.js';
import { ruObjects } from './ru.objects.generated.js';
import { deObjects } from './de.objects.generated.js';
import { koObjects } from './ko.objects.generated.js';
import { SysApprovalRequest } from '../sys-approval-request.object.js';

interface CopyAction {
Expand Down Expand Up @@ -53,6 +56,9 @@ const TRANSLATED = [
['ar', arObjects],
['fr', frObjects],
['pt-BR', ptBRObjects],
['ru', ruObjects],
['de', deObjects],
['ko', koObjects],
] as const;

describe('approval_approve — the decision question', () => {
Expand Down
Loading
Loading