Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
047f9a9e
Unverified
Commit
047f9a9e
authored
Oct 30, 2018
by
Hans Muller
Committed by
GitHub
Oct 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated supportedLocales doc, etc (#23683)
parent
b1a23299
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
24 deletions
+45
-24
app.dart
packages/flutter/lib/src/material/app.dart
+45
-20
material_localizations.dart
...flutter_localizations/lib/src/material_localizations.dart
+0
-4
No files found.
packages/flutter/lib/src/material/app.dart
View file @
047f9a9e
...
...
@@ -68,6 +68,8 @@ const TextStyle _errorTextStyle = TextStyle(
/// * [Navigator], which is used to manage the app's stack of pages.
/// * [MaterialPageRoute], which defines an app page that transitions in a material-specific way.
/// * [WidgetsApp], which defines the basic app elements but does not depend on the material library.
/// * The Flutter Internationalization Tutorial,
/// <https://flutter.io/tutorials/internationalization/>.
class
MaterialApp
extends
StatefulWidget
{
/// Creates a MaterialApp.
///
...
...
@@ -171,6 +173,33 @@ class MaterialApp extends StatefulWidget {
/// {@macro flutter.widgets.widgetsApp.localizationsDelegates}
///
/// Internationalized apps that require translations for one of the locales
/// listed in [GlobalMaterialLocalizations] should specify this paramter
/// and list the [supportedLocales] that the application can handle.
///
/// ```dart
/// import 'package:flutter_localizations/flutter_localizations.dart';
/// MaterialApp(
/// localizationsDelegates: [
/// // ... app-specific localization delegate[s] here
/// GlobalMaterialLocalizations.delegate,
/// GlobalWidgetsLocalizations.delegate,
/// ],
/// supportedLocales: [
/// const Locale('en', 'US'), // English
/// const Locale('he', 'IL'), // Hebrew
/// // ... other locales the app supports
/// ],
/// // ...
/// )
/// ```
///
/// ## Adding localizations for a new locale
///
/// The information that follows applies to the unusual case of an app
/// adding translations for a language not already supported by
/// [GlobalMaterialLocalizations].
///
/// Delegates that produce [WidgetsLocalizations] and [MaterialLocalizations]
/// are included automatically. Apps can provide their own versions of these
/// localizations by creating implementations of
...
...
@@ -225,6 +254,14 @@ class MaterialApp extends StatefulWidget {
/// // ...
/// )
/// ```
/// See also:
///
/// * [supportedLocales], which must be specified along with
/// [localizationsDelegates].
/// * [GlobalMaterialLocalizations], a [localizationsDelegates] value
/// which provides material localizations for many languages.
/// * The Flutter Internationalization Tutorial,
/// <https://flutter.io/tutorials/internationalization/>.
final
Iterable
<
LocalizationsDelegate
<
dynamic
>>
localizationsDelegates
;
/// {@macro flutter.widgets.widgetsApp.localeResolutionCallback}
...
...
@@ -236,26 +273,14 @@ class MaterialApp extends StatefulWidget {
///
/// It is passed along unmodified to the [WidgetsApp] built by this widget.
///
/// The material widgets include translations for locales with the following
/// language codes:
/// ```
/// ar - Arabic
/// de - German
/// en - English
/// es - Spanish
/// fa - Farsi (Persian)
/// fr - French
/// he - Hebrew
/// it - Italian
/// ja - Japanese
/// ps - Pashto
/// pt - Portugese
/// ro - Romanian
/// ru - Russian
/// sd - Sindhi
/// ur - Urdu
/// zh - Chinese (simplified)
/// ```
/// See also:
///
/// * [localizationsDelegates], which must be specified for localized
/// applications.
/// * [GlobalMaterialLocalizations], a [localizationsDelegates] value
/// which provides material localizations for many languages.
/// * The Flutter Internationalization Tutorial,
/// <https://flutter.io/tutorials/internationalization/>.
final
Iterable
<
Locale
>
supportedLocales
;
/// Turns on a performance overlay.
...
...
packages/flutter_localizations/lib/src/material_localizations.dart
View file @
047f9a9e
...
...
@@ -14,10 +14,6 @@ import 'l10n/date_localizations.dart' as date_localizations;
import
'l10n/localizations.dart'
;
import
'widgets_localizations.dart'
;
// Watch out: the supported locales list in the doc comment below must be kept
// in sync with the list we test, see test/translations_test.dart, and of course
// the actual list of supported locales in _MaterialLocalizationsDelegate.
/// Implementation of localized strings for the material widgets using the
/// `intl` package for date and time formatting.
///
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment