2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 02:05:29 +00:00

String translations

This commit is contained in:
Oliver Walters
2021-02-09 20:31:55 +11:00
parent c2aa51ed95
commit 90072904a0
8 changed files with 42 additions and 25 deletions

View File

@ -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,
),
/*

View File

@ -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),
)
]
);

View File

@ -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),
),
]
);

View File

@ -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?
}
)
);
}