feat(translation): Order translastable entities ordered alphabetically (#14451)

Order translastable entities ordered alphabetically
<img width="1178" height="759" alt="Screenshot 2026-01-06 at 08 41 43" src="https://github.com/user-attachments/assets/2eaa2f9c-07c7-46b1-b2ff-3a0660b575d8" />
This commit is contained in:
Adrien de Peretti
2026-01-06 11:35:06 +01:00
committed by GitHub
parent d9bc2767c1
commit 0490a1c67f
2 changed files with 30 additions and 21 deletions

View File

@@ -60,28 +60,32 @@ export const TranslationList = () => {
return []
}
return Object.entries(translatable_fields)
.filter(
([entity]) =>
!["product_option", "product_option_value"].includes(entity)
)
.map(([entity, fields]) => {
const entityStatistics = statistics?.[entity] ?? {
translated: 0,
expected: 0,
}
return (
Object.entries(translatable_fields)
.filter(
([entity]) =>
!["product_option", "product_option_value"].includes(entity)
)
.map(([entity, fields]) => {
const entityStatistics = statistics?.[entity] ?? {
translated: 0,
expected: 0,
}
return {
label: entity
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" "),
reference: entity,
translatableFields: fields,
translatedCount: entityStatistics.translated,
totalCount: entityStatistics.expected,
}
})
return {
label: entity
.split("_")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" "),
reference: entity,
translatableFields: fields,
translatedCount: entityStatistics.translated,
totalCount: entityStatistics.expected,
}
})
// sort by label alphabetically
.sort((a, b) => a.label.localeCompare(b.label))
)
}, [translatable_fields, statistics])
const isReady =