Skip to content

Commit

Permalink
remove CLDR main name from list of tags
Browse files Browse the repository at this point in the history
This prevents double output on the codepoint description pages.
  • Loading branch information
Boldewyn committed Dec 27, 2023
1 parent 74055d4 commit b1eecf4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions codepoints.net/lib/Unicode/CodepointInfo/CLDR.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,18 @@ public function __invoke(Codepoint $codepoint) : Array {
WHERE cp = ?
AND lang = ?', $codepoint->id, $this->lang);
if ($data) {
$cldr_data['tags'] = array_map(
function(Array $item) : string {
return $item['annotation'];
}, array_filter($data, function (Array $item) : bool {
return $item['type'] === 'tag';
}));
$tts = array_filter($data, function (Array $item) : bool {
return $item['type'] === 'tts';
});
if ($tts) {
$cldr_data['tts'] = (string)(reset($tts)['annotation']);
}
$cldr_data['tags'] = array_map(
function(Array $item) : string {
return $item['annotation'];
}, array_filter($data, function (Array $item) use ($cldr_data) : bool {
return $item['type'] === 'tag' && $item['annotation'] !== $cldr_data['tts'];
}));
}
return $cldr_data;
}
Expand Down

0 comments on commit b1eecf4

Please sign in to comment.