Skip to content

Commit c3171cf

Browse files
brianquinlancommit-bot@chromium.org
authored andcommitted
Add some more documentation for Platform.localeName.
Change-Id: I0b08cea81f47b03fcdf82fa378c37e28889113c9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215153 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Brian Quinlan <[email protected]>
1 parent a4d8f34 commit c3171cf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sdk/lib/io/platform.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ class Platform {
7474
static String get pathSeparator => _pathSeparator;
7575

7676
/// Get the name of the current locale.
77+
///
78+
/// The result should include a language and country code
79+
/// (e.g. "en_US", "de_AT") and may include a character set
80+
/// (e.g. "en_US.UTF-8").
81+
///
82+
/// On Linux and Fushia, the locale is taken from the "LANG" environment
83+
/// variable, which may be set to any value. For example:
84+
/// ```shell
85+
/// LANG=kitten dart myfile.dart # localeName is "kitten"
86+
/// ```
87+
///
88+
/// On Android, the value will not change while the application is running,
89+
/// even if the user adjusts their language settings.
90+
///
91+
/// See https://en.wikipedia.org/wiki/Locale_(computer_software)
7792
static String get localeName => _Platform.localeName();
7893

7994
/// A string representing the operating system or platform.

0 commit comments

Comments
 (0)