Skip to content

Commit 1731385

Browse files
committed
i18n [nfc]: Add doc on GlobalLocalizations.zulipLocalizations
1 parent abec662 commit 1731385

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/model/localizations.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import '../generated/l10n/zulip_localizations.dart';
22

33
abstract final class GlobalLocalizations {
4+
/// The [ZulipLocalizations] for the user's chosen language and locale.
5+
///
6+
/// Where possible, the [ZulipLocalizations] should be acquired
7+
/// through [ZulipLocalizations.of] instead, using a [BuildContext].
8+
/// This static field is to be used where access to a [BuildContext]
9+
/// is impractical, such as in the API bindings
10+
/// (which use localizations when throwing exceptions).
11+
///
12+
/// This gets set during app startup once we have the user's choice of locale.
13+
/// If accessed before that point, it uses the app's first supported locale,
14+
/// namely 'en'.
415
static ZulipLocalizations zulipLocalizations =
516
lookupZulipLocalizations(ZulipLocalizations.supportedLocales.first);
617
}

0 commit comments

Comments
 (0)