Add translations for color set; options for getting unsorted color,

gender lists
This commit is contained in:
Joshua Ramon Enslin 2022-12-14 16:11:49 +01:00
parent a19f18a193
commit be67089b74
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
4 changed files with 69 additions and 2 deletions

2
l18n

@ -1 +1 @@
Subproject commit 5b72321de74d443356d1a0d5fb7b49927267a309 Subproject commit 6d624efcd90438922b732225772582704b2bd2ed

View File

@ -30,6 +30,26 @@ final class MDColorsSet extends MDValueSet {
"aqua", "aqua",
]; ];
const COLOR_NAMES_AND_EMPTY = [
'',
"black",
"green",
"silver",
"lime",
"gray",
"olive",
"white",
"yellow",
"maroon",
"navy",
"red",
"blue",
"purple",
"teal",
"fuchsia",
"aqua",
];
const COLORS_RGB = [ const COLORS_RGB = [
"black" => [0, 0, 0], "black" => [0, 0, 0],
"green" => [0, 128, 0], "green" => [0, 128, 0],
@ -49,4 +69,27 @@ final class MDColorsSet extends MDValueSet {
"aqua" => [0, 255, 255], "aqua" => [0, 255, 255],
]; ];
/**
* Gets an unsorted list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getUnsortedList(MDTlLoader $tlLoader):array {
return parent::getTlUnsortedList($tlLoader, self::GENDERS, "gender_set", "gender_set");
}
/**
* Gets a list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getSortedList(MDTlLoader $tlLoader):array {
return parent::getTlSortedList($tlLoader, self::COLOR_NAMES, "colors_set", "colors_set");
}
} }

View File

@ -15,9 +15,21 @@ final class MDGenderSet extends MDValueSet {
'', '',
'female', 'female',
'male', 'male',
'gender', 'other',
]; ];
/**
* Gets an unsorted list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getUnsortedList(MDTlLoader $tlLoader):array {
return parent::getTlUnsortedList($tlLoader, self::GENDERS, "gender_set", "gender_set");
}
/** /**
* Gets a sorted list of the entries in a translated version. * Gets a sorted list of the entries in a translated version.
* *

View File

@ -20,6 +20,18 @@ final class MDObjectFormSet extends MDValueSet {
'cylinder', 'cylinder',
]; ];
/**
* Gets an unsorted list of the entries in a translated version.
*
* @param MDTlLoader $tlLoader Translation loader.
*
* @return array<string>
*/
public static function getUnsortedList(MDTlLoader $tlLoader):array {
return parent::getTlUnsortedList($tlLoader, self::FORMS, "object_form_set", "object_form_set");
}
/** /**
* Gets a sorted list of the entries in a translated version. * Gets a sorted list of the entries in a translated version.
* *