Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
thaihuynhxyz
2020-08-23 16:18:44 +0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8bd40117707751d1af4f8c622a113602082a5588
8bd40117
1 parent
ce01b20b
Fix fallback locale not working if missing country code
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
lib/src/navigation/root/root_widget.dart
lib/src/navigation/root/root_widget.dart
View file @
8bd4011
...
...
@@ -279,8 +279,9 @@ extension Trans on String {
Get
.
translations
[
Get
.
locale
.
languageCode
].
containsKey
(
this
))
{
return
Get
.
translations
[
Get
.
locale
.
languageCode
][
this
];
// If there is no corresponding language or corresponding key, return the key.
}
else
if
(
Get
.
fallbackLocale
!=
null
&&
Get
.
translations
.
containsKey
(
}
else
if
(
Get
.
fallbackLocale
==
null
)
{
return
this
;
}
else
if
(
Get
.
translations
.
containsKey
(
"
${Get.fallbackLocale.languageCode}
_
${Get.fallbackLocale.countryCode}
"
)
&&
Get
.
translations
[
"
${Get.fallbackLocale.languageCode}
_
${Get.fallbackLocale.countryCode}
"
]
...
...
@@ -290,6 +291,9 @@ extension Trans on String {
[
this
];
// Checks if there is a callback language in the absence of the specific country, and if it contains that key.
}
else
if
(
Get
.
translations
.
containsKey
(
Get
.
fallbackLocale
.
languageCode
)
&&
Get
.
translations
[
Get
.
fallbackLocale
.
languageCode
].
containsKey
(
this
))
{
return
Get
.
translations
[
Get
.
fallbackLocale
.
languageCode
][
this
];
}
else
{
return
this
;
}
...
...
Please
register
or
login
to post a comment