mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 15:49:15 +00:00
LibUnicode: Port Intl.PluralRules to UTF-16 strings
This commit is contained in:
parent
6fe0e13474
commit
abcb2d42bc
Notes:
github-actions[bot]
2025-07-24 08:41:14 +00:00
Author: https://github.com/trflynn89
Commit: abcb2d42bc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5581
5 changed files with 17 additions and 9 deletions
|
@ -671,7 +671,7 @@ public:
|
|||
if (icu_failure(status))
|
||||
return PluralCategory::Other;
|
||||
|
||||
return plural_category_from_string(icu_string_to_string(result));
|
||||
return plural_category_from_string(icu_string_to_utf16_view(result));
|
||||
}
|
||||
|
||||
virtual PluralCategory select_plural_range(double start, double end) const override
|
||||
|
@ -694,7 +694,7 @@ public:
|
|||
if (icu_failure(status))
|
||||
return PluralCategory::Other;
|
||||
|
||||
return plural_category_from_string(icu_string_to_string(result));
|
||||
return plural_category_from_string(icu_string_to_utf16_view(result));
|
||||
}
|
||||
|
||||
virtual Vector<PluralCategory> available_plural_categories() const override
|
||||
|
@ -710,7 +710,7 @@ public:
|
|||
|
||||
while (true) {
|
||||
i32 length = 0;
|
||||
auto const* category = keywords->next(&length, status);
|
||||
auto const* category = keywords->unext(&length, status);
|
||||
|
||||
if (icu_failure(status) || category == nullptr)
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue