mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-10-30 21:05:42 +00:00 
			
		
		
		
	Make a bunch o' strings translateable
This commit is contained in:
		
							
								
								
									
										2
									
								
								lib/l10n
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										2
									
								
								lib/l10n
									
									
									
									
									
								
							 Submodule lib/l10n updated: 0b80ffb67a...bd7d32707b
									
								
							| @@ -3,6 +3,8 @@ import 'package:InvenTree/api.dart'; | ||||
| import 'package:InvenTree/inventree/part.dart'; | ||||
| import 'package:InvenTree/preferences.dart'; | ||||
|  | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
|  | ||||
| import 'package:InvenTree/widget/part_detail.dart'; | ||||
| import 'package:InvenTree/widget/drawer.dart'; | ||||
| import 'package:InvenTree/widget/refreshable_state.dart'; | ||||
| @@ -19,8 +21,6 @@ class CategoryDisplayWidget extends StatefulWidget { | ||||
|  | ||||
|   final InvenTreePartCategory category; | ||||
|  | ||||
|   final String title = "Category"; | ||||
|  | ||||
|   @override | ||||
|   _CategoryDisplayState createState() => _CategoryDisplayState(category); | ||||
| } | ||||
| @@ -29,14 +29,14 @@ class CategoryDisplayWidget extends StatefulWidget { | ||||
| class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> { | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { return "Part Category"; } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).partCategory; | ||||
|  | ||||
|   @override | ||||
|   List<Widget> getAppBarActions(BuildContext context) { | ||||
|     return <Widget>[ | ||||
|       IconButton( | ||||
|         icon: FaIcon(FontAwesomeIcons.edit), | ||||
|         tooltip: 'Edit', | ||||
|         tooltip: I18N.of(context).edit, | ||||
|         onPressed: null, | ||||
|       ) | ||||
|     ]; | ||||
| @@ -94,7 +94,7 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> { | ||||
|     if (category == null) { | ||||
|       return Card( | ||||
|         child: ListTile( | ||||
|           title: Text("Part Categories"), | ||||
|           title: Text(I18N.of(context).partCategories), | ||||
|           subtitle: Text("Top level part category"), | ||||
|         ) | ||||
|       ); | ||||
| @@ -107,7 +107,7 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> { | ||||
|               subtitle: Text("${category.description}"), | ||||
|             ), | ||||
|             ListTile( | ||||
|               title: Text("Parent Category"), | ||||
|               title: Text(I18N.of(context).parentCategory), | ||||
|               subtitle: Text("${category.parentpathstring}"), | ||||
|               leading: FaIcon(FontAwesomeIcons.sitemap), | ||||
|               onTap: () { | ||||
| @@ -154,7 +154,7 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> { | ||||
|             ExpansionPanel( | ||||
|               headerBuilder: (BuildContext context, bool isExpanded) { | ||||
|                 return ListTile( | ||||
|                   title: Text("Subcategories"), | ||||
|                   title: Text(I18N.of(context).subcategories), | ||||
|                   leading: FaIcon(FontAwesomeIcons.stream), | ||||
|                   trailing: Text("${_subcategories.length}"), | ||||
|                   onTap: () { | ||||
| @@ -173,7 +173,7 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> { | ||||
|             ExpansionPanel( | ||||
|               headerBuilder: (BuildContext context, bool isExpanded) { | ||||
|                 return ListTile( | ||||
|                   title: Text("Parts"), | ||||
|                   title: Text(I18N.of(context).parts), | ||||
|                   leading: FaIcon(FontAwesomeIcons.shapes), | ||||
|                   trailing: Text("${_parts.length}"), | ||||
|                   onTap: () { | ||||
|   | ||||
| @@ -8,6 +8,7 @@ import 'package:InvenTree/widget/refreshable_state.dart'; | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
|  | ||||
| class CompanyDetailWidget extends StatefulWidget { | ||||
|  | ||||
| @@ -28,7 +29,7 @@ class _CompanyDetailState extends RefreshableState<CompanyDetailWidget> { | ||||
|   final _editCompanyKey = GlobalKey<FormState>(); | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { return "Company"; } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).company; | ||||
|  | ||||
|   @override | ||||
|   Future<void> request(BuildContext context) async { | ||||
| @@ -54,17 +55,17 @@ class _CompanyDetailState extends RefreshableState<CompanyDetailWidget> { | ||||
|     var _description; | ||||
|     var _website; | ||||
|  | ||||
|     showFormDialog(context, "Edit Company", | ||||
|     showFormDialog(context, I18N.of(context).edit, | ||||
|         key: _editCompanyKey, | ||||
|         actions: <Widget>[ | ||||
|           FlatButton( | ||||
|             child: Text("Cancel"), | ||||
|             child: Text(I18N.of(context).cancel), | ||||
|             onPressed: () { | ||||
|               Navigator.pop(context); | ||||
|             }, | ||||
|           ), | ||||
|           FlatButton( | ||||
|             child: Text("Save"), | ||||
|             child: Text(I18N.of(context).save), | ||||
|             onPressed: () { | ||||
|               if (_editCompanyKey.currentState.validate()) { | ||||
|                 _editCompanyKey.currentState.save(); | ||||
| @@ -80,21 +81,21 @@ class _CompanyDetailState extends RefreshableState<CompanyDetailWidget> { | ||||
|         ], | ||||
|         fields: <Widget>[ | ||||
|           StringField( | ||||
|             label: "Company Name", | ||||
|             label: I18N.of(context).name, | ||||
|             initial: company.name, | ||||
|             onSaved: (value) { | ||||
|               _name = value; | ||||
|             }, | ||||
|           ), | ||||
|           StringField( | ||||
|             label: "Company Description", | ||||
|             label: I18N.of(context).description, | ||||
|             initial: company.description, | ||||
|             onSaved: (value) { | ||||
|               _description = value; | ||||
|             }, | ||||
|           ), | ||||
|           StringField( | ||||
|             label: "Website", | ||||
|             label: I18N.of(context).website, | ||||
|             initial: company.website, | ||||
|             allowEmpty: true, | ||||
|             onSaved: (value) { | ||||
| @@ -192,7 +193,7 @@ class _CompanyDetailState extends RefreshableState<CompanyDetailWidget> { | ||||
|  | ||||
|     if (company.notes.isNotEmpty) { | ||||
|       tiles.add(ListTile( | ||||
|         title: Text("Notes"), | ||||
|         title: Text(I18N.of(context).notes), | ||||
|         leading: FaIcon(FontAwesomeIcons.stickyNote), | ||||
|         onTap: null, | ||||
|       )); | ||||
|   | ||||
| @@ -3,6 +3,8 @@ import 'package:flutter/material.dart'; | ||||
| import 'package:font_awesome_flutter/font_awesome_flutter.dart'; | ||||
| import 'package:image_picker/image_picker.dart'; | ||||
|  | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
|  | ||||
| import 'dart:async'; | ||||
| import 'dart:io'; | ||||
|  | ||||
| @@ -44,12 +46,12 @@ class ImagePickerField extends FormField<File> { | ||||
|     field.didChange(image); | ||||
|   } | ||||
|  | ||||
|   ImagePickerField({String label = "Attach Image", Function onSaved, bool required = false}) : | ||||
|   ImagePickerField(BuildContext context, {String label = "Attach Image", Function onSaved, bool required = false}) : | ||||
|       super( | ||||
|         onSaved: onSaved, | ||||
|         validator: (File img) { | ||||
|           if (required && (img == null)) { | ||||
|             return "Required"; | ||||
|             return I18N.of(context).required; | ||||
|           } | ||||
|  | ||||
|           return null; | ||||
|   | ||||
| @@ -197,10 +197,10 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> { | ||||
|                   children: <Widget>[ | ||||
|                     IconButton( | ||||
|                       icon: new FaIcon(FontAwesomeIcons.barcode), | ||||
|                       tooltip: 'Scan Barcode', | ||||
|                       tooltip: I18N.of(context).scanBarcode, | ||||
|                       onPressed: _scan, | ||||
|                     ), | ||||
|                     Text("Scan Barcode"), | ||||
|                     Text(I18N.of(context).scanBarcode), | ||||
|                   ], | ||||
|                 ), | ||||
|               ], | ||||
| @@ -213,20 +213,20 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> { | ||||
|                   children: <Widget>[ | ||||
|                     IconButton( | ||||
|                       icon: new FaIcon(FontAwesomeIcons.shapes), | ||||
|                       tooltip: 'Parts', | ||||
|                       tooltip: I18N.of(context).parts, | ||||
|                       onPressed: _parts, | ||||
|                     ), | ||||
|                     Text("Parts"), | ||||
|                     Text(I18N.of(context).parts), | ||||
|                   ], | ||||
|                 ), | ||||
|                 Column( | ||||
|                   children: <Widget>[ | ||||
|                     IconButton( | ||||
|                       icon: new FaIcon(FontAwesomeIcons.boxes), | ||||
|                       tooltip: 'Stock', | ||||
|                       tooltip: I18N.of(context).stock, | ||||
|                       onPressed: _stock, | ||||
|                     ), | ||||
|                     Text('Stock'), | ||||
|                     Text(I18N.of(context).stock), | ||||
|                   ], | ||||
|                 ), | ||||
|               ], | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/foundation.dart'; | ||||
| 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'; | ||||
|  | ||||
| @@ -31,7 +31,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> { | ||||
|   final _editPartKey = GlobalKey<FormState>(); | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { return "Part"; } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).part; | ||||
|  | ||||
|   @override | ||||
|   List<Widget> getAppBarActions(BuildContext context) { | ||||
| @@ -39,7 +39,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> { | ||||
|       // TODO: Hide the 'edit' button if the user does not have permission!! | ||||
|       IconButton( | ||||
|         icon: FaIcon(FontAwesomeIcons.edit), | ||||
|         tooltip: 'Edit', | ||||
|         tooltip: I18N.of(context).edit, | ||||
|         onPressed: _editPartDialog, | ||||
|       ) | ||||
|     ]; | ||||
| @@ -88,17 +88,17 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> { | ||||
|     var _revision; | ||||
|     var _keywords; | ||||
|  | ||||
|     showFormDialog(context, "Edit Part", | ||||
|     showFormDialog(context, I18N.of(context).editPart, | ||||
|       key: _editPartKey, | ||||
|       actions: <Widget>[ | ||||
|         FlatButton( | ||||
|           child: Text("Cancel"), | ||||
|           child: Text(I18N.of(context).cancel), | ||||
|           onPressed: () { | ||||
|             Navigator.pop(context); | ||||
|           }, | ||||
|         ), | ||||
|         FlatButton( | ||||
|           child: Text("Save"), | ||||
|           child: Text(I18N.of(context).save), | ||||
|           onPressed: () { | ||||
|             if (_editPartKey.currentState.validate()) { | ||||
|               _editPartKey.currentState.save(); | ||||
| @@ -115,12 +115,12 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> { | ||||
|       ], | ||||
|       fields: <Widget>[ | ||||
|         StringField( | ||||
|           label: "Part Name", | ||||
|           label: I18N.of(context).name, | ||||
|           initial: part.name, | ||||
|           onSaved: (value) => _name = value, | ||||
|         ), | ||||
|         StringField( | ||||
|           label: "Part Description", | ||||
|           label: I18N.of(context).description, | ||||
|           initial: part.description, | ||||
|           onSaved: (value) => _description = value, | ||||
|         ), | ||||
|   | ||||
| @@ -3,7 +3,7 @@ import 'package:InvenTree/inventree/stock.dart'; | ||||
| import 'package:InvenTree/widget/refreshable_state.dart'; | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
| // InvenTree packages | ||||
| import 'package:InvenTree/api.dart'; | ||||
| import 'package:InvenTree/inventree/part.dart'; | ||||
| @@ -27,7 +27,7 @@ class PartStockDetailWidget extends StatefulWidget { | ||||
| class _PartStockDisplayState extends RefreshableState<PartStockDetailWidget> { | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { return "Part Stock"; } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).partStock; | ||||
|  | ||||
|   _PartStockDisplayState(this.part) { | ||||
|     // TODO | ||||
|   | ||||
| @@ -2,7 +2,7 @@ import 'package:InvenTree/widget/drawer.dart'; | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter/widgets.dart'; | ||||
|  | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
| import 'package:InvenTree/widget/drawer.dart'; | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.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/inventree/part.dart'; | ||||
| import 'package:InvenTree/inventree/stock.dart'; | ||||
| @@ -23,9 +23,7 @@ class _SearchState extends RefreshableState<SearchWidget> { | ||||
|   List<InvenTreeStockItem> _stockItems = List<InvenTreeStockItem>(); | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { | ||||
|     return "Search"; | ||||
|   } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).search; | ||||
|  | ||||
|   Future<void> _search(BuildContext context) { | ||||
|     print("Search: $_searchText}"); | ||||
| @@ -76,14 +74,14 @@ class _SearchState extends RefreshableState<SearchWidget> { | ||||
|         children: <Widget>[ | ||||
|           TextField( | ||||
|             decoration: InputDecoration( | ||||
|               hintText: "Search" | ||||
|               hintText: I18N.of(context).search, | ||||
|             ), | ||||
|             onChanged: (String text) { | ||||
|               _searchText = text; | ||||
|             } | ||||
|           ), | ||||
|           RaisedButton( | ||||
|             child: Text("Search"), | ||||
|             child: Text(I18N.of(context).search), | ||||
|             onPressed: () { | ||||
|               _search(context); | ||||
|             }, | ||||
|   | ||||
| @@ -12,6 +12,8 @@ import 'package:InvenTree/widget/stock_item_test_results.dart'; | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
|  | ||||
| import 'package:InvenTree/api.dart'; | ||||
|  | ||||
| import 'package:InvenTree/widget/drawer.dart'; | ||||
| @@ -35,7 +37,7 @@ class StockDetailWidget extends StatefulWidget { | ||||
| class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { return "Stock Item"; } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).stockItem; | ||||
|  | ||||
|   @override | ||||
|   List<Widget> getAppBarActions(BuildContext context) { | ||||
| @@ -43,7 +45,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|       // TODO: Hide the 'edit' button if the user does not have permission!! | ||||
|       IconButton( | ||||
|         icon: FaIcon(FontAwesomeIcons.edit), | ||||
|         tooltip: "Edit", | ||||
|         tooltip: I18N.of(context).edit, | ||||
|         onPressed: _editStockItemDialog, | ||||
|       ) | ||||
|     ]; | ||||
| @@ -121,11 +123,11 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     _quantityController.clear(); | ||||
|     _notesController.clear(); | ||||
|  | ||||
|     showFormDialog(context, "Add Stock", | ||||
|     showFormDialog(context, I18N.of(context).addStock, | ||||
|       key: _addStockKey, | ||||
|       actions: <Widget>[ | ||||
|         FlatButton( | ||||
|           child: Text("Add"), | ||||
|           child: Text(I18N.of(context).add), | ||||
|             onPressed: () { | ||||
|               if (_addStockKey.currentState.validate()) _addStock(); | ||||
|             }, | ||||
| @@ -134,12 +136,12 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|       fields: <Widget> [ | ||||
|         Text("Current stock: ${item.quantity}"), | ||||
|         QuantityField( | ||||
|           label: "Add Stock", | ||||
|           label: I18N.of(context).addStock, | ||||
|           controller: _quantityController, | ||||
|         ), | ||||
|         TextFormField( | ||||
|           decoration: InputDecoration( | ||||
|             labelText: "Notes", | ||||
|             labelText: I18N.of(context).notes, | ||||
|           ), | ||||
|           controller: _notesController, | ||||
|         ) | ||||
| @@ -168,11 +170,11 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     _quantityController.clear(); | ||||
|     _notesController.clear(); | ||||
|  | ||||
|     showFormDialog(context, "Remove Stock", | ||||
|     showFormDialog(context, I18N.of(context).removeStock, | ||||
|         key: _removeStockKey, | ||||
|         actions: <Widget>[ | ||||
|           FlatButton( | ||||
|             child: Text("Remove"), | ||||
|             child: Text(I18N.of(context).remove), | ||||
|             onPressed: () { | ||||
|               if (_removeStockKey.currentState.validate()) _removeStock(); | ||||
|             }, | ||||
| @@ -181,13 +183,13 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|         fields: <Widget>[ | ||||
|           Text("Current stock: ${item.quantity}"), | ||||
|           QuantityField( | ||||
|             label: "Remove stock", | ||||
|             label: I18N.of(context).removeStock, | ||||
|             controller: _quantityController, | ||||
|             max: item.quantity, | ||||
|           ), | ||||
|           TextFormField( | ||||
|             decoration: InputDecoration( | ||||
|               labelText: "Notes", | ||||
|               labelText: I18N.of(context).notes, | ||||
|             ), | ||||
|             controller: _notesController, | ||||
|           ), | ||||
| @@ -217,11 +219,11 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     _quantityController.text = item.quantity.toString(); | ||||
|     _notesController.clear(); | ||||
|  | ||||
|     showFormDialog(context, "Count Stock", | ||||
|     showFormDialog(context, I18N.of(context).countStock, | ||||
|       key: _countStockKey, | ||||
|       actions: <Widget> [ | ||||
|         FlatButton( | ||||
|           child: Text("Count"), | ||||
|           child: Text(I18N.of(context).count), | ||||
|           onPressed: () { | ||||
|             if (_countStockKey.currentState.validate()) _countStock(); | ||||
|           }, | ||||
| @@ -229,13 +231,13 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|       ], | ||||
|       fields: <Widget> [ | ||||
|         QuantityField( | ||||
|           label: "Count Stock", | ||||
|           label: I18N.of(context).countStock, | ||||
|           hint: "${item.quantity}", | ||||
|           controller: _quantityController, | ||||
|         ), | ||||
|         TextFormField( | ||||
|           decoration: InputDecoration( | ||||
|             labelText: "Notes", | ||||
|             labelText: I18N.of(context).notes, | ||||
|           ), | ||||
|           controller: _notesController, | ||||
|         ) | ||||
| @@ -271,11 +273,11 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|  | ||||
|     _quantityController.text = "${item.quantity}"; | ||||
|  | ||||
|     showFormDialog(context, "Transfer Stock", | ||||
|     showFormDialog(context, I18N.of(context).transferStock, | ||||
|         key: _moveStockKey, | ||||
|         actions: <Widget>[ | ||||
|           FlatButton( | ||||
|             child: Text("Transfer"), | ||||
|             child: Text(I18N.of(context).transfer), | ||||
|             onPressed: () { | ||||
|               if (_moveStockKey.currentState.validate()) { | ||||
|                 _moveStockKey.currentState.save(); | ||||
| @@ -285,7 +287,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|         ], | ||||
|         fields: <Widget>[ | ||||
|           QuantityField( | ||||
|             label: "Quantity", | ||||
|             label: I18N.of(context).quantity, | ||||
|             controller: _quantityController, | ||||
|             max: item.quantity, | ||||
|           ), | ||||
| @@ -358,7 +360,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|  | ||||
|     tiles.add( | ||||
|       ListTile( | ||||
|         title: Text("Part"), | ||||
|         title: Text(I18N.of(context).part), | ||||
|         subtitle: Text("${item.partName}"), | ||||
|         leading: FaIcon(FontAwesomeIcons.shapes), | ||||
|         onTap: () { | ||||
| @@ -377,7 +379,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     if ((item.locationId > 0) && (item.locationName != null) && (item.locationName.isNotEmpty)) { | ||||
|       tiles.add( | ||||
|           ListTile( | ||||
|             title: Text("Stock Location"), | ||||
|             title: Text(I18N.of(context).stockLocation), | ||||
|             subtitle: Text("${item.locationPathString}"), | ||||
|             leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), | ||||
|             onTap: () { | ||||
| @@ -393,7 +395,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     } else { | ||||
|       tiles.add( | ||||
|           ListTile( | ||||
|             title: Text("Stock Location"), | ||||
|             title: Text(I18N.of(context).stockLocation), | ||||
|             leading: FaIcon(FontAwesomeIcons.mapMarkerAlt), | ||||
|             subtitle: Text("No location set"), | ||||
|           ) | ||||
| @@ -412,7 +414,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     } else { | ||||
|       tiles.add( | ||||
|           ListTile( | ||||
|             title: Text("Quantity"), | ||||
|             title: Text(I18N.of(context).quantity), | ||||
|             leading: FaIcon(FontAwesomeIcons.cubes), | ||||
|             trailing: Text("${item.quantity}"), | ||||
|           ) | ||||
| @@ -457,7 +459,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     if (item.trackingItemCount > 0) { | ||||
|       tiles.add( | ||||
|         ListTile( | ||||
|           title: Text("History"), | ||||
|           title: Text(I18N.of(context).history), | ||||
|           leading: FaIcon(FontAwesomeIcons.history), | ||||
|           trailing: Text("${item.trackingItemCount}"), | ||||
|           onTap: null, | ||||
| @@ -468,7 +470,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     if (item.notes.isNotEmpty) { | ||||
|       tiles.add( | ||||
|         ListTile( | ||||
|           title: Text("Notes"), | ||||
|           title: Text(I18N.of(context).notes), | ||||
|           leading: FaIcon(FontAwesomeIcons.stickyNote), | ||||
|           trailing: Text(""), | ||||
|           onTap: null, | ||||
| @@ -487,7 +489,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     if (!item.isSerialized()) { | ||||
|       tiles.add( | ||||
|           ListTile( | ||||
|               title: Text("Count Stock"), | ||||
|               title: Text(I18N.of(context).countStock), | ||||
|               leading: FaIcon(FontAwesomeIcons.checkCircle), | ||||
|               onTap: _countStockDialog, | ||||
|           ) | ||||
| @@ -495,7 +497,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|  | ||||
|       tiles.add( | ||||
|           ListTile( | ||||
|               title: Text("Remove Stock"), | ||||
|               title: Text(I18N.of(context).removeStock), | ||||
|               leading: FaIcon(FontAwesomeIcons.minusCircle), | ||||
|               onTap: _removeStockDialog, | ||||
|           ) | ||||
| @@ -503,7 +505,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|  | ||||
|       tiles.add( | ||||
|           ListTile( | ||||
|               title: Text("Add Stock"), | ||||
|               title: Text(I18N.of(context).addStock), | ||||
|               leading: FaIcon(FontAwesomeIcons.plusCircle), | ||||
|               onTap: _addStockDialog, | ||||
|           ) | ||||
| @@ -512,7 +514,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|  | ||||
|     tiles.add( | ||||
|       ListTile( | ||||
|         title: Text("Transfer Stock"), | ||||
|         title: Text(I18N.of(context).transferStock), | ||||
|         leading: FaIcon(FontAwesomeIcons.exchangeAlt), | ||||
|         onTap: _transferStockDialog, | ||||
|       ) | ||||
| @@ -601,14 +603,14 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> { | ||||
|     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), | ||||
|         ), | ||||
|       ] | ||||
|     ); | ||||
|   | ||||
| @@ -5,6 +5,8 @@ import 'package:InvenTree/api.dart'; | ||||
| import 'package:InvenTree/widget/dialogs.dart'; | ||||
| import 'package:InvenTree/widget/fields.dart'; | ||||
|  | ||||
| import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||||
|  | ||||
| import 'dart:io'; | ||||
|  | ||||
| import 'package:flutter/cupertino.dart'; | ||||
| @@ -30,7 +32,7 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes | ||||
|   final _addResultKey = GlobalKey<FormState>(); | ||||
|  | ||||
|   @override | ||||
|   String getAppBarTitle(BuildContext context) { return "Test Results"; } | ||||
|   String getAppBarTitle(BuildContext context) => I18N.of(context).testResults; | ||||
|  | ||||
|   @override | ||||
|   Future<void> request(BuildContext context) async { | ||||
| @@ -56,7 +58,10 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes | ||||
|         // TODO - Show a SnackBar here! | ||||
|         refresh(); | ||||
|       } else { | ||||
|         showErrorDialog(context, "Error", "Could not upload test result to server"); | ||||
|         showErrorDialog( | ||||
|             context, | ||||
|             I18N.of(context).error, | ||||
|             "Could not upload test result to server"); | ||||
|       } | ||||
|     }); | ||||
|   } | ||||
| @@ -73,13 +78,13 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes | ||||
|       key: _addResultKey, | ||||
|       actions: <Widget>[ | ||||
|         FlatButton( | ||||
|           child: Text("Cancel"), | ||||
|           child: Text(I18N.of(context).cancel), | ||||
|           onPressed: () { | ||||
|             Navigator.pop(context); | ||||
|           }, | ||||
|         ), | ||||
|         FlatButton( | ||||
|           child: Text("Save"), | ||||
|           child: Text(I18N.of(context).save), | ||||
|           onPressed: () { | ||||
|             if (_addResultKey.currentState.validate()) { | ||||
|               _addResultKey.currentState.save(); | ||||
| @@ -97,13 +102,13 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes | ||||
|           onSaved: (value) => _name = value, | ||||
|         ), | ||||
|         CheckBoxField( | ||||
|           label: "Result", | ||||
|           label: I18N.of(context).result, | ||||
|           hint: "Test passed or failed", | ||||
|           initial: true, | ||||
|           onSaved: (value) => _result = value, | ||||
|         ), | ||||
|         StringField( | ||||
|           label: "Value", | ||||
|           label: I18N.of(context).value, | ||||
|           initial: value, | ||||
|           allowEmpty: true, | ||||
|           onSaved: (value) => _value = value, | ||||
| @@ -115,13 +120,14 @@ class _StockItemTestResultDisplayState extends RefreshableState<StockItemTestRes | ||||
|           }, | ||||
|         ), | ||||
|         ImagePickerField( | ||||
|           context, | ||||
|           label: "Attach Image", | ||||
|           required: attachmentRequired, | ||||
|           onSaved: (attachment) => _attachment = attachment, | ||||
|         ), | ||||
|         StringField( | ||||
|           allowEmpty: true, | ||||
|           label: "Notes", | ||||
|           label: I18N.of(context).notes, | ||||
|           onSaved: (value) => _notes = value, | ||||
|         ), | ||||
|       ] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user