vector-im/element-ios/issues/4899 - Localized and generated missing strings.
MODIFY
MatrixKit/Assets/MatrixKitAssets.bundle/en.lproj/MatrixKit.strings
MatrixKit/Assets/MatrixKitAssets.bundle/en.lproj/MatrixKit.strings
"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";

MODIFY
MatrixKit/Controllers/MXKAuthenticationViewController.m
MatrixKit/Controllers/MXKAuthenticationViewController.m
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
{
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)
[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
{
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]];
}

MODIFY
MatrixKit/Generated/Strings.swift
MatrixKit/Generated/Strings.swift
@@ -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")

MODIFY
MatrixKit/Models/Room/MXKRoomDataSource.m
MatrixKit/Models/Room/MXKRoomDataSource.m
@@ -1736,7 +1736,7 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
NSString *sanitizedText = [self sanitizedMessageText:text];
NSString *html = [self htmlMessageFromSanitizedText:sanitizedText];
- id<MXSendReplyEventStringLocalizer> stringLocalizer = [MXKSendReplyEventStringLocalizer new];
+ id<MXSendReplyEventStringLocalizerProtocol> stringLocalizer = [MXKSendReplyEventStringLocalizer new];
[_room sendReplyToEvent:eventToReply withTextMessage:sanitizedText formattedTextMessage:html stringLocalizer:stringLocalizer localEcho:&localEchoEvent success:success failure:failure];

MODIFY
MatrixKit/Models/Room/MXKSendReplyEventStringLocalizer.h
MatrixKit/Models/Room/MXKSendReplyEventStringLocalizer.h
*/
#import <Foundation/Foundation.h>
-#import <MatrixSDK/MXSendReplyEventStringLocalizer.h>
+#import <MatrixSDK/MXSendReplyEventStringLocalizerProtocol.h>
/**
A `MXKSendReplyEventStringLocalizer` instance represents string localizations used when send reply event to a message in a room.
*/
-@interface MXKSendReplyEventStringLocalizer : NSObject<MXSendReplyEventStringLocalizer>
+@interface MXKSendReplyEventStringLocalizer : NSObject<MXSendReplyEventStringLocalizerProtocol>
@end

MODIFY
MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizer.h
MatrixKit/Utils/EventFormatter/MXKRoomNameStringLocalizer.h
@import Foundation;
-#import <MatrixSDK/MXRoomNameStringLocalizer.h>
+#import <MatrixSDK/MXRoomNameStringLocalizerProtocol.h>
/**
- The `MXKRoomNameStringLocalizer` implements localization strings for `MXRoomNameStringLocalizable`.
+ The `MXKRoomNameStringLocalizer` implements localization strings for `MXRoomNameStringLocalizerProtocol`.
*/
-@interface MXKRoomNameStringLocalizer : NSObject <MXRoomNameStringLocalizer>
+@interface MXKRoomNameStringLocalizer : NSObject <MXRoomNameStringLocalizerProtocol>
@end

ADD
changelog.d/4899.change
+Replaced localizable strings with generated ones throughout the code. Fixed various translation issues.
\ No newline at end of file

vector-im/element-ios/issues/4899 - Localized and generated missing strings.