mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-01 19:09:45 +00:00
Simplify and modernize entity components and translations for better performance and consistency
- Replace fragmented name rendering with unified `person.text` in Vue components. - Migrate `GenderIconRenderBox` to use Bootstrap icons and TypeScript. - Introduce `GenderTranslation` type and helper for gender rendering. - Refactor `PersonRenderBox` to streamline rendering logic and improve maintainability. Migrate to typescript - Update French translations for consistency with new gender rendering.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import {Gender, GenderTranslation} from "ChillMainAssets/types";
|
||||
|
||||
/**
|
||||
* Translates a given gender object into its corresponding gender translation string.
|
||||
*
|
||||
* @param {Gender|null} gender - The gender object to be translated, null values are also supported
|
||||
* @return {GenderTranslation} Returns the gender translation string corresponding to the provided gender,
|
||||
* or "unknown" if the gender is null.
|
||||
*/
|
||||
export function toGenderTranslation(gender: Gender|null): GenderTranslation
|
||||
{
|
||||
if (null === gender) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
return gender.genderTranslation;
|
||||
}
|
Reference in New Issue
Block a user