未验证 提交 57e69fe1 编写于 作者: M MennaFadali 提交者: GitHub

Implementing Locale.toLanguageTag in flutter web. (#17131)

上级 ecebfb89
......@@ -478,19 +478,17 @@ class Locale {
int get hashCode => hashValues(languageCode, scriptCode, countryCode);
@override
String toString() {
String toString() => _rawToString('_');
// TODO(yjbanov): implement to match flutter native.
String toLanguageTag() => _rawToString('-');
String _rawToString(String separator) {
final StringBuffer out = StringBuffer(languageCode);
if (scriptCode != null) {
out.write('_$scriptCode');
}
if (_countryCode != null) {
out.write('_$countryCode');
}
if (scriptCode != null) out.write('$separator$scriptCode');
if (_countryCode != null) out.write('$separator$countryCode');
return out.toString();
}
// TODO(yjbanov): implement to match flutter native.
String toLanguageTag() => '_';
}
/// The most basic interface to the host operating system's user interface.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册