Skip to content

Commit

Permalink
Merge pull request #863 from badeesAbood:fix/rtlCheck
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 660708962
  • Loading branch information
copybara-github committed Aug 8, 2024
2 parents 7dff78c + 4b6ad07 commit 1fb3117
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkgs/intl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Require `package:web` `^0.5.0`.
* Support compiling to WASM.
* Update to and account for `package:lints` `^4.0.0`.
* rtl Detection fix in `bidi.dart` for Kordi Sorani "ckb".

## 0.19.0
* Update to CLDR v44.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/intl/lib/src/intl/bidi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Bidi {
}

static final _rtlLocaleRegex = RegExp(
r'^(ar|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_]'
r'^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_]'
r'(Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))'
r'($|-|_)',
caseSensitive: false);
Expand Down
1 change: 1 addition & 0 deletions pkgs/intl/test/bidi_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void main() {
expect(Bidi.isRtlLanguage('az-Arab'), isTrue);
expect(Bidi.isRtlLanguage('az-ARAB-IR'), isTrue);
expect(Bidi.isRtlLanguage('az_arab_IR'), isTrue);
expect(Bidi.isRtlLanguage('ckb'), isTrue);
Intl.withLocale('en_US', () {
expect(Bidi.isRtlLanguage(), isFalse);
});
Expand Down

0 comments on commit 1fb3117

Please sign in to comment.