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:
committed by
GitHub
parent
d9bc2767c1
commit
0490a1c67f
5
.changeset/quick-flies-provide.md
Normal file
5
.changeset/quick-flies-provide.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/dashboard": patch
|
||||
---
|
||||
|
||||
feat(translation): Order translastable entities ordered alphabetically
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user