2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-14 03:05:32 +00:00
Files
inventree-app/lib/l10.dart
Oliver 1ab171f619 Barcode scan refactor (#651)
* Build file changes

Lots of changes required to meet compatibility of new mobile_scanner lib

* Increase build memory

* Refactor camera controller

- Use MobileScanner now
- Much better UX / feedback

* Cleanup

* Move test sheet file

* Update release notes

* Move actions to floating action buttons

* Tweak deps

* tweak github actions

* Updates
2025-06-06 14:54:03 +10:00

29 lines
615 B
Dart

import "package:inventree/l10n/collected/app_localizations.dart";
import "package:inventree/l10n/collected/app_localizations_en.dart";
import "package:one_context/one_context.dart";
import "package:flutter/material.dart";
import "package:inventree/helpers.dart";
// Shortcut function to reduce boilerplate!
I18N L10()
{
// Testing mode - ignore context
if (!hasContext()) {
return I18NEn();
}
BuildContext? _ctx = OneContext().context;
if (_ctx != null) {
I18N? i18n = I18N.of(_ctx);
if (i18n != null) {
return i18n;
}
}
// Fallback for "null" context
return I18NEn();
}