Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
element-hq/element-ios/issues/4899 - Localized and generated missing …
Browse files Browse the repository at this point in the history
…strings.
  • Loading branch information
stefanceriu committed Sep 28, 2021
1 parent 37b3165 commit a295ea2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,8 @@
"ssl_unexpected_existing_expl" = "The certificate has changed from one that was trusted by your phone. This is HIGHLY UNUSUAL. It is recommended that you DO NOT ACCEPT this new certificate.";
"ssl_expected_existing_expl" = "The certificate has changed from a previously trusted one to one that is not trusted. The server may have renewed its certificate. Contact the server administrator for the expected fingerprint.";
"ssl_only_accept" = "ONLY accept the certificate if the server administrator has published a fingerprint that matches the one above.";

"auth_invalid_user_name" = "Invalid username";
"auth_username_in_use" = "Username in use";
"auth_reset_password_error_unauthorized" = "Unauthorized";
"auth_reset_password_error_not_found" = "Not found";
8 changes: 4 additions & 4 deletions MatrixKit/Controllers/MXKAuthenticationViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ - (IBAction)onButtonPressed:(id)sender
if (isUserNameInUse)
{
MXLogDebug(@"[MXKAuthenticationVC] User name is already use");
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[NSBundle mxk_localizedStringForKey:@"auth_username_in_use"]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n authUsernameInUse]}]];
}
else
{
Expand Down Expand Up @@ -1094,7 +1094,7 @@ - (IBAction)onButtonPressed:(id)sender
else
{
MXLogDebug(@"[MXKAuthenticationVC] User name is missing");
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[NSBundle mxk_localizedStringForKey:@"auth_invalid_user_name"]}]];
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n authInvalidUserName]}]];
}
}
else if (_authType == MXKAuthenticationTypeForgotPassword)
Expand Down Expand Up @@ -1840,7 +1840,7 @@ - (void)resetPasswordWithParameters:(NSDictionary*)parameters
[self->alert dismissViewControllerAnimated:NO completion:nil];
}

self->alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n error] message:[NSBundle mxk_localizedStringForKey:@"auth_reset_password_error_unauthorized"] preferredStyle:UIAlertControllerStyleAlert];
self->alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n error] message:[MatrixKitL10n authResetPasswordErrorUnauthorized] preferredStyle:UIAlertControllerStyleAlert];

[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
style:UIAlertActionStyleDefault
Expand All @@ -1866,7 +1866,7 @@ - (void)resetPasswordWithParameters:(NSDictionary*)parameters
{
userInfo = [NSMutableDictionary dictionary];
}
userInfo[NSLocalizedDescriptionKey] = [NSBundle mxk_localizedStringForKey:@"auth_reset_password_error_not_found"];
userInfo[NSLocalizedDescriptionKey] = [MatrixKitL10n authResetPasswordErrorNotFound];

[self onFailureDuringAuthRequest:[NSError errorWithDomain:kMXNSErrorDomain code:0 userInfo:userInfo]];
}
Expand Down
16 changes: 16 additions & 0 deletions MatrixKit/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,22 @@ public class MatrixKitL10n: NSObject {
public static func attachmentSmallWithResolution(_ p1: String, _ p2: String) -> String {
return MatrixKitL10n.tr("attachment_small_with_resolution", p1, p2)
}
/// Invalid username
public static var authInvalidUserName: String {
return MatrixKitL10n.tr("auth_invalid_user_name")
}
/// Not found
public static var authResetPasswordErrorNotFound: String {
return MatrixKitL10n.tr("auth_reset_password_error_not_found")
}
/// Unauthorized
public static var authResetPasswordErrorUnauthorized: String {
return MatrixKitL10n.tr("auth_reset_password_error_unauthorized")
}
/// Username in use
public static var authUsernameInUse: String {
return MatrixKitL10n.tr("auth_username_in_use")
}
/// Back
public static var back: String {
return MatrixKitL10n.tr("back")
Expand Down
1 change: 1 addition & 0 deletions changelog.d/4899.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replaced localizable strings with generated ones throughout the code. Fixed various translation issues.

0 comments on commit a295ea2

Please sign in to comment.