mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
String translations
This commit is contained in:
parent
c2aa51ed95
commit
90072904a0
@ -124,10 +124,10 @@ class InvenTreeAPI {
|
||||
showDialog(
|
||||
context: context,
|
||||
child: new SimpleDialog(
|
||||
title: new Text("Not Connected"),
|
||||
title: new Text(I18N.of(context).notConnected),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text("Server not connected"),
|
||||
title: Text(I18N.of(context).serverNotConnected),
|
||||
)
|
||||
]
|
||||
)
|
||||
|
@ -7,6 +7,7 @@ import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
|
||||
import 'package:InvenTree/inventree/stock.dart';
|
||||
import 'package:InvenTree/inventree/part.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:InvenTree/api.dart';
|
||||
|
||||
@ -207,7 +208,7 @@ class BarcodeScanHandler extends BarcodeHandler {
|
||||
showDialog(
|
||||
context: _context,
|
||||
child: SimpleDialog(
|
||||
title: Text("Unknown response"),
|
||||
title: Text(I18N.of(_context).unknownResponse),
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: Text("Response data"),
|
||||
|
2
lib/l10n
2
lib/l10n
@ -1 +1 @@
|
||||
Subproject commit c342d99f068f8ac662dfb729fea0b5867aac1cc6
|
||||
Subproject commit 79b2c87e9611abbae7a7251ac68cbfed475f7699
|
@ -43,16 +43,16 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
||||
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("Server Instance"),
|
||||
title: Text(I18N.of(context).serverInstance),
|
||||
subtitle: Text(InvenTreeAPI().instance.isNotEmpty ? InvenTreeAPI().instance : "Not connected"),
|
||||
)
|
||||
);
|
||||
} else {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("Not Connected"),
|
||||
title: Text(I18N.of(context).notConnected),
|
||||
subtitle: Text(
|
||||
"InvenTree server not connected",
|
||||
I18N.of(context).serverNotConnected,
|
||||
style: TextStyle(fontStyle: FontStyle.italic),
|
||||
)
|
||||
)
|
||||
@ -77,7 +77,7 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
||||
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("Package Name"),
|
||||
title: Text(I18N.of(context).packageName),
|
||||
subtitle: Text("${info.packageName}"),
|
||||
)
|
||||
);
|
||||
@ -98,7 +98,7 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("About InvenTree"),
|
||||
title: Text(I18N.of(context).appAbout),
|
||||
),
|
||||
body: ListView(
|
||||
children: ListTile.divideTiles(
|
||||
|
@ -111,7 +111,7 @@ class InvenTreeDrawer extends StatelessWidget {
|
||||
fit: BoxFit.scaleDown,
|
||||
width: 40,
|
||||
),
|
||||
title: new Text("InvenTree"),
|
||||
title: new Text(I18N.of(context).appTitle),
|
||||
onTap: _home,
|
||||
),
|
||||
/*
|
||||
|
@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:InvenTree/widget/refreshable_state.dart';
|
||||
|
||||
class LocationDisplayWidget extends StatefulWidget {
|
||||
@ -97,8 +97,8 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
if (location == null) {
|
||||
return Card(
|
||||
child: ListTile(
|
||||
title: Text("Stock Locations"),
|
||||
subtitle: Text("Top level stock location")
|
||||
title: Text(I18N.of(context).stockLocations),
|
||||
subtitle: Text(I18N.of(context).stockTopLevel),
|
||||
)
|
||||
);
|
||||
} else {
|
||||
@ -135,14 +135,14 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
||||
return BottomNavigationBar(
|
||||
currentIndex: tabIndex,
|
||||
onTap: onTabSelectionChanged,
|
||||
items: const <BottomNavigationBarItem> [
|
||||
items: <BottomNavigationBarItem> [
|
||||
BottomNavigationBarItem(
|
||||
icon: FaIcon(FontAwesomeIcons.boxes),
|
||||
title: Text("Stock"),
|
||||
title: Text(I18N.of(context).stock),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: FaIcon(FontAwesomeIcons.wrench),
|
||||
title: Text("Actions"),
|
||||
title: Text(I18N.of(context).actions),
|
||||
)
|
||||
]
|
||||
);
|
||||
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:InvenTree/inventree/part.dart';
|
||||
import 'package:InvenTree/widget/full_screen_image.dart';
|
||||
@ -328,7 +329,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("Create Stock Item"),
|
||||
title: Text(I18N.of(context).stockItemCreate),
|
||||
leading: FaIcon(FontAwesomeIcons.box),
|
||||
onTap: null,
|
||||
)
|
||||
@ -377,14 +378,14 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
||||
return BottomNavigationBar(
|
||||
currentIndex: tabIndex,
|
||||
onTap: onTabSelectionChanged,
|
||||
items: const <BottomNavigationBarItem> [
|
||||
items: <BottomNavigationBarItem> [
|
||||
BottomNavigationBarItem(
|
||||
icon: FaIcon(FontAwesomeIcons.infoCircle),
|
||||
title: Text("Details"),
|
||||
title: Text(I18N.of(context).details),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: FaIcon(FontAwesomeIcons.wrench),
|
||||
title: Text("Actions"),
|
||||
title: Text(I18N.of(context).actions),
|
||||
),
|
||||
]
|
||||
);
|
||||
|
@ -303,6 +303,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
title: Text("${item.partName}"),
|
||||
subtitle: Text("${item.partDescription}"),
|
||||
leading: InvenTreeAPI().getImage(item.partImage),
|
||||
trailing: Text(item.serialOrQuantityDisplay()),
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -365,7 +366,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
if (item.isSerialized()) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("Serial Number"),
|
||||
title: Text(I18N.of(context).serialNumber),
|
||||
leading: FaIcon(FontAwesomeIcons.hashtag),
|
||||
trailing: Text("${item.serialNumber}"),
|
||||
)
|
||||
@ -381,7 +382,8 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
}
|
||||
|
||||
// Supplier part?
|
||||
if (item.supplierPartId > 0) {
|
||||
// TODO: Display supplier part info page?
|
||||
if (false && item.supplierPartId > 0) {
|
||||
tiles.add(
|
||||
ListTile(
|
||||
title: Text("${item.supplierName}"),
|
||||
@ -410,7 +412,12 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
leading: FaIcon(FontAwesomeIcons.tasks),
|
||||
trailing: Text("${item.testResultCount}"),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => StockItemTestResultsWidget(item)));
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => StockItemTestResultsWidget(item))
|
||||
).then((context) {
|
||||
refresh();
|
||||
});
|
||||
}
|
||||
)
|
||||
);
|
||||
@ -421,7 +428,12 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
title: Text(I18N.of(context).history),
|
||||
leading: FaIcon(FontAwesomeIcons.history),
|
||||
trailing: Text("${item.trackingItemCount}"),
|
||||
onTap: null,
|
||||
onTap: () {
|
||||
// TODO: Load tracking history
|
||||
|
||||
// TODO: Push tracking history page to the route
|
||||
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -432,7 +444,10 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
title: Text(I18N.of(context).notes),
|
||||
leading: FaIcon(FontAwesomeIcons.stickyNote),
|
||||
trailing: Text(""),
|
||||
onTap: null,
|
||||
onTap: () {
|
||||
// TODO: Load notes in markdown viewer widget
|
||||
// TODO: Make this widget editable?
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user