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(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
child: new SimpleDialog(
|
child: new SimpleDialog(
|
||||||
title: new Text("Not Connected"),
|
title: new Text(I18N.of(context).notConnected),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
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/stock.dart';
|
||||||
import 'package:InvenTree/inventree/part.dart';
|
import 'package:InvenTree/inventree/part.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
import 'package:InvenTree/api.dart';
|
import 'package:InvenTree/api.dart';
|
||||||
|
|
||||||
@ -207,7 +208,7 @@ class BarcodeScanHandler extends BarcodeHandler {
|
|||||||
showDialog(
|
showDialog(
|
||||||
context: _context,
|
context: _context,
|
||||||
child: SimpleDialog(
|
child: SimpleDialog(
|
||||||
title: Text("Unknown response"),
|
title: Text(I18N.of(_context).unknownResponse),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Response data"),
|
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(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Server Instance"),
|
title: Text(I18N.of(context).serverInstance),
|
||||||
subtitle: Text(InvenTreeAPI().instance.isNotEmpty ? InvenTreeAPI().instance : "Not connected"),
|
subtitle: Text(InvenTreeAPI().instance.isNotEmpty ? InvenTreeAPI().instance : "Not connected"),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Not Connected"),
|
title: Text(I18N.of(context).notConnected),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
"InvenTree server not connected",
|
I18N.of(context).serverNotConnected,
|
||||||
style: TextStyle(fontStyle: FontStyle.italic),
|
style: TextStyle(fontStyle: FontStyle.italic),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -77,7 +77,7 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
|||||||
|
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Package Name"),
|
title: Text(I18N.of(context).packageName),
|
||||||
subtitle: Text("${info.packageName}"),
|
subtitle: Text("${info.packageName}"),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -98,7 +98,7 @@ class InvenTreeAboutWidget extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("About InvenTree"),
|
title: Text(I18N.of(context).appAbout),
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: ListTile.divideTiles(
|
children: ListTile.divideTiles(
|
||||||
|
@ -111,7 +111,7 @@ class InvenTreeDrawer extends StatelessWidget {
|
|||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
width: 40,
|
width: 40,
|
||||||
),
|
),
|
||||||
title: new Text("InvenTree"),
|
title: new Text(I18N.of(context).appTitle),
|
||||||
onTap: _home,
|
onTap: _home,
|
||||||
),
|
),
|
||||||
/*
|
/*
|
||||||
|
@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.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';
|
import 'package:InvenTree/widget/refreshable_state.dart';
|
||||||
|
|
||||||
class LocationDisplayWidget extends StatefulWidget {
|
class LocationDisplayWidget extends StatefulWidget {
|
||||||
@ -97,8 +97,8 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
|||||||
if (location == null) {
|
if (location == null) {
|
||||||
return Card(
|
return Card(
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text("Stock Locations"),
|
title: Text(I18N.of(context).stockLocations),
|
||||||
subtitle: Text("Top level stock location")
|
subtitle: Text(I18N.of(context).stockTopLevel),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -135,14 +135,14 @@ class _LocationDisplayState extends RefreshableState<LocationDisplayWidget> {
|
|||||||
return BottomNavigationBar(
|
return BottomNavigationBar(
|
||||||
currentIndex: tabIndex,
|
currentIndex: tabIndex,
|
||||||
onTap: onTabSelectionChanged,
|
onTap: onTabSelectionChanged,
|
||||||
items: const <BottomNavigationBarItem> [
|
items: <BottomNavigationBarItem> [
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.boxes),
|
icon: FaIcon(FontAwesomeIcons.boxes),
|
||||||
title: Text("Stock"),
|
title: Text(I18N.of(context).stock),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.wrench),
|
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:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:url_launcher/url_launcher.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/inventree/part.dart';
|
||||||
import 'package:InvenTree/widget/full_screen_image.dart';
|
import 'package:InvenTree/widget/full_screen_image.dart';
|
||||||
@ -328,7 +329,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
|
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Create Stock Item"),
|
title: Text(I18N.of(context).stockItemCreate),
|
||||||
leading: FaIcon(FontAwesomeIcons.box),
|
leading: FaIcon(FontAwesomeIcons.box),
|
||||||
onTap: null,
|
onTap: null,
|
||||||
)
|
)
|
||||||
@ -377,14 +378,14 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
|
|||||||
return BottomNavigationBar(
|
return BottomNavigationBar(
|
||||||
currentIndex: tabIndex,
|
currentIndex: tabIndex,
|
||||||
onTap: onTabSelectionChanged,
|
onTap: onTabSelectionChanged,
|
||||||
items: const <BottomNavigationBarItem> [
|
items: <BottomNavigationBarItem> [
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.infoCircle),
|
icon: FaIcon(FontAwesomeIcons.infoCircle),
|
||||||
title: Text("Details"),
|
title: Text(I18N.of(context).details),
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: FaIcon(FontAwesomeIcons.wrench),
|
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}"),
|
title: Text("${item.partName}"),
|
||||||
subtitle: Text("${item.partDescription}"),
|
subtitle: Text("${item.partDescription}"),
|
||||||
leading: InvenTreeAPI().getImage(item.partImage),
|
leading: InvenTreeAPI().getImage(item.partImage),
|
||||||
|
trailing: Text(item.serialOrQuantityDisplay()),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -365,7 +366,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
if (item.isSerialized()) {
|
if (item.isSerialized()) {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("Serial Number"),
|
title: Text(I18N.of(context).serialNumber),
|
||||||
leading: FaIcon(FontAwesomeIcons.hashtag),
|
leading: FaIcon(FontAwesomeIcons.hashtag),
|
||||||
trailing: Text("${item.serialNumber}"),
|
trailing: Text("${item.serialNumber}"),
|
||||||
)
|
)
|
||||||
@ -381,7 +382,8 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Supplier part?
|
// Supplier part?
|
||||||
if (item.supplierPartId > 0) {
|
// TODO: Display supplier part info page?
|
||||||
|
if (false && item.supplierPartId > 0) {
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text("${item.supplierName}"),
|
title: Text("${item.supplierName}"),
|
||||||
@ -410,7 +412,12 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
leading: FaIcon(FontAwesomeIcons.tasks),
|
leading: FaIcon(FontAwesomeIcons.tasks),
|
||||||
trailing: Text("${item.testResultCount}"),
|
trailing: Text("${item.testResultCount}"),
|
||||||
onTap: () {
|
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),
|
title: Text(I18N.of(context).history),
|
||||||
leading: FaIcon(FontAwesomeIcons.history),
|
leading: FaIcon(FontAwesomeIcons.history),
|
||||||
trailing: Text("${item.trackingItemCount}"),
|
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),
|
title: Text(I18N.of(context).notes),
|
||||||
leading: FaIcon(FontAwesomeIcons.stickyNote),
|
leading: FaIcon(FontAwesomeIcons.stickyNote),
|
||||||
trailing: Text(""),
|
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