mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Start of unit tests for the actual API code
This commit is contained in:
parent
62b0fcbec5
commit
e424a3cf7b
6 changed files with 103 additions and 51 deletions
14
lib/l10.dart
14
lib/l10.dart
|
|
@ -7,16 +7,18 @@ import "package:flutter/material.dart";
|
|||
// Shortcut function to reduce boilerplate!
|
||||
I18N L10()
|
||||
{
|
||||
BuildContext? _ctx = OneContext().context;
|
||||
if (OneContext.hasContext) {
|
||||
BuildContext? _ctx = OneContext().context;
|
||||
|
||||
if (_ctx != null) {
|
||||
I18N? i18n = I18N.of(_ctx);
|
||||
if (_ctx != null) {
|
||||
I18N? i18n = I18N.of(_ctx);
|
||||
|
||||
if (i18n != null) {
|
||||
return i18n;
|
||||
if (i18n != null) {
|
||||
return i18n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback for "null" context
|
||||
return I18NEn();
|
||||
return I18NEn();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue