Closed adil192 closed 1 year ago
Slang has no knowledge about locales (en-US
is as valid as xy-XY
).
So isRtl
will be just a delegate to your given intl
method.
The problem is that slang should not depend on intl
unless it is really necessary.
A clean solution is to write your own extension method for AppLocale
.
extension AppLocaleExt on AppLocale {
bool get isRtl {
// intl call
}
}
Ah okay, for some reason I just assumed that slang was already depending on intl Thanks for your consideration
Motivation
I was implementing
and I needed to find out if the current language was right-to-left. This is the code I used:
Developer Experience Add a getter to
AppLocale
so that the developer can just use e.g.