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
95e444ce
Unverified
Commit
95e444ce
authored
Dec 04, 2020
by
Shi-Hao Hong
Committed by
GitHub
Dec 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[gen-l10n] Fix forwarding of output-dir in l10n.yaml file (#71128)
parent
bb29c88a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
localizations.dart
...ter_tools/lib/src/build_system/targets/localizations.dart
+10
-2
localizations_test.dart
...eneral.shard/build_system/targets/localizations_test.dart
+2
-2
No files found.
packages/flutter_tools/lib/src/build_system/targets/localizations.dart
View file @
95e444ce
...
...
@@ -43,7 +43,7 @@ void generateLocalizations({
precacheLanguageAndRegionTags
();
final
String
inputPathString
=
options
?.
arbDirectory
?.
toFilePath
()
??
globals
.
fs
.
path
.
join
(
'lib'
,
'l10n'
);
final
String
inputPathString
=
options
?.
arbDirectory
?.
path
??
globals
.
fs
.
path
.
join
(
'lib'
,
'l10n'
);
final
String
templateArbFileName
=
options
?.
templateArbFile
?.
toFilePath
()
??
'app_en.arb'
;
final
String
outputFileString
=
options
?.
outputLocalizationsFile
?.
toFilePath
()
??
'app_localizations.dart'
;
...
...
@@ -55,6 +55,7 @@ void generateLocalizations({
inputPathString:
inputPathString
,
templateArbFileName:
templateArbFileName
,
outputFileString:
outputFileString
,
outputPathString:
options
?.
outputDirectory
?.
path
,
classNameString:
options
.
outputClass
??
'AppLocalizations'
,
preferredSupportedLocale:
options
.
preferredSupportedLocales
,
headerString:
options
.
header
,
...
...
@@ -155,6 +156,7 @@ class LocalizationOptions {
this
.
untranslatedMessagesFile
,
this
.
header
,
this
.
outputClass
,
this
.
outputDirectory
,
this
.
preferredSupportedLocales
,
this
.
headerFile
,
this
.
deferredLoading
,
...
...
@@ -164,7 +166,7 @@ class LocalizationOptions {
/// The `--arb-dir` argument.
///
/// The directory where all localization files should reside.
/// The directory where all
input
localization files should reside.
final
Uri
arbDirectory
;
/// The `--template-arb-file` argument.
...
...
@@ -190,6 +192,11 @@ class LocalizationOptions {
/// The `--output-class` argument.
final
String
outputClass
;
/// The `--output-dir` argument.
///
/// The directory where all output localization files should be generated.
final
Uri
outputDirectory
;
/// The `--preferred-supported-locales` argument.
final
List
<
String
>
preferredSupportedLocales
;
...
...
@@ -244,6 +251,7 @@ LocalizationOptions parseLocalizationsOptions({
untranslatedMessagesFile:
_tryReadUri
(
yamlMap
,
'untranslated-messages-file'
,
logger
),
header:
_tryReadString
(
yamlMap
,
'header'
,
logger
),
outputClass:
_tryReadString
(
yamlMap
,
'output-class'
,
logger
),
outputDirectory:
_tryReadUri
(
yamlMap
,
'output-dir'
,
logger
),
preferredSupportedLocales:
_tryReadStringList
(
yamlMap
,
'preferred-supported-locales'
,
logger
),
headerFile:
_tryReadUri
(
yamlMap
,
'header-file'
,
logger
),
deferredLoading:
_tryReadBool
(
yamlMap
,
'use-deferred-loading'
,
logger
),
...
...
packages/flutter_tools/test/general.shard/build_system/targets/localizations_test.dart
View file @
95e444ce
...
...
@@ -35,6 +35,7 @@ void main() {
deferredLoading:
true
,
outputClass:
'Foo'
,
outputLocalizationsFile:
Uri
.
file
(
'bar'
),
outputDirectory:
Uri
.
directory
(
fileSystem
.
path
.
join
(
'lib'
,
'l10n'
)),
preferredSupportedLocales:
<
String
>[
'en_US'
],
templateArbFile:
Uri
.
file
(
'example.arb'
),
untranslatedMessagesFile:
Uri
.
file
(
'untranslated'
),
...
...
@@ -50,11 +51,10 @@ void main() {
projectDir:
fileSystem
.
currentDirectory
,
dependenciesDir:
fileSystem
.
currentDirectory
,
);
verify
(
mockLocalizationsGenerator
.
initialize
(
inputPathString:
'arb'
,
outputPathString:
null
,
outputPathString:
fileSystem
.
path
.
join
(
'lib'
,
'l10n/'
)
,
templateArbFileName:
'example.arb'
,
outputFileString:
'bar'
,
classNameString:
'Foo'
,
...
...
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