Skip to content

Commit

Permalink
/issues/4899 - Fixed various localization issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Sep 28, 2021
1 parent f721482 commit 710b784
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 30 deletions.
28 changes: 14 additions & 14 deletions Riot/Modules/Integrations/IntegrationManagerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ - (void)onPostMessageRequest:(NSString*)requestId data:(NSDictionary*)requestDat
}
else
{
[self sendLocalisedError:@"widget_integration_missing_room_id" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationMissingRoomId] toRequest:requestId];
return;
}
}
Expand Down Expand Up @@ -249,7 +249,7 @@ - (void)onPostMessageRequest:(NSString*)requestId data:(NSDictionary*)requestDat

if (!userId)
{
[self sendLocalisedError:@"widget_integration_missing_user_id" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationMissingUserId] toRequest:requestId];
return;
}

Expand Down Expand Up @@ -292,7 +292,7 @@ - (void)roomCheckForRequest:(NSString*)requestId data:(NSDictionary*)requestData
}
else
{
[self sendLocalisedError:@"widget_integration_room_not_recognised" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationRoomNotRecognised] toRequest:requestId];
}
}

Expand Down Expand Up @@ -324,7 +324,7 @@ - (void)inviteUser:(NSString*)userId request:(NSString*)requestId data:(NSDictio
} failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);

[self sendLocalisedError:@"widget_integration_need_to_be_able_to_invite" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationNeedToBeAbleToInvite] toRequest:requestId];
}];
}
}];
Expand All @@ -348,13 +348,13 @@ - (void)setWidget:(NSString*)requestId data:(NSDictionary*)requestData

if (!widget_id)
{
[self sendLocalisedError:@"widget_integration_unable_to_create" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationUnableToCreate] toRequest:requestId];
return;
}

if (!widgetType)
{
[self sendLocalisedError:@"widget_integration_unable_to_create" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationUnableToCreate] toRequest:requestId];
return;
}

Expand Down Expand Up @@ -412,7 +412,7 @@ - (void)setWidget:(NSString*)requestId data:(NSDictionary*)requestData
typeof(self) self = weakSelf;
if (self)
{
[self sendLocalisedError:@"widget_integration_unable_to_create" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationUnableToCreate] toRequest:requestId];
}
}];
}
Expand Down Expand Up @@ -441,7 +441,7 @@ - (void)setWidget:(NSString*)requestId data:(NSDictionary*)requestData
typeof(self) self = weakSelf;
if (self)
{
[self sendLocalisedError:@"widget_integration_failed_to_send_request" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationFailedToSendRequest] toRequest:requestId];
}
}];
}];
Expand Down Expand Up @@ -490,7 +490,7 @@ - (void)canSendEvent:(NSString*)requestId data:(NSDictionary*)requestData

if (room.summary.membership != MXMembershipJoin)
{
[self sendLocalisedError:@"widget_integration_must_be_in_room" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationMustBeInRoom] toRequest:requestId];
return;
}

Expand All @@ -517,7 +517,7 @@ - (void)canSendEvent:(NSString*)requestId data:(NSDictionary*)requestData
}
else
{
[self sendLocalisedError:@"widget_integration_no_permission_in_room" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationNoPermissionInRoom] toRequest:requestId];
}

}];
Expand Down Expand Up @@ -576,7 +576,7 @@ - (void)setPlumbingState:(NSString*)requestId data:(NSDictionary*)requestData
typeof(self) self = weakSelf;
if (self)
{
[self sendLocalisedError:@"widget_integration_failed_to_send_request" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationFailedToSendRequest] toRequest:requestId];
}
}];
}
Expand Down Expand Up @@ -648,7 +648,7 @@ - (void)setBotOptions:(NSString*)userId request:(NSString*)requestId data:(NSDic
typeof(self) self = weakSelf;
if (self)
{
[self sendLocalisedError:@"widget_integration_failed_to_send_request" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationFailedToSendRequest] toRequest:requestId];
}
}];
}
Expand Down Expand Up @@ -687,14 +687,14 @@ - (void)setBotPower:(NSString*)userId request:(NSString*)requestId data:(NSDicti
typeof(self) self = weakSelf;
if (self)
{
[self sendLocalisedError:@"widget_integration_failed_to_send_request" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationFailedToSendRequest] toRequest:requestId];
}
}];
}
else
{
MXLogDebug(@"[IntegrationManagerVC] setBotPower. Power level must be positive integer.");
[self sendLocalisedError:@"widget_integration_positive_power_level" toRequest:requestId];
[self sendError:[VectorL10n widgetIntegrationPositivePowerLevel] toRequest:requestId];
}
}];
}
Expand Down
8 changes: 0 additions & 8 deletions Riot/Modules/Integrations/Widgets/WidgetViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,4 @@
*/
- (void)sendError:(NSString*)message toRequest:(NSString*)requestId;

/**
Send a localised message error to a request from the widget.
@param errorKey the string id of the message error.
@param requestId the id of the widget request.
*/
- (void)sendLocalisedError:(NSString*)errorKey toRequest:(NSString*)requestId;

@end
6 changes: 0 additions & 6 deletions Riot/Modules/Integrations/Widgets/WidgetViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,6 @@ - (void)sendError:(NSString*)message toRequest:(NSString*)requestId
toRequest:requestId];
}

- (void)sendLocalisedError:(NSString*)errorKey toRequest:(NSString*)requestId
{
[self sendError:NSLocalizedStringFromTable(errorKey, @"Vector", nil) toRequest:requestId];
}


#pragma mark - Private methods

- (NSString *)stringByReplacingScalarTokenInString:(NSString*)string byScalarToken:(NSString*)scalarToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}
break;
case UserEncryptionTrustLevelUnknown:
[encryptionInformation appendString:NSLocalizedStringFromTable(@"room_participants_security_information_loading", @"Vector", nil)];
[encryptionInformation appendString:[VectorL10n roomParticipantsSecurityLoading]];
break;
default:
break;
Expand Down Expand Up @@ -1144,7 +1144,7 @@ - (void)onActionButtonPressed:(id)sender

}]];

[currentAlert addAction:[UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"ban", @"Vector", nil)
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ban]
style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {

if (weakSelf)
Expand Down

0 comments on commit 710b784

Please sign in to comment.