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 authored and GitHub committed 2026-01-06 10:35:06 +00:00
1 parent d9bc2767c1
commit 0490a1c67f
2 files changed
+30 -21

No files matched your search

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