mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 08:07:59 -06:00
feat: Renamed translation strings
This commit is contained in:
@@ -40,9 +40,7 @@ class _ClientCertificateFormFieldState
|
||||
}
|
||||
assert(_selectedFile != null);
|
||||
if (_selectedFile?.path.split(".").last != 'pfx') {
|
||||
return S
|
||||
.of(context)
|
||||
.loginPageClientCertificateSettingInvalidFileFormatValidationText;
|
||||
return S.of(context).invalidCertificateFormat;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -52,9 +50,8 @@ class _ClientCertificateFormFieldState
|
||||
return Theme(
|
||||
data: theme,
|
||||
child: ExpansionTile(
|
||||
title: Text(S.of(context).loginPageClientCertificateSettingLabel),
|
||||
subtitle: Text(
|
||||
S.of(context).loginPageClientCertificateSettingDescriptionText),
|
||||
title: Text(S.of(context).clientcertificate),
|
||||
subtitle: Text(S.of(context).configureMutualTLSAuthentication),
|
||||
children: [
|
||||
InputDecorator(
|
||||
decoration: InputDecoration(
|
||||
@@ -70,8 +67,7 @@ class _ClientCertificateFormFieldState
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () => _onSelectFile(field),
|
||||
child:
|
||||
Text(S.of(context).genericActionSelectText),
|
||||
child: Text(S.of(context).select),
|
||||
),
|
||||
_buildSelectedFileText(field).paddedOnly(left: 8),
|
||||
],
|
||||
@@ -89,7 +85,7 @@ class _ClientCertificateFormFieldState
|
||||
// ListTile(
|
||||
// leading: ElevatedButton(
|
||||
// onPressed: () => _onSelectFile(field),
|
||||
// child: Text(S.of(context).genericActionSelectText),
|
||||
// child: Text(S.of(context).select),
|
||||
// ),
|
||||
// title: _buildSelectedFileText(field),
|
||||
// trailing: AbsorbPointer(
|
||||
@@ -112,9 +108,7 @@ class _ClientCertificateFormFieldState
|
||||
onChanged: (value) => field.didChange(
|
||||
field.value?.copyWith(passphrase: value),
|
||||
),
|
||||
label: S
|
||||
.of(context)
|
||||
.loginPageClientCertificatePassphraseLabel,
|
||||
label: S.of(context).passphrase,
|
||||
).padded(),
|
||||
] else
|
||||
...[]
|
||||
@@ -149,7 +143,7 @@ class _ClientCertificateFormFieldState
|
||||
if (field.value == null) {
|
||||
assert(_selectedFile == null);
|
||||
return Text(
|
||||
S.of(context).loginPageClientCertificateSettingSelectFileText,
|
||||
S.of(context).selectFile,
|
||||
style: Theme.of(context).textTheme.labelMedium?.apply(
|
||||
color: Theme.of(context).hintColor,
|
||||
),
|
||||
|
||||
@@ -44,18 +44,16 @@ class _ServerAddressFormFieldState extends State<ServerAddressFormField> {
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
validator: FormBuilderValidators.compose([
|
||||
FormBuilderValidators.required(
|
||||
errorText:
|
||||
S.of(context).loginPageServerUrlValidatorMessageRequiredText,
|
||||
errorText: S.of(context).serverAddressMustNotBeEmpty,
|
||||
),
|
||||
FormBuilderValidators.match(
|
||||
r"https?://.*",
|
||||
errorText:
|
||||
S.of(context).loginPageServerUrlValidatorMessageMissingSchemeText,
|
||||
errorText: S.of(context).serverAddressMustIncludeAScheme,
|
||||
)
|
||||
]),
|
||||
decoration: InputDecoration(
|
||||
hintText: "http://192.168.1.50:8000",
|
||||
labelText: S.of(context).loginPageServerUrlFieldLabel,
|
||||
labelText: S.of(context).serverAddress,
|
||||
suffixIcon: _canClear
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
|
||||
@@ -37,22 +37,22 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
|
||||
UserCredentials(username: username),
|
||||
),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).loginPageUsernameValidatorMessageText,
|
||||
errorText: S.of(context).usernameMustNotBeEmpty,
|
||||
),
|
||||
autofillHints: const [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).loginPageUsernameLabel),
|
||||
label: Text(S.of(context).username),
|
||||
),
|
||||
),
|
||||
ObscuredInputTextFormField(
|
||||
key: const ValueKey('login-password'),
|
||||
label: S.of(context).loginPagePasswordFieldLabel,
|
||||
label: S.of(context).password,
|
||||
onChanged: (password) => field.didChange(
|
||||
field.value?.copyWith(password: password) ??
|
||||
UserCredentials(password: password),
|
||||
),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).loginPagePasswordValidatorMessageText,
|
||||
errorText: S.of(context).passwordMustNotBeEmpty,
|
||||
),
|
||||
),
|
||||
].map((child) => child.padded()).toList(),
|
||||
@@ -73,11 +73,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
|
||||
FocusScope.of(context).requestFocus(_focusNodes[fkPassword]);
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).loginPageUsernameValidatorMessageText,
|
||||
errorText: S.of(context).usernameMustNotBeEmpty,
|
||||
),
|
||||
autofillHints: const [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).loginPageUsernameLabel,
|
||||
labelText: S.of(context).username,
|
||||
),
|
||||
).padded(),
|
||||
FormBuilderTextField(
|
||||
@@ -88,11 +88,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
|
||||
},
|
||||
autofillHints: const [AutofillHints.password],
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).loginPagePasswordValidatorMessageText,
|
||||
errorText: S.of(context).passwordMustNotBeEmpty,
|
||||
),
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).loginPagePasswordFieldLabel,
|
||||
labelText: S.of(context).password,
|
||||
),
|
||||
).padded(),
|
||||
],
|
||||
|
||||
@@ -32,7 +32,7 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: kToolbarHeight - 4,
|
||||
title: Text(S.of(context).loginPageTitle),
|
||||
title: Text(S.of(context).connectToPaperless),
|
||||
bottom: PreferredSize(
|
||||
child: _isCheckingConnection
|
||||
? const LinearProgressIndicator()
|
||||
@@ -61,11 +61,11 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
TextButton(
|
||||
child: Text("Test connection"),
|
||||
child: Text("Test connection"), //TODO: INTL
|
||||
onPressed: _updateReachability,
|
||||
),
|
||||
FilledButton(
|
||||
child: Text(S.of(context).loginPageContinueLabel),
|
||||
child: Text(S.of(context).continueLabel),
|
||||
onPressed: _reachabilityStatus == ReachabilityStatus.reachable
|
||||
? widget.onContinue
|
||||
: null,
|
||||
@@ -108,19 +108,19 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
case ReachabilityStatus.reachable:
|
||||
return _buildIconText(
|
||||
Icons.done,
|
||||
S.of(context).loginPageReachabilitySuccessText,
|
||||
S.of(context).connectionSuccessfulylEstablished,
|
||||
Colors.green,
|
||||
);
|
||||
case ReachabilityStatus.notReachable:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).loginPageReachabilityNotReachableText,
|
||||
S.of(context).couldNotEstablishConnectionToTheServer,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.unknownHost:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).loginPageReachabilityUnresolvedHostText,
|
||||
S.of(context).hostCouldNotBeResolved,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.missingClientCertificate:
|
||||
@@ -132,15 +132,13 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
case ReachabilityStatus.invalidClientCertificateConfiguration:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S
|
||||
.of(context)
|
||||
.loginPageReachabilityInvalidClientCertificateConfigurationText,
|
||||
S.of(context).incorrectOrMissingCertificatePassphrase,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.connectionTimeout:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).loginPageReachabilityConnectionTimeoutText,
|
||||
S.of(context).connectionTimedOut,
|
||||
errorColor,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -39,8 +39,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
Text(S.of(context).loginPageSignInToPrefixText(serverAddress))
|
||||
.padded(),
|
||||
Text(S.of(context).signInToServer(serverAddress)).padded(),
|
||||
const UserCredentialsFormField(),
|
||||
],
|
||||
),
|
||||
@@ -54,7 +53,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
|
||||
await widget.onDone();
|
||||
setState(() => _isLoginLoading = false);
|
||||
},
|
||||
child: Text(S.of(context).loginPageSignInButtonLabel),
|
||||
child: Text(S.of(context).signIn),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user