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
e7d78b69
Unverified
Commit
e7d78b69
authored
Nov 09, 2019
by
Shi-Hao Hong
Committed by
GitHub
Nov 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use raw string for l10n description (#44451)
* Use raw string for l10n description * Stock app refresh
parent
924ab725
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
gen_l10n.dart
dev/tools/localization/gen_l10n.dart
+1
-1
messages_all.dart
examples/stocks/lib/i18n/messages_all.dart
+4
-4
stock_strings.dart
examples/stocks/lib/i18n/stock_strings.dart
+6
-7
No files found.
dev/tools/localization/gen_l10n.dart
View file @
e7d78b69
...
...
@@ -164,7 +164,7 @@ List<String> genIntlMethodArgs(Map<String, dynamic> bundle, String key) {
if
(
attributesMap
!=
null
)
{
if
(
attributesMap
.
containsKey
(
'description'
))
{
final
String
description
=
attributesMap
[
'description'
];
attributes
.
add
(
'desc:
\'
$description
\'
'
);
attributes
.
add
(
'desc:
${generateString(description)}
'
);
}
if
(
attributesMap
.
containsKey
(
'placeholders'
))
{
final
Map
<
String
,
dynamic
>
placeholders
=
attributesMap
[
'placeholders'
];
...
...
examples/stocks/lib/i18n/messages_all.dart
View file @
e7d78b69
...
...
@@ -15,21 +15,21 @@ import 'package:intl/intl.dart';
import
'package:intl/message_lookup_by_library.dart'
;
import
'package:intl/src/intl_helpers.dart'
;
import
'messages_en_US.dart'
as
messages_en_us
;
import
'messages_es_ES.dart'
as
messages_es_es
;
import
'messages_en_US.dart'
as
messages_en_us
;
typedef
Future
<
dynamic
>
LibraryLoader
();
Map
<
String
,
LibraryLoader
>
_deferredLibraries
=
{
'en_US'
:
()
=>
new
Future
.
value
(
null
),
'es_ES'
:
()
=>
new
Future
.
value
(
null
),
'en_US'
:
()
=>
new
Future
.
value
(
null
),
};
MessageLookupByLibrary
_findExact
(
String
localeName
)
{
switch
(
localeName
)
{
case
'en_US'
:
return
messages_en_us
.
messages
;
case
'es_ES'
:
return
messages_es_es
.
messages
;
case
'en_US'
:
return
messages_en_us
.
messages
;
default
:
return
null
;
}
...
...
examples/stocks/lib/i18n/stock_strings.dart
View file @
e7d78b69
...
...
@@ -30,8 +30,7 @@ import 'messages_all.dart';
///
/// ```
/// dependencies:
/// # rest of dependencies
///
/// # Internationalization support.
/// flutter_localizations:
/// sdk: flutter
/// intl: 0.16.0
...
...
@@ -90,8 +89,8 @@ class StockStrings {
/// A list of this localizations delegate's supported locales.
static
const
List
<
Locale
>
supportedLocales
=
<
Locale
>[
Locale
(
'en'
,
'US'
),
Locale
(
'es'
,
'ES'
),
Locale
(
'en'
,
'US'
),
];
String
title
()
{
...
...
@@ -99,7 +98,7 @@ class StockStrings {
r'Stocks'
,
locale:
_localeName
,
name:
'title'
,
desc:
'Title for the Stocks application'
,
desc:
r
'Title for the Stocks application'
,
args:
<
Object
>[]
);
}
...
...
@@ -109,7 +108,7 @@ class StockStrings {
r'MARKET'
,
locale:
_localeName
,
name:
'market'
,
desc:
'Label for the Market tab'
,
desc:
r
'Label for the Market tab'
,
args:
<
Object
>[]
);
}
...
...
@@ -119,7 +118,7 @@ class StockStrings {
r'PORTFOLIO'
,
locale:
_localeName
,
name:
'portfolio'
,
desc:
'Label for the Portfolio tab'
,
desc:
r
'Label for the Portfolio tab'
,
args:
<
Object
>[]
);
}
...
...
@@ -133,7 +132,7 @@ class _StockStringsDelegate extends LocalizationsDelegate<StockStrings> {
Future
<
StockStrings
>
load
(
Locale
locale
)
=>
StockStrings
.
load
(
locale
);
@override
bool
isSupported
(
Locale
locale
)
=>
<
String
>[
'e
n'
,
'es
'
].
contains
(
locale
.
languageCode
);
bool
isSupported
(
Locale
locale
)
=>
<
String
>[
'e
s'
,
'en
'
].
contains
(
locale
.
languageCode
);
@override
bool
shouldReload
(
_StockStringsDelegate
old
)
=>
false
;
...
...
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