Skip to content

Commit c8ef924

Browse files
authored
fix(next): add missing translations to version view
<!-- Thank you for the PR! Please go through the checklist below and make sure you've completed all the steps. Please review the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository if you haven't already. The following items will ensure that your PR is handled as smoothly as possible: - PR Title must follow conventional commits format. For example, `feat: my new feature`, `fix(plugin-seo): my fix`. - Minimal description explained as if explained to someone not immediately familiar with the code. - Provide before/after screenshots or code diffs if applicable. - Link any related issues/discussions from GitHub or Discord. - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Fixes # --> ### What? This PR translates the block and item label in the version view, as well as the version label in the step nav. ### Why? To appropriately translate labels in the version views. ### How? By using the TFunction from useTranslation as well as existing translation keys. Fixes #13193 Fixes #13194
1 parent b7243b1 commit c8ef924

File tree

32 files changed

+63
-61
lines changed

32 files changed

+63
-61
lines changed

packages/next/src/views/Version/Default/SetStepNav.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const SetStepNav: React.FC<{
9090
}),
9191
},
9292
{
93-
label: 'Versions',
93+
label: t('version:versions'),
9494
url: formatAdminURL({
9595
adminRoute,
9696
path: `${docBasePath}/versions`,
@@ -118,7 +118,7 @@ export const SetStepNav: React.FC<{
118118
}),
119119
},
120120
{
121-
label: 'Versions',
121+
label: t('version:versions'),
122122
url: formatAdminURL({
123123
adminRoute,
124124
path: `/globals/${globalSlug}/versions`,

packages/next/src/views/Version/RenderFieldsToDiff/fields/Iterable/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const Iterable: React.FC<FieldDiffClientProps> = ({
2525
parentIsLocalized,
2626
versionValue: valueTo,
2727
}) => {
28-
const { i18n } = useTranslation()
28+
const { i18n, t } = useTranslation()
2929
const { selectedLocales } = useSelectedLocales()
3030
const { config } = useConfig()
3131

@@ -73,7 +73,9 @@ export const Iterable: React.FC<FieldDiffClientProps> = ({
7373
})
7474

7575
const rowNumber = String(i + 1).padStart(2, '0')
76-
const rowLabel = fieldIsArrayType(field) ? `Item ${rowNumber}` : `Block ${rowNumber}`
76+
const rowLabel = fieldIsArrayType(field)
77+
? `${t('general:item')} ${rowNumber}`
78+
: `${t('fields:block')} ${rowNumber}`
7779

7880
return (
7981
<div className={`${baseClass}__row`} key={i}>

packages/translations/src/languages/az.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const azTranslations: DefaultTranslationsObject = {
143143
addNewLabel: 'Yeni {{label}} əlavə et',
144144
addRelationship: 'Relationship əlavə et',
145145
addUpload: 'Yükləmə əlavə et',
146-
block: 'blok',
146+
block: 'Blok',
147147
blocks: 'bloklar',
148148
blockType: 'Blok Növü',
149149
chooseBetweenCustomTextOrDocument:
@@ -328,7 +328,7 @@ export const azTranslations: DefaultTranslationsObject = {
328328
groupByLabel: '{{label}} ilə qruplaşdırın',
329329
import: 'İdxal',
330330
isEditing: 'redaktə edir',
331-
item: 'əşya',
331+
item: 'Əşya',
332332
items: 'maddələr',
333333
language: 'Dil',
334334
lastModified: 'Son dəyişdirildi',

packages/translations/src/languages/bg.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const bgTranslations: DefaultTranslationsObject = {
143143
addNewLabel: 'Добави нов {{label}}',
144144
addRelationship: 'Добави отношение',
145145
addUpload: 'Качи',
146-
block: 'блок',
146+
block: 'Блок',
147147
blocks: 'блокове',
148148
blockType: 'Тип блок',
149149
chooseBetweenCustomTextOrDocument:
@@ -325,7 +325,7 @@ export const bgTranslations: DefaultTranslationsObject = {
325325
groupByLabel: 'Групирай по {{label}}',
326326
import: 'Внос',
327327
isEditing: 'редактира',
328-
item: 'артикул',
328+
item: 'Aртикул',
329329
items: 'артикули',
330330
language: 'Език',
331331
lastModified: 'Последно променено',

packages/translations/src/languages/ca.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const caTranslations: DefaultTranslationsObject = {
144144
addNewLabel: 'Afegeix nou {{label}}',
145145
addRelationship: 'Afegeix relació',
146146
addUpload: 'Afegeix pujada',
147-
block: 'bloc',
147+
block: 'Bloc',
148148
blocks: 'blocs',
149149
blockType: 'Tipus de bloc',
150150
chooseBetweenCustomTextOrDocument:
@@ -327,7 +327,7 @@ export const caTranslations: DefaultTranslationsObject = {
327327
groupByLabel: 'Agrupa per {{label}}',
328328
import: 'Importar',
329329
isEditing: 'esta editant',
330-
item: 'element',
330+
item: 'Element',
331331
items: 'articles',
332332
language: 'Idioma',
333333
lastModified: 'Última modificació',

packages/translations/src/languages/cs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export const csTranslations: DefaultTranslationsObject = {
143143
addNewLabel: 'Přidat nový {{label}}',
144144
addRelationship: 'Přidat vztah',
145145
addUpload: 'Přidat nahrávání',
146-
block: 'blok',
146+
block: 'Blok',
147147
blocks: 'bloky',
148148
blockType: 'Typ bloku',
149149
chooseBetweenCustomTextOrDocument:
@@ -324,7 +324,7 @@ export const csTranslations: DefaultTranslationsObject = {
324324
groupByLabel: 'Seskupit podle {{label}}',
325325
import: 'Import',
326326
isEditing: 'upravuje',
327-
item: 'položka',
327+
item: 'Položka',
328328
items: 'položky',
329329
language: 'Jazyk',
330330
lastModified: 'Naposledy změněno',

packages/translations/src/languages/da.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const daTranslations: DefaultTranslationsObject = {
142142
addNewLabel: 'Tilføj ny {{label}}',
143143
addRelationship: 'Tilføj forhold',
144144
addUpload: 'Tilføj upload',
145-
block: 'blok',
145+
block: 'Blok',
146146
blocks: 'blokke',
147147
blockType: 'Blok type',
148148
chooseBetweenCustomTextOrDocument:
@@ -324,7 +324,7 @@ export const daTranslations: DefaultTranslationsObject = {
324324
groupByLabel: 'Gruppér efter {{label}}',
325325
import: 'Import',
326326
isEditing: 'redigerer',
327-
item: 'vare',
327+
item: 'Vare',
328328
items: 'elementer',
329329
language: 'Sprog',
330330
lastModified: 'Sidst ændret',

packages/translations/src/languages/en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const enTranslations = {
145145
addNewLabel: 'Add new {{label}}',
146146
addRelationship: 'Add Relationship',
147147
addUpload: 'Add Upload',
148-
block: 'block',
148+
block: 'Block',
149149
blocks: 'blocks',
150150
blockType: 'Block Type',
151151
chooseBetweenCustomTextOrDocument:
@@ -329,7 +329,7 @@ export const enTranslations = {
329329
groupByLabel: 'Group by {{label}}',
330330
import: 'Import',
331331
isEditing: 'is editing',
332-
item: 'item',
332+
item: 'Item',
333333
items: 'items',
334334
language: 'Language',
335335
lastModified: 'Last Modified',

packages/translations/src/languages/es.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const esTranslations: DefaultTranslationsObject = {
147147
addNewLabel: 'Añadir {{label}}',
148148
addRelationship: 'Añadir Relación',
149149
addUpload: 'Añadir documento',
150-
block: 'bloque',
150+
block: 'Bloque',
151151
blocks: 'bloques',
152152
blockType: 'Tipo de bloque',
153153
chooseBetweenCustomTextOrDocument:
@@ -331,7 +331,7 @@ export const esTranslations: DefaultTranslationsObject = {
331331
groupByLabel: 'Agrupar por {{label}}',
332332
import: 'Importar',
333333
isEditing: 'está editando',
334-
item: 'artículo',
334+
item: 'Artículo',
335335
items: 'artículos',
336336
language: 'Idioma',
337337
lastModified: 'Última modificación',

packages/translations/src/languages/et.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const etTranslations: DefaultTranslationsObject = {
142142
addNewLabel: 'Lisa uus {{label}}',
143143
addRelationship: 'Lisa seos',
144144
addUpload: 'Lisa üleslaadimine',
145-
block: 'plokk',
145+
block: 'Plokk',
146146
blocks: 'plokid',
147147
blockType: 'Ploki tüüp',
148148
chooseBetweenCustomTextOrDocument:
@@ -323,7 +323,7 @@ export const etTranslations: DefaultTranslationsObject = {
323323
groupByLabel: 'Rühmita {{label}} järgi',
324324
import: 'Importimine',
325325
isEditing: 'muudab',
326-
item: 'üksus',
326+
item: 'Üksus',
327327
items: 'esemed',
328328
language: 'Keel',
329329
lastModified: 'Viimati muudetud',

0 commit comments

Comments
 (0)