Translations

This commit is contained in:
Sarah Jamie Lewis 2021-06-14 17:38:07 -07:00
parent 2a3945639d
commit 1e2c69eb4c
10 changed files with 18 additions and 17 deletions

View File

@ -1 +1 @@
v0.0.2-63-g033de73-2021-06-11-21-41 v0.0.2-66-g39187a7-2021-06-15-00-32

View File

@ -167,7 +167,7 @@ class _AddContactViewState extends State<AddContactView> {
Widget addGroupTab() { Widget addGroupTab() {
// TODO We should replace with with a "Paste in Server Key Bundle" // TODO We should replace with with a "Paste in Server Key Bundle"
if (Provider.of<ProfileInfoState>(context).serverList.servers.isEmpty) { if (Provider.of<ProfileInfoState>(context).serverList.servers.isEmpty) {
return Text("You need to add a server before you can create a group."); return Text(AppLocalizations.of(context)!.addServerFirst);
} }
return Container( return Container(

View File

@ -313,7 +313,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
// set up the buttons // set up the buttons
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("Cancel"), child: Text(AppLocalizations.of(context)!.cancel),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); // dismiss dialog Navigator.of(context).pop(); // dismiss dialog
}, },
@ -328,7 +328,7 @@ class _AddEditProfileViewState extends State<AddEditProfileView> {
const Duration(milliseconds: 500), const Duration(milliseconds: 500),
() { () {
if (globalErrorHandler.deleteProfileSuccess) { if (globalErrorHandler.deleteProfileSuccess) {
final snackBar = SnackBar(content: Text("Successfully deleted profile:" + onion)); final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.deleteProfileSuccess + ":" + onion));
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
Navigator.of(context).popUntil((route) => route.isFirst); // dismiss dialog Navigator.of(context).popUntil((route) => route.isFirst); // dismiss dialog
} else { } else {

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../main.dart'; import '../main.dart';
import '../model.dart'; import '../model.dart';
import 'contactsview.dart'; import 'contactsview.dart';
@ -27,7 +27,7 @@ class _DoubleColumnViewState extends State<DoubleColumnView> {
Flexible( Flexible(
flex: flwtch.columns[1], flex: flwtch.columns[1],
child: flwtch.selectedConversation == "" child: flwtch.selectedConversation == ""
? Center(child: Text("pick a contact")) ? Center(child: Text(AppLocalizations.of(context)!.addContactFirst))
: //dev : //dev
MultiProvider(providers: [ MultiProvider(providers: [
ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context)), ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context)),

View File

@ -159,7 +159,7 @@ class _GroupSettingsViewState extends State<GroupSettingsView> {
showAlertDialog(BuildContext context) { showAlertDialog(BuildContext context) {
// set up the buttons // set up the buttons
Widget cancelButton = TextButton( Widget cancelButton = TextButton(
child: Text("Cancel"), child: Text(AppLocalizations.of(context)!.cancel),
style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))), style: ButtonStyle(padding: MaterialStateProperty.all(EdgeInsets.all(20))),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); // dismiss dialog Navigator.of(context).pop(); // dismiss dialog

View File

@ -139,11 +139,11 @@ class _MessageViewState extends State<MessageView> {
enabled: true, enabled: true,
prefixIcon: IconButton( prefixIcon: IconButton(
icon: Icon(CwtchIcons.send_invite, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()), icon: Icon(CwtchIcons.send_invite, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
tooltip: "Send a contact or group invite", tooltip: AppLocalizations.of(context)!.sendInvite,
onPressed: () => _modalSendInvitation(context)), onPressed: () => _modalSendInvitation(context)),
suffixIcon: IconButton( suffixIcon: IconButton(
icon: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()), icon: Icon(CwtchIcons.send_24px, size: 24, color: Provider.of<Settings>(context).theme.mainTextColor()),
tooltip: "Send Message", tooltip: AppLocalizations.of(context)!.sendMessage,
onPressed: _sendMessage, onPressed: _sendMessage,
), ),
))), ))),

View File

@ -78,7 +78,7 @@ class _PeerSettingsViewState extends State<PeerSettingsView> {
final setPeerAttributeJson = jsonEncode(setPeerAttribute); final setPeerAttributeJson = jsonEncode(setPeerAttribute);
Provider.of<FlwtchState>(context, listen: false).cwtch.SendProfileEvent(profileOnion, setPeerAttributeJson); Provider.of<FlwtchState>(context, listen: false).cwtch.SendProfileEvent(profileOnion, setPeerAttributeJson);
// todo translations // todo translations
final snackBar = SnackBar(content: Text("Nickname changed successfully")); final snackBar = SnackBar(content: Text(AppLocalizations.of(context)!.nickChangeSuccess));
ScaffoldMessenger.of(context).showSnackBar(snackBar); ScaffoldMessenger.of(context).showSnackBar(snackBar);
}, },
icon: Icon(Icons.save), icon: Icon(Icons.save),

View File

@ -23,7 +23,7 @@ class _TorStatusView extends State<TorStatusView> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: Text("Tor Network Status"), title: Text(AppLocalizations.of(context)!.torNetworkStatus),
), ),
body: _buildSettingsList(), body: _buildSettingsList(),
); );
@ -43,10 +43,10 @@ class _TorStatusView extends State<TorStatusView> {
child: Column(children: [ child: Column(children: [
ListTile( ListTile(
leading: TorIcon(), leading: TorIcon(),
title: Text("Tor Status"), title: Text(AppLocalizations.of(context)!.torStatus),
subtitle: Text(torStatus.progress == 100 ? AppLocalizations.of(context)!.networkStatusOnline : torStatus.status), subtitle: Text(torStatus.progress == 100 ? AppLocalizations.of(context)!.networkStatusOnline : torStatus.status),
trailing: ElevatedButton( trailing: ElevatedButton(
child: Text("Reset"), child: Text(AppLocalizations.of(context)!.resetTor),
onPressed: () { onPressed: () {
Provider.of<FlwtchState>(context, listen: false).cwtch.ResetTor(); Provider.of<FlwtchState>(context, listen: false).cwtch.ResetTor();
}, },

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cwtch/views/profilemgrview.dart'; import 'package:cwtch/views/profilemgrview.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../main.dart'; import '../main.dart';
import 'contactsview.dart'; import 'contactsview.dart';
import 'messageview.dart'; import 'messageview.dart';
@ -22,12 +22,12 @@ class _TripleColumnViewState extends State<TripleColumnView> {
), ),
Flexible( Flexible(
flex: flwtch.columns[1], flex: flwtch.columns[1],
child: flwtch.selectedProfile == null ? Center(child: Text("pick a profile")) : ContactsView(), //dev child: flwtch.selectedProfile == null ? Center(child: Text(AppLocalizations.of(context)!.createProfileToBegin)) : ContactsView(), //dev
), ),
Flexible( Flexible(
flex: flwtch.columns[2], flex: flwtch.columns[2],
child: flwtch.selectedConversation == "" child: flwtch.selectedConversation == ""
? Center(child: Text("pick a contact")) ? Center(child: Text(AppLocalizations.of(context)!.addContactFirst))
: //dev : //dev
Container(child: MessageView()), Container(child: MessageView()),
), ),

View File

@ -1,5 +1,6 @@
import 'package:cwtch/cwtch_icons_icons.dart'; import 'package:cwtch/cwtch_icons_icons.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
final Color malformedColor = Color(0xFFE85DA1); final Color malformedColor = Color(0xFFE85DA1);
@ -45,7 +46,7 @@ class MalformedBubbleState extends State<MalformedBubble> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [Text("Malformed Message")], children: [Text(AppLocalizations.of(context)!.malformedMessage)],
)) ))
]))))); ])))));
}); });