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
Jason Law
2020-07-17 21:05:54 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8f063e3a6a310bc0690f1105b1905eb9c0bd0926
8f063e3a
1 parent
2daff016
Prevent null value return
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
lib/src/root/root_widget.dart
lib/src/root/root_widget.dart
View file @
8f063e3
...
...
@@ -258,14 +258,15 @@ abstract class Translations {
extension
Trans
on
String
{
String
get
tr
{
if
(
Get
.
locale
?.
languageCode
==
null
)
return
this
;
if
(
Get
.
translations
.
containsKey
(
"
${Get.locale.languageCode}
_
${Get.locale.countryCode}
"
))
{
if
(
Get
.
translations
.
containsKey
(
"
${Get.locale.languageCode}
_
${Get.locale.countryCode}
"
)
&&
Get
.
translations
[
"
${Get.locale.languageCode}
_
${Get.locale.countryCode}
"
]
.
containsKey
(
this
))
{
return
Get
.
translations
[
"
${Get.locale.languageCode}
_
${Get.locale.countryCode}
"
][
this
];
}
else
if
(
Get
.
translations
.
containsKey
(
Get
.
locale
.
languageCode
))
{
}
else
if
(
Get
.
translations
.
containsKey
(
Get
.
locale
.
languageCode
)
&&
Get
.
translations
[
Get
.
locale
.
languageCode
].
containsKey
(
this
))
{
return
Get
.
translations
[
Get
.
locale
.
languageCode
][
this
];
}
else
if
(
Get
.
translations
.
isNotEmpty
)
{
return
Get
.
translations
.
values
.
first
[
this
];
}
else
{
return
this
;
}
...
...
Please
register
or
login
to post a comment