Skip to content

Commit

Permalink
Fix: #4656 - Provide options for phonetic/romanized type fields
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Dec 13, 2022
1 parent 2828136 commit a046a25
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/Elements/PhoneticType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ public function canonical(string $value): string
{
return strtoupper(parent::canonical($value));
}

/**
* A list of controlled values for this element
*
* @return array<int|string,string>
*/
public function values(): array
{
return [
'' => '',
'HANGUL' => 'hangul',
'KANA' => 'kana',
];
}
}
16 changes: 16 additions & 0 deletions app/Elements/RomanizedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,20 @@ public function canonical(string $value): string
{
return strtoupper(parent::canonical($value));
}

/**
* A list of controlled values for this element
*
* @return array<int|string,string>
*/
public function values(): array
{
return [
'' => '',
'ELOT 743' => 'ELOT 743',
'PINYIN' => 'pinyin',
'ROMAJI' => 'romaji',
'WADEGILES' => 'wadegiles',
];
}
}

0 comments on commit a046a25

Please sign in to comment.