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
Jonny Borges
2020-08-23 06:55:05 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2020-08-23 06:55:05 -0300
Commit
9bb5245946a38efd25b1e6c4aeba80b87dc68644
9bb52459
1 parent
8bd40117
Update root_widget.dart
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
lib/src/navigation/root/root_widget.dart
lib/src/navigation/root/root_widget.dart
View file @
9bb5245
...
...
@@ -261,6 +261,7 @@ abstract class Translations {
Map
<
String
,
Map
<
String
,
String
>>
get
keys
;
}
extension
Trans
on
String
{
String
get
tr
{
// Returns the key if locale is null.
...
...
@@ -279,9 +280,8 @@ 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
)
{
return
this
;
}
else
if
(
Get
.
translations
.
containsKey
(
}
else
if
(
Get
.
fallbackLocale
!=
null
)
{
if
(
Get
.
translations
.
containsKey
(
"
${Get.fallbackLocale.languageCode}
_
${Get.fallbackLocale.countryCode}
"
)
&&
Get
.
translations
[
"
${Get.fallbackLocale.languageCode}
_
${Get.fallbackLocale.countryCode}
"
]
...
...
@@ -289,11 +289,11 @@ extension Trans on String {
return
Get
.
translations
[
"
${Get.fallbackLocale.languageCode}
_
${Get.fallbackLocale.countryCode}
"
]
[
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
)
&&
}
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