Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2020-10-13 19:33:09 +02:00
Родитель e883fd15d5
Коммит 46fd3d455b
28 изменённых файлов: 318 добавлений и 311 удалений

Просмотреть файл

@ -28,7 +28,7 @@
self.bestAttemptContent = [request.content mutableCopy];
self.bestAttemptContent.title = @"";
self.bestAttemptContent.body = @"You received a new notification";
self.bestAttemptContent.body = NSLocalizedString(@"You received a new notification", nil);
// Configure database
NSString *path = [[[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"group.com.nextcloud.Talk"] URLByAppendingPathComponent:kTalkDatabaseFolder] path];
@ -110,7 +110,7 @@
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
self.bestAttemptContent.title = @"";
self.bestAttemptContent.body = @"You received a new notification";
self.bestAttemptContent.body = NSLocalizedString(@"You received a new notification", nil);
self.contentHandler(self.bestAttemptContent);
}

Просмотреть файл

@ -63,13 +63,13 @@
if (_isModal) {
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self action:@selector(cancelButtonPressed)];
cancelButton.accessibilityHint = @"Double tap to dismiss sharing options";
cancelButton.accessibilityHint = NSLocalizedString(@"Double tap to dismiss sharing options", nil);
self.navigationController.navigationBar.topItem.leftBarButtonItem = cancelButton;
}
_sendButton = [[UIBarButtonItem alloc] initWithTitle:@"Send" style:UIBarButtonItemStyleDone
_sendButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Send", nil) style:UIBarButtonItemStyleDone
target:self action:@selector(sendButtonPressed)];
_sendButton.accessibilityHint = @"Double tap to share with selected conversations";
_sendButton.accessibilityHint = NSLocalizedString(@"Double tap to share with selected conversations", nil);
self.navigationItem.rightBarButtonItem = _sendButton;
_sharingIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
@ -85,7 +85,7 @@
NSForegroundColorAttributeName:[UIColor darkTextColor]};
NSDictionary *subAttribute = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:15],
NSForegroundColorAttributeName:[UIColor lightGrayColor]};
NSMutableAttributedString *toString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"To: %@", _room.displayName] attributes:attributes];
NSMutableAttributedString *toString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:NSLocalizedString(@"To: %@", nil), _room.displayName] attributes:attributes];
[toString addAttributes:subAttribute range:NSMakeRange(0, 3)];
self.toTextView.attributedText = toString;
@ -191,9 +191,9 @@
_hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
_hud.mode = MBProgressHUDModeAnnularDeterminate;
_hud.label.text = @"Uploading file";
_hud.label.text = NSLocalizedString(@"Uploading file", nil);
if (_type == ShareConfirmationTypeImage || _type == ShareConfirmationTypeImageFile) {
_hud.label.text = @"Uploading image";
_hud.label.text = NSLocalizedString(@"Uploading image", nil);
}
[self checkForUniqueNameAndUploadFileWithName:fileName withOriginalName:YES];

Просмотреть файл

@ -80,7 +80,7 @@
[_searchController.searchBar sizeToFit];
// Configure navigation bar
self.navigationItem.title = @"Share with";
self.navigationItem.title = NSLocalizedString(@"Share with", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -89,7 +89,7 @@
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self action:@selector(cancelButtonPressed)];
cancelButton.accessibilityHint = @"Double tap to dismiss sharing options";
cancelButton.accessibilityHint = NSLocalizedString(@"Double tap to dismiss sharing options", nil);
self.navigationController.navigationBar.topItem.leftBarButtonItem = cancelButton;
if (@available(iOS 13.0, *)) {
@ -134,14 +134,14 @@
// Rooms placeholder view
_roomsBackgroundView = [[PlaceholderView alloc] init];
[_roomsBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"conversations-placeholder"]];
[_roomsBackgroundView.placeholderText setText:@"You are not part of any conversation."];
[_roomsBackgroundView.placeholderText setText:NSLocalizedString(@"You are not part of any conversation", nil)];
[_roomsBackgroundView.placeholderView setHidden:(_rooms.count > 0)];
[_roomsBackgroundView.loadingView setHidden:YES];
self.tableView.backgroundView = _roomsBackgroundView;
_roomSearchBackgroundView = [[PlaceholderView alloc] init];
[_roomSearchBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"conversations-placeholder"]];
[_roomSearchBackgroundView.placeholderText setText:@"No results found."];
[_roomSearchBackgroundView.placeholderText setText:NSLocalizedString(@"No results found", nil)];
[_roomSearchBackgroundView.placeholderView setHidden:YES];
[_roomSearchBackgroundView.loadingView setHidden:YES];
_resultTableViewController.tableView.backgroundView = _roomSearchBackgroundView;

10
ThirdParty/AppRTC/ARDSettingsModel.m поставляемый
Просмотреть файл

@ -43,15 +43,15 @@ static NSArray<NSString *> *videoCodecsStaticValues() {
}
- (NSString *)readableResolution:(NSString *)resolution {
NSString *readableResolution = @"Unknown";
NSString *readableResolution = NSLocalizedString(@"Unknown", nil);
if ([resolution isEqualToString:videoResolutionsStaticValues()[0]]) {
readableResolution = @"Low";
readableResolution = NSLocalizedString(@"Low", nil);
} else if ([resolution isEqualToString:videoResolutionsStaticValues()[1]]) {
readableResolution = @"Normal";
readableResolution = NSLocalizedString(@"Normal", nil);
} else if ([resolution isEqualToString:videoResolutionsStaticValues()[2]]) {
readableResolution = @"High";
readableResolution = NSLocalizedString(@"High", nil);
} else if ([resolution isEqualToString:videoResolutionsStaticValues()[3]]) {
readableResolution = @"HD";
readableResolution = NSLocalizedString(@"HD", nil);
}
return readableResolution;
}

Просмотреть файл

@ -101,7 +101,7 @@
// Contacts placeholder view
_participantsBackgroundView = [[PlaceholderView alloc] init];
[_participantsBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"contacts-placeholder"]];
[_participantsBackgroundView.placeholderText setText:@"No participants found."];
[_participantsBackgroundView.placeholderText setText:NSLocalizedString(@"No participants found", nil)];
[_participantsBackgroundView.placeholderView setHidden:YES];
[_participantsBackgroundView.loadingView startAnimating];
self.tableView.backgroundView = _participantsBackgroundView;
@ -118,7 +118,7 @@
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self action:@selector(cancelButtonPressed)];
self.navigationController.navigationBar.topItem.leftBarButtonItem = cancelButton;
self.navigationItem.title = @"Add participants";
self.navigationItem.title = NSLocalizedString(@"Add participants", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -189,12 +189,12 @@
[[NCAPIController sharedInstance] addParticipant:participant.userId ofType:participant.source toRoom:_room.token forAccount:[[NCDatabaseManager sharedInstance] activeAccount] withCompletionBlock:^(NSError *error) {
if (error) {
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:@"Could not add participant"
message:[NSString stringWithFormat:@"An error occurred while adding %@ to the room", participant.name]
alertControllerWithTitle:NSLocalizedString(@"Could not add participant", nil)
message:[NSString stringWithFormat:NSLocalizedString(@"An error occurred while adding %@ to the room", nil), participant.name]
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil];
@ -208,7 +208,7 @@
- (void)updateCounter
{
if (_selectedParticipants.count > 0) {
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:@"Add (%lu)", (unsigned long)_selectedParticipants.count]
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Add (%lu)", nil), (unsigned long)_selectedParticipants.count]
style:UIBarButtonItemStylePlain target:self action:@selector(addButtonPressed)];
self.navigationController.navigationBar.topItem.rightBarButtonItem = addButton;
} else {

Просмотреть файл

@ -110,7 +110,7 @@ NSString *const kCallParticipantCellNibName = @"CallParticipantViewCell";
{
_displayName = displayName;
if (!displayName || [displayName isKindOfClass:[NSNull class]] || [displayName isEqualToString:@""]) {
_displayName = @"Guest";
_displayName = NSLocalizedString(@"Guest", nil);
}
dispatch_async(dispatch_get_main_queue(), ^{
self.peerNameLabel.text = _displayName;
@ -162,7 +162,7 @@ NSString *const kCallParticipantCellNibName = @"CallParticipantViewCell";
{
if (_connectionState == RTCIceConnectionStateDisconnected) {
dispatch_async(dispatch_get_main_queue(), ^{
self.peerNameLabel.text = [NSString stringWithFormat:@"Connecting to %@…", _displayName];
self.peerNameLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Connecting to %@…", nil), _displayName];
self.peerAvatarImageView.alpha = 0.3;
});
}
@ -171,7 +171,7 @@ NSString *const kCallParticipantCellNibName = @"CallParticipantViewCell";
- (void)setFailedConnectionUI
{
dispatch_async(dispatch_get_main_queue(), ^{
self.peerNameLabel.text = [NSString stringWithFormat:@"Failed to connect to %@", _displayName];
self.peerNameLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Failed to connect to %@", nil), _displayName];
self.peerAvatarImageView.alpha = 0.3;
});
}

Просмотреть файл

@ -129,21 +129,21 @@ typedef NS_ENUM(NSInteger, CallState) {
[self.chatButton.layer setCornerRadius:30.0f];
[self.closeScreensharingButton.layer setCornerRadius:16.0f];
self.audioMuteButton.accessibilityLabel = @"Microphone";
self.audioMuteButton.accessibilityValue = @"Microphone enabled";
self.audioMuteButton.accessibilityHint = @"Doble tap to enable or disable the microphone";
self.speakerButton.accessibilityLabel = @"Speaker";
self.speakerButton.accessibilityValue = @"Speaker disabled";
self.speakerButton.accessibilityHint = @"Doble tap to enable or disable the speaker";
self.videoDisableButton.accessibilityLabel = @"Camera";
self.videoDisableButton.accessibilityValue = @"Camera enabled";
self.videoDisableButton.accessibilityHint = @"Doble tap to enable or disable the camera";
self.hangUpButton.accessibilityLabel = @"Hang up";
self.hangUpButton.accessibilityHint = @"Doble tap to hang up the call";
self.videoCallButton.accessibilityLabel = @"Camera";
self.videoCallButton.accessibilityHint = @"Doble tap to upgrade this voice call to a video call";
self.chatButton.accessibilityLabel = @"Chat";
self.chatButton.accessibilityHint = @"Doble tap to show call's chat";
self.audioMuteButton.accessibilityLabel = NSLocalizedString(@"Microphone", nil);
self.audioMuteButton.accessibilityValue = NSLocalizedString(@"Microphone enabled", nil);
self.audioMuteButton.accessibilityHint = NSLocalizedString(@"Doble tap to enable or disable the microphone", nil);
self.speakerButton.accessibilityLabel = NSLocalizedString(@"Speaker", nil);
self.speakerButton.accessibilityValue = NSLocalizedString(@"Speaker disabled", nil);
self.speakerButton.accessibilityHint = NSLocalizedString(@"Doble tap to enable or disable the speaker", nil);
self.videoDisableButton.accessibilityLabel = NSLocalizedString(@"Camera", nil);
self.videoDisableButton.accessibilityValue = NSLocalizedString(@"Camera enabled", nil);
self.videoDisableButton.accessibilityHint = NSLocalizedString(@"Doble tap to enable or disable the camera", nil);
self.hangUpButton.accessibilityLabel = NSLocalizedString(@"Hang up", nil);
self.hangUpButton.accessibilityHint = NSLocalizedString(@"Doble tap to hang up the call", nil);
self.videoCallButton.accessibilityLabel = NSLocalizedString(@"Camera", nil);
self.videoCallButton.accessibilityHint = NSLocalizedString(@"Doble tap to upgrade this voice call to a video call", nil);
self.chatButton.accessibilityLabel = NSLocalizedString(@"Chat", nil);
self.chatButton.accessibilityHint = NSLocalizedString(@"Doble tap to show call's chat", nil);
[self adjustButtonsConainer];
@ -392,13 +392,13 @@ typedef NS_ENUM(NSInteger, CallState) {
- (void)setWaitingScreenText
{
NSString *waitingMessage = @"Waiting for others to join call…";
NSString *waitingMessage = NSLocalizedString(@"Waiting for others to join call…", nil);
if (_room.type == kNCRoomTypeOneToOne) {
waitingMessage = [NSString stringWithFormat:@"Waiting for %@ to join call…", _room.displayName];
waitingMessage = [NSString stringWithFormat:NSLocalizedString(@"Waiting for %@ to join call…", nil), _room.displayName];
}
if (_callState == CallStateReconnecting) {
waitingMessage = @"Connecting to the call…";
waitingMessage = NSLocalizedString(@"Connecting to the call…", nil);
}
dispatch_async(dispatch_get_main_queue(), ^{
@ -520,14 +520,14 @@ typedef NS_ENUM(NSInteger, CallState) {
- (void)presentJoinCallError
{
NSString *alertTitle = [NSString stringWithFormat:@"Could not join %@ call", _room.displayName];
NSString *alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Could not join %@ call", nil), _room.displayName];
if (_room.type == kNCRoomTypeOneToOne) {
alertTitle = [NSString stringWithFormat:@"Could not join call with %@", _room.displayName];
alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Could not join call with %@", nil), _room.displayName];
}
UIAlertController * alert = [UIAlertController alertControllerWithTitle:alertTitle
message:@"An error occurred while joining the call"
message:NSLocalizedString(@"An error occurred while joining the call", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction actionWithTitle:@"OK"
UIAlertAction* okButton = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self hangup];
@ -562,10 +562,10 @@ typedef NS_ENUM(NSInteger, CallState) {
- (void)showForceMutedWarning
{
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:@"You have been muted by a moderator"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"You have been muted by a moderator", nil)
message:nil
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:confirmAction];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:confirmDialog animated:YES completion:nil];
@ -577,8 +577,9 @@ typedef NS_ENUM(NSInteger, CallState) {
[_callController enableAudio:NO];
dispatch_async(dispatch_get_main_queue(), ^{
[_audioMuteButton setImage:[UIImage imageNamed:@"audio-off"] forState:UIControlStateNormal];
_audioMuteButton.accessibilityValue = @"Microphone disabled";
[self.view makeToast:@"Microphone disabled" duration:1.5 position:CSToastPositionCenter];
NSString *micDisabledString = NSLocalizedString(@"Microphone disabled", nil);
_audioMuteButton.accessibilityValue = micDisabledString;
[self.view makeToast:micDisabledString duration:1.5 position:CSToastPositionCenter];
});
}
@ -587,8 +588,9 @@ typedef NS_ENUM(NSInteger, CallState) {
[_callController enableAudio:YES];
dispatch_async(dispatch_get_main_queue(), ^{
[_audioMuteButton setImage:[UIImage imageNamed:@"audio"] forState:UIControlStateNormal];
_audioMuteButton.accessibilityValue = @"Microphone enabled";
[self.view makeToast:@"Microphone enabled" duration:1.5 position:CSToastPositionCenter];
NSString *micEnabledString = NSLocalizedString(@"Microphone enabled", nil);
_audioMuteButton.accessibilityValue = micEnabledString;
[self.view makeToast:micEnabledString duration:1.5 position:CSToastPositionCenter];
});
}
@ -611,9 +613,10 @@ typedef NS_ENUM(NSInteger, CallState) {
[_captureController stopCapture];
[_localVideoView setHidden:YES];
[_videoDisableButton setImage:[UIImage imageNamed:@"video-off"] forState:UIControlStateNormal];
_videoDisableButton.accessibilityValue = @"Camera disabled";
NSString *cameraDisabledString = NSLocalizedString(@"Camera disabled", nil);
_videoDisableButton.accessibilityValue = cameraDisabledString;
if (!_isAudioOnly) {
[self.view makeToast:@"Camera disabled" duration:1.5 position:CSToastPositionCenter];
[self.view makeToast:cameraDisabledString duration:1.5 position:CSToastPositionCenter];
}
}
@ -623,7 +626,7 @@ typedef NS_ENUM(NSInteger, CallState) {
[_captureController startCapture];
[_localVideoView setHidden:NO];
[_videoDisableButton setImage:[UIImage imageNamed:@"video"] forState:UIControlStateNormal];
_videoDisableButton.accessibilityValue = @"Camera enabled";
_videoDisableButton.accessibilityValue = NSLocalizedString(@"Camera enabled", nil);
}
- (IBAction)switchCameraButtonPressed:(id)sender
@ -661,16 +664,18 @@ typedef NS_ENUM(NSInteger, CallState) {
{
[[NCAudioController sharedInstance] setAudioSessionToVoiceChatMode];
[_speakerButton setImage:[UIImage imageNamed:@"speaker-off"] forState:UIControlStateNormal];
_speakerButton.accessibilityValue = @"Speaker disabled";
[self.view makeToast:@"Speaker disabled" duration:1.5 position:CSToastPositionCenter];
NSString *speakerDisabledString = NSLocalizedString(@"Speaker disabled", nil);
_speakerButton.accessibilityValue = speakerDisabledString;
[self.view makeToast:speakerDisabledString duration:1.5 position:CSToastPositionCenter];
}
- (void)enableSpeaker
{
[[NCAudioController sharedInstance] setAudioSessionToVideoChatMode];
[_speakerButton setImage:[UIImage imageNamed:@"speaker"] forState:UIControlStateNormal];
_speakerButton.accessibilityValue = @"Speaker enabled";
[self.view makeToast:@"Speaker enabled" duration:1.5 position:CSToastPositionCenter];
NSString *speakerEnabledString = NSLocalizedString(@"Speaker enabled", nil);
_speakerButton.accessibilityValue = speakerEnabledString;
[self.view makeToast:speakerEnabledString duration:1.5 position:CSToastPositionCenter];
}
- (IBAction)hangupButtonPressed:(id)sender
@ -720,14 +725,14 @@ typedef NS_ENUM(NSInteger, CallState) {
- (void)showUpgradeToVideoCallDialog
{
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:@"Do you want to enable your video?"
message:@"If you enable your video, this call will be interrupted for a few seconds."
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Do you want to enable your video?", nil)
message:NSLocalizedString(@"If you enable your video, this call will be interrupted for a few seconds.", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"Enable" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Enable", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self upgradeToVideoCall];
}];
[confirmDialog addAction:confirmAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:cancelAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}

Просмотреть файл

@ -56,7 +56,7 @@
// Directory placeholder view
_directoryBackgroundView = [[PlaceholderView alloc] init];
[_directoryBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"folder-placeholder"]];
[_directoryBackgroundView.placeholderText setText:@"No files in here"];
[_directoryBackgroundView.placeholderText setText:NSLocalizedString(@"No files in here", nil)];
[_directoryBackgroundView.placeholderView setHidden:YES];
[_directoryBackgroundView.loadingView startAnimating];
self.tableView.backgroundView = _directoryBackgroundView;
@ -96,21 +96,21 @@
[UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *alphabetical = [UIAlertAction actionWithTitle:@"Alphabetical order"
UIAlertAction *alphabetical = [UIAlertAction actionWithTitle:NSLocalizedString(@"Alphabetical order", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[[NCSettingsController sharedInstance] setPreferredFileSorting:NCAlphabeticalSorting];
[self sortItemsInDirectory];
}];
[optionsActionSheet addAction:alphabetical];
UIAlertAction *modificationDate = [UIAlertAction actionWithTitle:@"Modification date"
UIAlertAction *modificationDate = [UIAlertAction actionWithTitle:NSLocalizedString(@"Modification date", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[[NCSettingsController sharedInstance] setPreferredFileSorting:NCModificationDateSorting];
[self sortItemsInDirectory];
}];
[optionsActionSheet addAction:modificationDate];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
UIAlertAction *selectedAction = modificationDate;
switch ([[NCSettingsController sharedInstance] getPreferredFileSorting]) {
@ -241,13 +241,13 @@
{
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:name
message:[NSString stringWithFormat:@"Do you want to share '%@' in the conversation?", name]
message:[NSString stringWithFormat:NSLocalizedString(@"Do you want to share '%@' in the conversation?", nil), name]
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"Share" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Share", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self shareFileWithPath:path];
}];
[confirmDialog addAction:confirmAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:cancelAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}
@ -255,10 +255,10 @@
- (void)showErrorSharingItem
{
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:@"Could not share file"
message:@"An error occurred while sharing the file"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Could not share file", nil)
message:NSLocalizedString(@"An error occurred while sharing the file", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil];
[confirmDialog addAction:confirmAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}
@ -270,19 +270,19 @@
ti = ti * -1;
if (ti < 60) {
// This minute
return @"less than a minute ago";
return NSLocalizedString(@"less than a minute ago", nil);
} else if (ti < 3600) {
// This hour
int diff = round(ti / 60);
return [NSString stringWithFormat:@"%d minutes ago", diff];
return [NSString stringWithFormat:NSLocalizedString(@"%d minutes ago", nil), diff];
} else if (ti < 86400) {
// This day
int diff = round(ti / 60 / 60);
return[NSString stringWithFormat:@"%d hours ago", diff];
return[NSString stringWithFormat:NSLocalizedString(@"%d hours ago", nil), diff];
} else if (ti < 86400 * 30) {
// This month
int diff = round(ti / 60 / 60 / 24);
return[NSString stringWithFormat:@"%d days ago", diff];
return[NSString stringWithFormat:NSLocalizedString(@"%d days ago", nil), diff];
} else {
// Older than one month
NSDateFormatter *df = [[NSDateFormatter alloc] init];

Просмотреть файл

@ -34,7 +34,7 @@
self.appLogo.image = [UIImage imageNamed:@"loginLogo"];
self.view.backgroundColor = [UIColor colorWithRed:0.00 green:0.51 blue:0.79 alpha:1.0]; //#0082C9
NSString *serverUrlPlaceholderText = @"Server address https://…";
NSString *serverUrlPlaceholderText = NSLocalizedString(@"Server address https://…", nil);
self.serverUrl.textColor = [UIColor whiteColor];
self.serverUrl.tintColor = [UIColor whiteColor];
self.serverUrl.attributedPlaceholder = [[NSAttributedString alloc] initWithString:serverUrlPlaceholderText
@ -47,7 +47,7 @@
self.activityIndicatorView.hidden = YES;
self.cancel.hidden = !(multiAccountEnabled && [[NCDatabaseManager sharedInstance] numberOfAccounts] > 0);
[self.cancel setTitle:@"Cancel" forState:UIControlStateNormal];
[self.cancel setTitle:NSLocalizedString(@"Cancel", nil) forState:UIControlStateNormal];
}
- (void)didReceiveMemoryWarning
@ -87,7 +87,7 @@
if (serverURL) {
[self startLoginProcess];
} else {
[self showAlertWithTitle:@"Invalid server address" andMessage:@"Please check that you entered a valid server address."];
[self showAlertWithTitle:NSLocalizedString(@"Invalid server address", nil) andMessage:NSLocalizedString(@"Please check that you entered a valid server address.", nil)];
}
}
@ -122,9 +122,9 @@
if ([talkFeatures containsObject:kMinimumRequiredTalkCapability]) {
[self presentAuthenticationView];
} else if (talkFeatures.count == 0) {
[self showAlertWithTitle:@"Nextcloud Talk not installed" andMessage:@"It seems that Nextcloud Talk is not installed in your server."];
[self showAlertWithTitle:NSLocalizedString(@"Nextcloud Talk not installed", nil) andMessage:NSLocalizedString(@"It seems that Nextcloud Talk is not installed in your server.", nil)];
} else {
[self showAlertWithTitle:@"Nextcloud Talk version not supported" andMessage:@"Please update your server with the latest Nextcloud Talk version available."];
[self showAlertWithTitle:NSLocalizedString(@"Nextcloud Talk version not supported", nil) andMessage:NSLocalizedString(@"Please update your server with the latest Nextcloud Talk version available.", nil)];
}
} else {
// Self signed certificate
@ -133,7 +133,7 @@
[[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:self delegate:self];
});
} else {
[self showAlertWithTitle:@"Nextcloud server not found" andMessage:@"Please check that you entered the correct Nextcloud server address."];
[self showAlertWithTitle:NSLocalizedString(@"Nextcloud server not found", nil) andMessage:NSLocalizedString(@"Please check that you entered the correct Nextcloud server address.", nil)];
}
}
}];
@ -156,7 +156,7 @@
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[_serverUrl becomeFirstResponder];

Просмотреть файл

@ -56,7 +56,7 @@
_separatorLabel.numberOfLines = 1;
_separatorLabel.textColor = [UIColor lightGrayColor];
_separatorLabel.font = [UIFont systemFontOfSize:12.0];
_separatorLabel.text = @"Unread messages";
_separatorLabel.text = NSLocalizedString(@"Unread messages", nil);
}
return _separatorLabel;
}

Просмотреть файл

@ -152,11 +152,11 @@ typedef enum NCChatMessageAction {
[self.rightButton setTitle:@"" forState:UIControlStateNormal];
[self.rightButton setImage:[UIImage imageNamed:@"send"] forState:UIControlStateNormal];
self.rightButton.accessibilityLabel = @"Send message";
self.rightButton.accessibilityHint = @"Double tap to send message";
self.rightButton.accessibilityLabel = NSLocalizedString(@"Send message", nil);
self.rightButton.accessibilityHint = NSLocalizedString(@"Double tap to send message", nil);
[self.leftButton setImage:[UIImage imageNamed:@"attachment"] forState:UIControlStateNormal];
self.leftButton.accessibilityLabel = @"Share a file from your Nextcloud";
self.leftButton.accessibilityHint = @"Double tap to open file browser";
self.leftButton.accessibilityLabel = NSLocalizedString(@"Share a file from your Nextcloud", nil);
self.leftButton.accessibilityHint = NSLocalizedString(@"Double tap to open file browser", nil);
self.textInputbar.autoHideRightButton = NO;
NSInteger chatMaxLength = [[NCSettingsController sharedInstance] chatMaxLengthConfigCapability];
@ -220,7 +220,7 @@ typedef enum NCChatMessageAction {
_unreadMessageButton.hidden = YES;
_unreadMessageButton.translatesAutoresizingMaskIntoConstraints = NO;
[_unreadMessageButton addTarget:self action:@selector(unreadMessagesButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[_unreadMessageButton setTitle:@"↓ New messages" forState:UIControlStateNormal];
[_unreadMessageButton setTitle:NSLocalizedString(@"↓ New messages", nil) forState:UIControlStateNormal];
// Unread messages separator
_unreadMessagesSeparator = [[NCChatMessage alloc] init];
@ -366,7 +366,7 @@ typedef enum NCChatMessageAction {
[_titleView.image setImage:[UIImage imageNamed:@"password-bg"]];
}
_titleView.title.accessibilityHint = @"Double tap to go to conversation information";
_titleView.title.accessibilityHint = NSLocalizedString(@"Double tap to go to conversation information", nil);
}
- (void)configureActionItems
@ -375,15 +375,15 @@ typedef enum NCChatMessageAction {
style:UIBarButtonItemStylePlain
target:self
action:@selector(videoCallButtonPressed:)];
_videoCallButton.accessibilityLabel = @"Video call";
_videoCallButton.accessibilityHint = @"Double tap to start a video call";
_videoCallButton.accessibilityLabel = NSLocalizedString(@"Video call", nil);
_videoCallButton.accessibilityHint = NSLocalizedString(@"Double tap to start a video call", nil);
_voiceCallButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"call-action"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(voiceCallButtonPressed:)];
_voiceCallButton.accessibilityLabel = @"Voice call";
_voiceCallButton.accessibilityHint = @"Double tap to start a voice call";
_voiceCallButton.accessibilityLabel = NSLocalizedString(@"Voice call", nil);
_voiceCallButton.accessibilityHint = NSLocalizedString(@"Double tap to start a voice call", nil);
self.navigationItem.rightBarButtonItems = @[_videoCallButton, _voiceCallButton];
}
@ -421,12 +421,12 @@ typedef enum NCChatMessageAction {
- (void)checkLobbyState
{
if ([self shouldPresentLobbyView]) {
[_chatBackgroundView.placeholderText setText:@"You are currently waiting in the lobby."];
[_chatBackgroundView.placeholderText setText:NSLocalizedString(@"You are currently waiting in the lobby", nil)];
[_chatBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"lobby-placeholder"]];
if (_room.lobbyTimer > 0) {
NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:_room.lobbyTimer];
NSString *meetingStart = [NCUtils readableDateFromDate:date];
NSString *placeHolderText = [NSString stringWithFormat:@"You are currently waiting in the lobby.\nThis meeting is scheduled for\n%@", meetingStart];
NSString *placeHolderText = [NSString stringWithFormat:NSLocalizedString(@"You are currently waiting in the lobby.\nThis meeting is scheduled for\n%@", nil), meetingStart];
[_chatBackgroundView.placeholderText setText:placeHolderText];
[_chatBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"lobby-placeholder"]];
}
@ -436,7 +436,7 @@ typedef enum NCChatMessageAction {
// Clear current chat since chat history will be retrieve when lobby is disabled
[self cleanChat];
} else {
[_chatBackgroundView.placeholderText setText:@"No messages yet, start the conversation!"];
[_chatBackgroundView.placeholderText setText:NSLocalizedString(@"No messages yet, start the conversation!", nil)];
[_chatBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"chat-placeholder"]];
[_chatBackgroundView.placeholderView setHidden:YES];
[_chatBackgroundView.loadingView startAnimating];
@ -459,7 +459,7 @@ typedef enum NCChatMessageAction {
footerLabel.textColor = [UIColor lightGrayColor];
footerLabel.font = [UIFont systemFontOfSize:12.0];
footerLabel.backgroundColor = [UIColor clearColor];
footerLabel.text = @"Offline, only showing downloaded messages";
footerLabel.text = NSLocalizedString(@"Offline, only showing downloaded messages", nil);
self.tableView.tableFooterView = footerLabel;
self.tableView.tableFooterView.backgroundColor = [UIColor colorWithWhite:0.95 alpha:1];
}
@ -501,14 +501,14 @@ typedef enum NCChatMessageAction {
- (void)presentJoinRoomError
{
NSString *alertTitle = [NSString stringWithFormat:@"Could not join %@", _room.displayName];
NSString *alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Could not join %@", nil), _room.displayName];
if (_room.type == kNCRoomTypeOneToOne) {
alertTitle = [NSString stringWithFormat:@"Could not join conversation with %@", _room.displayName];
alertTitle = [NSString stringWithFormat:NSLocalizedString(@"Could not join conversation with %@", nil), _room.displayName];
}
UIAlertController * alert = [UIAlertController alertControllerWithTitle:alertTitle
message:@"An error occurred while joining the conversation"
message:NSLocalizedString(@"An error occurred while joining the conversation", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction actionWithTitle:@"OK"
UIAlertAction* okButton = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil];
[alert addAction:okButton];
@ -669,21 +669,21 @@ typedef enum NCChatMessageAction {
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *photoLibraryAction = [UIAlertAction actionWithTitle:@"Photo Library"
UIAlertAction *photoLibraryAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Photo Library", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self presentPhotoLibrary];
}];
[photoLibraryAction setValue:[[UIImage imageNamed:@"photos"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
UIAlertAction *filesAction = [UIAlertAction actionWithTitle:@"Files"
UIAlertAction *filesAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Files", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self presentDocumentPicker];
}];
[filesAction setValue:[[UIImage imageNamed:@"files"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
UIAlertAction *ncFilesAction = [UIAlertAction actionWithTitle:@"Nextcloud Files"
UIAlertAction *ncFilesAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Nextcloud Files", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self presentNextcloudFilesBrowser];
@ -693,7 +693,7 @@ typedef enum NCChatMessageAction {
[optionsActionSheet addAction:photoLibraryAction];
[optionsActionSheet addAction:filesAction];
[optionsActionSheet addAction:ncFilesAction];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.leftButton;
@ -855,23 +855,23 @@ typedef enum NCChatMessageAction {
// Reply option
if (message.isReplyable) {
NSDictionary *replyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionReply) forKey:@"action"];
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:@"Reply" image:[UIImage imageNamed:@"reply"] userInfo:replyInfo];
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Reply", nil) image:[UIImage imageNamed:@"reply"] userInfo:replyInfo];
[menuArray addObject:replyModel];
}
// Re-send option
if (message.sendingFailed) {
NSDictionary *replyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionResend) forKey:@"action"];
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:@"Resend" image:[UIImage imageNamed:@"refresh"] userInfo:replyInfo];
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Resend", nil) image:[UIImage imageNamed:@"refresh"] userInfo:replyInfo];
[menuArray addObject:replyModel];
}
// Copy option
NSDictionary *copyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionCopy) forKey:@"action"];
FTPopOverMenuModel *copyModel = [[FTPopOverMenuModel alloc] initWithTitle:@"Copy" image:[UIImage imageNamed:@"clippy"] userInfo:copyInfo];
FTPopOverMenuModel *copyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Copy", nil) image:[UIImage imageNamed:@"clippy"] userInfo:copyInfo];
[menuArray addObject:copyModel];
// Delete option
if (message.sendingFailed) {
NSDictionary *replyInfo = [NSDictionary dictionaryWithObject:@(kNCChatMessageActionDelete) forKey:@"action"];
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:@"Delete" image:[UIImage imageNamed:@"delete"] userInfo:replyInfo];
FTPopOverMenuModel *replyModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Delete", nil) image:[UIImage imageNamed:@"delete"] userInfo:replyInfo];
[menuArray addObject:replyModel];
}
@ -1218,12 +1218,12 @@ typedef enum NCChatMessageAction {
} else {
self.textView.text = message;
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:@"Could not send the message"
message:@"An error occurred while sending the message"
alertControllerWithTitle:NSLocalizedString(@"Could not send the message", nil)
message:NSLocalizedString(@"An error occurred while sending the message", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil];
@ -1689,13 +1689,13 @@ typedef enum NCChatMessageAction {
if (message.messageId == kUnreadMessagesSeparatorIdentifier) {
MessageSeparatorTableViewCell *separatorCell = (MessageSeparatorTableViewCell *)[self.tableView dequeueReusableCellWithIdentifier:MessageSeparatorCellIdentifier];
separatorCell.messageId = message.messageId;
separatorCell.separatorLabel.text = @"Unread messages";
separatorCell.separatorLabel.text = NSLocalizedString(@"Unread messages", nil);
return separatorCell;
}
if (message.messageId == kChatBlockSeparatorIdentifier) {
MessageSeparatorTableViewCell *separatorCell = (MessageSeparatorTableViewCell *)[self.tableView dequeueReusableCellWithIdentifier:MessageSeparatorCellIdentifier];
separatorCell.messageId = message.messageId;
separatorCell.separatorLabel.text = @"Some messages not shown, will be downloaded when online";
separatorCell.separatorLabel.text = NSLocalizedString(@"Some messages not shown, will be downloaded when online", nil);
return separatorCell;
}
if (message.isSystemMessage) {

Просмотреть файл

@ -54,9 +54,9 @@
NSString *author = [[_subjectRichParameters objectForKey:@"user"] objectForKey:@"name"];
NSString *guest = [[_subjectRichParameters objectForKey:@"guest"] objectForKey:@"name"];
if (guest) {
author = [NSString stringWithFormat:@"%@ (%@)", guest, @"guest"];
author = [NSString stringWithFormat:@"%@ (%@)", guest, NSLocalizedString(@"guest", nil)];
}
return author ? author : @"Guest";
return author ? author : NSLocalizedString(@"Guest", nil);
}
- (NSString *)chatMessageTitle
@ -70,7 +70,8 @@
NSString *parameterKey = [[parameter stringByReplacingOccurrencesOfString:@"{" withString:@""]
stringByReplacingOccurrencesOfString:@"}" withString:@""];
if ([parameterKey isEqualToString:@"call"]) {
title = [title stringByAppendingString:[NSString stringWithFormat:@" in %@", [[_subjectRichParameters objectForKey:@"call"] objectForKey:@"name"]]];
NSString *inString = NSLocalizedString(@"in", nil);
title = [title stringByAppendingString:[NSString stringWithFormat:@" %@ %@", inString, [[_subjectRichParameters objectForKey:@"call"] objectForKey:@"name"]]];
}
}
return title;
@ -84,7 +85,7 @@
displayName = [[_subjectRichParameters objectForKey:@"user"] objectForKey:@"name"];
}
if (!displayName || [displayName isEqualToString:@"a conversation"]) {
displayName = @"Incoming call";
displayName = NSLocalizedString(@"Incoming call", nil);
}
return displayName;
}

Просмотреть файл

@ -84,14 +84,16 @@ NSString * const NCLocalNotificationJoinChatNotification = @"NCLocalN
switch (type) {
case kNCLocalNotificationTypeMissedCall:
{
content.body = [NSString stringWithFormat:@"☎️ Missed call from %@", [userInfo objectForKey:@"displayName"]];
NSString *missedCallString = NSLocalizedString(@"Missed call from", nil);
content.body = [NSString stringWithFormat:@"☎️ %@ %@", missedCallString, [userInfo objectForKey:@"displayName"]];
content.userInfo = userInfo;
}
break;
case kNCLocalNotificationTypeCancelledCall:
{
content.body = [NSString stringWithFormat:@"☎️ Cancelled call from another account"];
NSString *cancelledCallString = NSLocalizedString(@"Cancelled call from another account", nil);
content.body = [NSString stringWithFormat:@"☎️ %@", cancelledCallString];
content.userInfo = userInfo;
}
break;

Просмотреть файл

@ -150,11 +150,11 @@ NSString * const NCRoomObjectTypeSharePassword = @"share:password";
- (NSString *)deletionMessage
{
NSString *message = @"Do you really want to delete this conversation?";
NSString *message = NSLocalizedString(@"Do you really want to delete this conversation?", nil);
if (self.type == kNCRoomTypeOneToOne) {
message = [NSString stringWithFormat:@"If you delete the conversation, it will also be deleted for %@", self.displayName];
message = [NSString stringWithFormat:NSLocalizedString(@"If you delete the conversation, it will also be deleted for %@", nil), self.displayName];
} else if ([self.participants count] > 1) {
message = @"If you delete the conversation, it will also be deleted for all other participants.";
message = NSLocalizedString(@"If you delete the conversation, it will also be deleted for all other participants.", nil);
}
return message;
@ -167,16 +167,16 @@ NSString * const NCRoomObjectTypeSharePassword = @"share:password";
- (NSString *)stringForNotificationLevel:(NCRoomNotificationLevel)level
{
NSString *levelString = @"Default";
NSString *levelString = NSLocalizedString(@"Default", nil);
switch (level) {
case kNCRoomNotificationLevelAlways:
levelString = @"All messages";
levelString = NSLocalizedString(@"All messages", nil);
break;
case kNCRoomNotificationLevelMention:
levelString = @"@-mentions only";
levelString = NSLocalizedString(@"@-mentions only", nil);
break;
case kNCRoomNotificationLevelNever:
levelString = @"Off";
levelString = NSLocalizedString(@"Off", nil);
break;
default:
break;
@ -191,11 +191,11 @@ NSString * const NCRoomObjectTypeSharePassword = @"share:password";
NSString *actorName = [[self.lastMessage.actorDisplayName componentsSeparatedByString:@" "] objectAtIndex:0];
// For own messages
if (ownMessage) {
actorName = @"You";
actorName = NSLocalizedString(@"You", nil);
}
// For guests
if ([self.lastMessage.actorDisplayName isEqualToString:@""]) {
actorName = @"Guest";
actorName = NSLocalizedString(@"Guest", nil);
}
// No actor name cases
if (self.lastMessage.isSystemMessage || (self.type == kNCRoomTypeOneToOne && !ownMessage) || self.type == kNCRoomTypeChangelog) {

Просмотреть файл

@ -53,7 +53,8 @@
- (NSString *)displayName
{
if (self.canModerate) {
return [NSString stringWithFormat:@"%@ %@", _displayName, @"(moderator)"];
NSString *moderatorString = NSLocalizedString(@"moderator", nil);
return [NSString stringWithFormat:@"%@ (%@)", _displayName, moderatorString];
}
return _displayName;
}

Просмотреть файл

@ -89,12 +89,12 @@
- (void)presentOfflineWarningAlert
{
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:@"Disconnected"
message:@"It seems that there is no Internet connection."
alertControllerWithTitle:NSLocalizedString(@"Disconnected", nil)
message:NSLocalizedString(@"It seems that there is no Internet connection.", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil];
@ -106,12 +106,12 @@
- (void)presentTalkNotInstalledWarningAlert
{
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:@"Nextcloud Talk not installed"
message:@"It seems that Nextcloud Talk is not installed in your server."
alertControllerWithTitle:NSLocalizedString(@"Nextcloud Talk not installed", nil)
message:NSLocalizedString(@"It seems that Nextcloud Talk is not installed in your server.", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self logOutCurrentUser];
@ -125,12 +125,12 @@
- (void)presentTalkOutdatedWarningAlert
{
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:@"Nextcloud Talk version not supported"
message:@"Please update your server with the latest Nextcloud Talk version available."
alertControllerWithTitle:NSLocalizedString(@"Nextcloud Talk version not supported", nil)
message:NSLocalizedString(@"Please update your server with the latest Nextcloud Talk version available.", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
[self logOutCurrentUser];
@ -183,11 +183,11 @@
}
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:[pushNotification bodyForRemoteAlerts]
message:@"Do you want to join this call?"
message:NSLocalizedString(@"Do you want to join this call?", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *joinAudioButton = [UIAlertAction
actionWithTitle:@"Join call (audio only)"
actionWithTitle:NSLocalizedString(@"Join call (audio only)", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:pushNotification forKey:@"pushNotification"];
@ -197,7 +197,7 @@
}];
UIAlertAction *joinVideoButton = [UIAlertAction
actionWithTitle:@"Join call with video"
actionWithTitle:NSLocalizedString(@"Join call with video", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action) {
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:pushNotification forKey:@"pushNotification"];
@ -207,7 +207,7 @@
}];
UIAlertAction* cancelButton = [UIAlertAction
actionWithTitle:@"Cancel"
actionWithTitle:NSLocalizedString(@"Cancel", nil)
style:UIAlertActionStyleCancel
handler:nil];

Просмотреть файл

@ -46,15 +46,15 @@ NSString * const kUserStatusOffline = @"offline";
NSString *readableUserStatus = nil;
if ([userStatus isEqualToString:kUserStatusOnline]) {
readableUserStatus = @"Online";
readableUserStatus = NSLocalizedString(@"Online", nil);
} else if ([userStatus isEqualToString:kUserStatusAway]) {
readableUserStatus = @"Away";
readableUserStatus = NSLocalizedString(@"Away", nil);
} else if ([userStatus isEqualToString:kUserStatusDND]) {
readableUserStatus = @"Do not disturb";
readableUserStatus = NSLocalizedString(@"Do not disturb", nil);
} else if ([userStatus isEqualToString:kUserStatusInvisible]) {
readableUserStatus = @"Invisible";
readableUserStatus = NSLocalizedString(@"Invisible", nil);
} else if ([userStatus isEqualToString:kUserStatusOffline]) {
readableUserStatus = @"Offline";
readableUserStatus = NSLocalizedString(@"Offline", nil);
}
return readableUserStatus;

Просмотреть файл

@ -113,13 +113,13 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self action:@selector(cancelButtonPressed)];
self.navigationController.navigationBar.topItem.leftBarButtonItem = cancelButton;
self.navigationController.navigationBar.topItem.leftBarButtonItem.accessibilityHint = @"Cancel conversation creation";
self.navigationController.navigationBar.topItem.leftBarButtonItem.accessibilityHint = NSLocalizedString(@"Cancel conversation creation", nil);
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Back", nil) style:UIBarButtonItemStylePlain
target:nil action:nil];
self.navigationItem.backBarButtonItem = backButton;
self.navigationItem.title = @"New conversation";
self.navigationItem.title = NSLocalizedString(@"New conversation", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -290,17 +290,17 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
}
switch (indexPath.row) {
case kHeaderSectionNewGroup:
cell.labelTitle.text = @"Group conversation";
cell.labelTitle.accessibilityLabel = @"Create a new group conversation";
cell.labelTitle.accessibilityHint = @"Double tap to start creating a new group conversation";
cell.labelTitle.text = NSLocalizedString(@"Group conversation", nil);
cell.labelTitle.accessibilityLabel = NSLocalizedString(@"Create a new group conversation", nil);
cell.labelTitle.accessibilityHint = NSLocalizedString(@"Double tap to start creating a new group conversation", nil);
cell.labelTitle.textColor = [UIColor colorWithRed:0.00 green:0.48 blue:1.00 alpha:1.0]; //#007AFF
[cell.contactImage setImage:[UIImage imageNamed:@"group-bg"]];
break;
case kHeaderSectionNewPublic:
cell.labelTitle.text = @"Public conversation";
cell.labelTitle.accessibilityLabel = @"Create a new public conversation";
cell.labelTitle.accessibilityHint = @"Double tap to start creating a new public conversation";
cell.labelTitle.text = NSLocalizedString(@"Public conversation", nil);
cell.labelTitle.accessibilityLabel = NSLocalizedString(@"Create a new public conversation", nil);
cell.labelTitle.accessibilityHint = NSLocalizedString(@"Double tap to start creating a new public conversation", nil);
cell.labelTitle.textColor = [UIColor colorWithRed:0.00 green:0.48 blue:1.00 alpha:1.0]; //#007AFF
[cell.contactImage setImage:[UIImage imageNamed:@"public-bg"]];
break;
@ -319,8 +319,8 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
}
cell.labelTitle.text = contact.name;
cell.labelTitle.accessibilityLabel = [NSString stringWithFormat:@"Create a conversation with %@", contact.name];
cell.labelTitle.accessibilityHint = [NSString stringWithFormat:@"Double tap to create a conversation with %@", contact.name];
cell.labelTitle.accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"Create a conversation with %@", nil), contact.name];
cell.labelTitle.accessibilityHint = [NSString stringWithFormat:NSLocalizedString(@"Double tap to create a conversation with %@", nil), contact.name];
[cell.contactImage setImageWithURLRequest:[[NCAPIController sharedInstance] createAvatarRequestForUser:contact.userId andSize:96 usingAccount:[[NCDatabaseManager sharedInstance] activeAccount]]
placeholderImage:nil success:nil failure:nil];

Просмотреть файл

@ -31,7 +31,7 @@
// Contacts placeholder view
_contactsBackgroundView = [[PlaceholderView alloc] init];
[_contactsBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"contacts-placeholder"]];
[_contactsBackgroundView.placeholderText setText:@"No results found."];
[_contactsBackgroundView.placeholderText setText:NSLocalizedString(@"No results found", nil)];
[self showSearchingUI];
self.tableView.backgroundView = _contactsBackgroundView;
}

Просмотреть файл

@ -64,7 +64,7 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
{
[super viewDidLoad];
self.navigationItem.title = (_publicRoom) ? @"New public conversation" : @"New group conversation";
self.navigationItem.title = (_publicRoom) ? NSLocalizedString(@"New public conversation", nil) : NSLocalizedString(@"New group conversation", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -84,17 +84,17 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
_passwordTextField = [[UITextField alloc] initWithFrame:CGRectMake(180, 10, 115, 30)];
_passwordTextField.textAlignment = NSTextAlignmentRight;
_passwordTextField.placeholder = @"No password";
_passwordTextField.placeholder = NSLocalizedString(@"No password", nil);
_passwordTextField.adjustsFontSizeToFitWidth = YES;
_passwordTextField.textColor = [UIColor blackColor];
_passwordTextField.secureTextEntry = YES;
_passwordTextField.accessibilityLabel = @"Password field for public conversation";
_passwordTextField.accessibilityLabel = NSLocalizedString(@"Password field for public conversation", nil);
_creatingRoomView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
_createRoomButton = [[UIBarButtonItem alloc] initWithTitle:@"Create" style:UIBarButtonItemStyleDone
_createRoomButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Create", nil) style:UIBarButtonItemStyleDone
target:self action:@selector(createButtonPressed)];
_createRoomButton.enabled = NO;
_createRoomButton.accessibilityHint = @"Double tap to create the conversation";
_createRoomButton.accessibilityHint = NSLocalizedString(@"Double tap to create the conversation", nil);
self.navigationItem.rightBarButtonItem = _createRoomButton;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)];
@ -221,11 +221,11 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
self.navigationItem.rightBarButtonItem = _createRoomButton;
UIAlertController * alert = [UIAlertController
alertControllerWithTitle:@"Could not create conversation"
message:[NSString stringWithFormat:@"An error occurred while creating the conversation"]
alertControllerWithTitle:NSLocalizedString(@"Could not create conversation", nil)
message:NSLocalizedString(@"An error occurred while creating the conversation", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* okButton = [UIAlertAction
actionWithTitle:@"OK"
actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil];
[alert addAction:okButton];
@ -300,9 +300,9 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
if (_participants.count == 0) {
return @"";
} else if (_participants.count == 1) {
return @"1 participant";
return NSLocalizedString(@"1 participant", nil);
}
return [NSString stringWithFormat:@"%ld participants", _participants.count];
return [NSString stringWithFormat:NSLocalizedString(@"%ld participants", nil), _participants.count];
}
return nil;
@ -311,9 +311,9 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
if (section == kCreationSectionName) {
return @"Please, set a name for this conversation.";
return NSLocalizedString(@"Please, set a name for this conversation.", nil);
} else if (section == kCreationSectionParticipantsOrPassword && _publicRoom ) {
return @"Anyone who knows the link to this conversation will be able to access it. You can protect it by setting a password.";
return NSLocalizedString(@"Anyone who knows the link to this conversation will be able to access it. You can protect it by setting a password.", nil);
}
return nil;
@ -364,7 +364,7 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:publicCellIdentifier];
}
cell.textLabel.text = @"Password";
cell.textLabel.text = NSLocalizedString(@"Password", nil);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryView = _passwordTextField;
[cell.imageView setImage:[UIImage imageNamed:@"password-settings"]];

Просмотреть файл

@ -107,17 +107,17 @@
// Room creation placeholder view
_roomCreationBackgroundView = [[PlaceholderView alloc] init];
[_roomCreationBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"contacts-placeholder"]];
[_roomCreationBackgroundView.placeholderText setText:@"No participants found."];
[_roomCreationBackgroundView.placeholderText setText:NSLocalizedString(@"No participants found", nil)];
[_roomCreationBackgroundView.placeholderView setHidden:YES];
[_roomCreationBackgroundView.loadingView startAnimating];
self.tableView.backgroundView = _roomCreationBackgroundView;
self.definesPresentationContext = YES;
UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStylePlain
UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Next", nil) style:UIBarButtonItemStylePlain
target:self action:@selector(nextButtonPressed)];
self.navigationItem.rightBarButtonItem = nextButton;
self.navigationItem.rightBarButtonItem.accessibilityHint = @"Continue to next step of conversation creation";
self.navigationItem.rightBarButtonItem.accessibilityHint = NSLocalizedString(@"Continue to next step of conversation creation", nil);
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.00 green:0.51 blue:0.79 alpha:1.0]; //#0082C9
@ -182,16 +182,16 @@
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.textColor = [UIColor whiteColor];
titleLabel.font = [UIFont boldSystemFontOfSize:16];
titleLabel.text = @"New group conversation";
titleLabel.accessibilityLabel = @"Add participants to new group conversation";
titleLabel.text = NSLocalizedString(@"New group conversation", nil);
titleLabel.accessibilityLabel = NSLocalizedString(@"Add participants to new group conversation", nil);
[titleLabel sizeToFit];
UILabel *subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 18, 0, 0)];
subTitleLabel.backgroundColor = [UIColor clearColor];
subTitleLabel.textColor = [UIColor whiteColor];
subTitleLabel.font = [UIFont systemFontOfSize:12];
subTitleLabel.text = (_selectedParticipants.count == 1) ? @"1 participant" : [NSString stringWithFormat:@"%ld participants", _selectedParticipants.count];
subTitleLabel.accessibilityLabel = [NSString stringWithFormat:@"%@ added to this new group conversation", subTitleLabel.text];
subTitleLabel.text = (_selectedParticipants.count == 1) ? NSLocalizedString(@"1 participant", nil) : [NSString stringWithFormat:NSLocalizedString(@"%ld participants", nil), _selectedParticipants.count];
subTitleLabel.accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"%@ added to this new group conversation", nil), subTitleLabel.text];
[subTitleLabel sizeToFit];
UIView *twoLineTitleView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, MAX(subTitleLabel.frame.size.width, titleLabel.frame.size.width), 30)];

Просмотреть файл

@ -107,7 +107,7 @@ typedef enum ModificationError {
{
[super viewDidLoad];
self.navigationItem.title = @"Conversation info";
self.navigationItem.title = NSLocalizedString(@"Conversation info", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -137,7 +137,7 @@ typedef enum ModificationError {
_lobbyDatePicker.datePickerMode = UIDatePickerModeDateAndTime;
_lobbyDateTextField = [[UITextField alloc] initWithFrame:CGRectMake(0, 00, 200, 30)];
_lobbyDateTextField.textAlignment = NSTextAlignmentRight;
_lobbyDateTextField.placeholder = @"Manual";
_lobbyDateTextField.placeholder = NSLocalizedString(@"Manual", nil);
_lobbyDateTextField.adjustsFontSizeToFitWidth = YES;
[_lobbyDateTextField setInputView:_lobbyDatePicker];
[self setupLobbyDatePicker];
@ -145,7 +145,7 @@ typedef enum ModificationError {
_modifyingRoomView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
_headerView = [[HeaderWithButton alloc] init];
[_headerView.button setTitle:@"Add" forState:UIControlStateNormal];
[_headerView.button setTitle:NSLocalizedString(@"Add", nil) forState:UIControlStateNormal];
[_headerView.button addTarget:self action:@selector(addParticipantsButtonPressed) forControlEvents:UIControlEventTouchUpInside];
[self.tableView registerNib:[UINib nibWithNibName:kContactsTableCellNibName bundle:nil] forCellReuseIdentifier:kContactCellIdentifier];
@ -327,47 +327,47 @@ typedef enum ModificationError {
NSString *errorDescription = @"";
switch (error) {
case kModificationErrorRename:
errorDescription = @"Could not rename the conversation";
errorDescription = NSLocalizedString(@"Could not rename the conversation", nil);
break;
case kModificationErrorFavorite:
errorDescription = @"Could not change favorite setting";
errorDescription = NSLocalizedString(@"Could not change favorite setting", nil);
break;
case kModificationErrorNotifications:
errorDescription = @"Could not change notifications setting";
errorDescription = NSLocalizedString(@"Could not change notifications setting", nil);
break;
case kModificationErrorShare:
errorDescription = @"Could not change sharing permissions of the conversation";
errorDescription = NSLocalizedString(@"Could not change sharing permissions of the conversation", nil);
break;
case kModificationErrorPassword:
errorDescription = @"Could not change password protection settings";
errorDescription = NSLocalizedString(@"Could not change password protection settings", nil);
break;
case kModificationErrorLobby:
errorDescription = @"Could not change lobby state of the conversation";
errorDescription = NSLocalizedString(@"Could not change lobby state of the conversation", nil);
break;
case kModificationErrorModeration:
errorDescription = @"Could not change moderation permissions of the participant";
errorDescription = NSLocalizedString(@"Could not change moderation permissions of the participant", nil);
break;
case kModificationErrorRemove:
errorDescription = @"Could not remove participant";
errorDescription = NSLocalizedString(@"Could not remove participant", nil);
break;
case kModificationErrorLeave:
errorDescription = @"Could not leave conversation";
errorDescription = NSLocalizedString(@"Could not leave conversation", nil);
break;
case kModificationErrorLeaveModeration:
errorDescription = @"You need to promote a new moderator before you can leave this conversation";
errorDescription = NSLocalizedString(@"You need to promote a new moderator before you can leave this conversation", nil);
break;
case kModificationErrorDelete:
errorDescription = @"Could not delete conversation";
errorDescription = NSLocalizedString(@"Could not delete conversation", nil);
break;
default:
@ -378,7 +378,7 @@ typedef enum ModificationError {
[UIAlertController alertControllerWithTitle:errorDescription
message:nil
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil];
[renameDialog addAction:okAction];
[self presentViewController:renameDialog animated:YES completion:nil];
}
@ -392,18 +392,18 @@ typedef enum ModificationError {
switch (action) {
case kDestructiveActionLeave:
{
title = @"Leave conversation";
message = @"Do you really want to leave this conversation?";
confirmAction = [UIAlertAction actionWithTitle:@"Leave" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
title = NSLocalizedString(@"Leave conversation", nil);
message = NSLocalizedString(@"Do you really want to leave this conversation?", nil);
confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Leave", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[self leaveRoom];
}];
}
break;
case kDestructiveActionDelete:
{
title = @"Delete conversation";
title = NSLocalizedString(@"Delete conversation", nil);
message = _room.deletionMessage;
confirmAction = [UIAlertAction actionWithTitle:@"Delete" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Delete", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[self deleteRoom];
}];
}
@ -415,7 +415,7 @@ typedef enum ModificationError {
message:message
preferredStyle:UIAlertControllerStyleAlert];
[confirmDialog addAction:confirmAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:cancelAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}
@ -423,13 +423,13 @@ typedef enum ModificationError {
- (void)presentNotificationLevelSelector
{
UIAlertController *optionsActionSheet =
[UIAlertController alertControllerWithTitle:@"Notifications"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Notifications", nil)
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[optionsActionSheet addAction:[self actionForNotificationLevel:kNCRoomNotificationLevelAlways]];
[optionsActionSheet addAction:[self actionForNotificationLevel:kNCRoomNotificationLevelMention]];
[optionsActionSheet addAction:[self actionForNotificationLevel:kNCRoomNotificationLevelNever]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -538,7 +538,7 @@ typedef enum ModificationError {
- (void)showPasswordOptions
{
NSString *alertTitle = _room.hasPassword ? @"Set new password:" : @"Set password:";
NSString *alertTitle = _room.hasPassword ? NSLocalizedString(@"Set new password:", nil) : NSLocalizedString(@"Set password:", nil);
UIAlertController *passwordDialog =
[UIAlertController alertControllerWithTitle:alertTitle
message:nil
@ -546,13 +546,13 @@ typedef enum ModificationError {
__weak typeof(self) weakSelf = self;
[passwordDialog addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
textField.placeholder = @"Password";
textField.placeholder = NSLocalizedString(@"Password", nil);
textField.secureTextEntry = YES;
textField.delegate = weakSelf;
textField.tag = k_set_password_textfield_tag;
}];
NSString *actionTitle = _room.hasPassword ? @"Change password" : @"OK";
NSString *actionTitle = _room.hasPassword ? NSLocalizedString(@"Change password", nil) : NSLocalizedString(@"OK", nil);
_setPasswordAction = [UIAlertAction actionWithTitle:actionTitle style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSString *password = [[passwordDialog textFields][0] text];
NSString *trimmedPassword = [password stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
@ -571,7 +571,7 @@ typedef enum ModificationError {
[passwordDialog addAction:_setPasswordAction];
if (_room.hasPassword) {
UIAlertAction *removePasswordAction = [UIAlertAction actionWithTitle:@"Remove password" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
UIAlertAction *removePasswordAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Remove password", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[self setModifyingRoomUI];
[[NCAPIController sharedInstance] setPassword:@"" toRoom:_room.token forAccount:[[NCDatabaseManager sharedInstance] activeAccount] withCompletionBlock:^(NSError *error) {
if (!error) {
@ -586,7 +586,7 @@ typedef enum ModificationError {
[passwordDialog addAction:removePasswordAction];
}
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[passwordDialog addAction:cancelAction];
[self presentViewController:passwordDialog animated:YES completion:nil];
@ -627,17 +627,16 @@ typedef enum ModificationError {
- (void)shareRoomLinkFromIndexPath:(NSIndexPath *)indexPath
{
TalkAccount *activeAccount = [[NCDatabaseManager sharedInstance] activeAccount];
NSString *shareMessage = [NSString stringWithFormat:@"Join the conversation at %@/index.php/call/%@",
activeAccount.server, _room.token];
NSString *joinConversationString = NSLocalizedString(@"Join the conversation at", nil);
if (_room.name && ![_room.name isEqualToString:@""]) {
shareMessage = [NSString stringWithFormat:@"Join the conversation%@ at %@/index.php/call/%@",
[NSString stringWithFormat:@" \"%@\"", _room.name], activeAccount.server, _room.token];
joinConversationString = [NSString stringWithFormat:NSLocalizedString(@"Join the conversation %@ at", nil), [NSString stringWithFormat:@"\"%@\"", _room.name]];
}
NSString *shareMessage = [NSString stringWithFormat:@"%@ %@/index.php/call/%@", joinConversationString, activeAccount.server, _room.token];
NSArray *items = @[shareMessage];
UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:items applicationActivities:nil];
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
NSString *emailSubject = [NSString stringWithFormat:@"%@ invitation", appDisplayName];
NSString *emailSubject = [NSString stringWithFormat:NSLocalizedString(@"%@ invitation", nil), appDisplayName];
[controller setValue:emailSubject forKey:@"subject"];
// Presentation on iPads
@ -754,7 +753,7 @@ typedef enum ModificationError {
if (_room.lobbyTimer > 0) {
NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:_room.lobbyTimer];
UIBarButtonItem *clearButton = [[UIBarButtonItem alloc] initWithTitle:@"Remove" style:UIBarButtonItemStylePlain target:self action:@selector(removeLobbyDate)];
UIBarButtonItem *clearButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Remove", nil) style:UIBarButtonItemStylePlain target:self action:@selector(removeLobbyDate)];
[clearButton setTintColor:[UIColor redColor]];
[toolBar setItems:[NSArray arrayWithObjects:clearButton, space, doneButton, nil]];
[_lobbyDatePicker setDate:date];
@ -786,7 +785,7 @@ typedef enum ModificationError {
preferredStyle:UIAlertControllerStyleActionSheet];
if (participant.participantType == kNCParticipantTypeModerator) {
UIAlertAction *demoteFromModerator = [UIAlertAction actionWithTitle:@"Demote from moderator"
UIAlertAction *demoteFromModerator = [UIAlertAction actionWithTitle:NSLocalizedString(@"Demote from moderator", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self demoteFromModerator:participant];
@ -794,7 +793,7 @@ typedef enum ModificationError {
[demoteFromModerator setValue:[[UIImage imageNamed:@"rename-action"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[optionsActionSheet addAction:demoteFromModerator];
} else if (participant.participantType == kNCParticipantTypeUser) {
UIAlertAction *promoteToModerator = [UIAlertAction actionWithTitle:@"Promote to moderator"
UIAlertAction *promoteToModerator = [UIAlertAction actionWithTitle:NSLocalizedString(@"Promote to moderator", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self promoteToModerator:participant];
@ -804,7 +803,7 @@ typedef enum ModificationError {
}
// Remove participant
UIAlertAction *removeParticipant = [UIAlertAction actionWithTitle:@"Remove participant"
UIAlertAction *removeParticipant = [UIAlertAction actionWithTitle:NSLocalizedString(@"Remove participant", nil)
style:UIAlertActionStyleDestructive
handler:^void (UIAlertAction *action) {
[self removeParticipant:participant];
@ -813,7 +812,7 @@ typedef enum ModificationError {
[optionsActionSheet addAction:removeParticipant];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -1007,10 +1006,10 @@ typedef enum ModificationError {
RoomInfoSection infoSection = [[sections objectAtIndex:section] intValue];
switch (infoSection) {
case kRoomInfoSectionPublic:
return @"Guests";
return NSLocalizedString(@"Guests", nil);
break;
case kRoomInfoSectionWebinar:
return @"Webinar";
return NSLocalizedString(@"Webinar", nil);
break;
default:
break;
@ -1026,9 +1025,9 @@ typedef enum ModificationError {
switch (infoSection) {
case kRoomInfoSectionParticipants:
{
NSString *title = [NSString stringWithFormat:@"%lu participants", (unsigned long)_roomParticipants.count];
NSString *title = [NSString stringWithFormat:NSLocalizedString(@"%lu participants", nil), (unsigned long)_roomParticipants.count];
if (_roomParticipants.count == 1) {
title = @"1 participant";
title = NSLocalizedString(@"1 participant", nil);
}
_headerView.label.text = [title uppercaseString];
_headerView.button.hidden = (_room.canModerate) ? NO : YES;
@ -1163,7 +1162,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:notificationLevelCellIdentifier];
}
cell.textLabel.text = @"Notifications";
cell.textLabel.text = NSLocalizedString(@"Notifications", nil);
cell.detailTextLabel.text = _room.notificationLevelString;
[cell.imageView setImage:[UIImage imageNamed:@"notifications-settings"]];
@ -1177,7 +1176,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:sendLinkCellIdentifier];
}
cell.textLabel.text = @"Send conversation link";
cell.textLabel.text = NSLocalizedString(@"Send conversation link", nil);
[cell.imageView setImage:[UIImage imageNamed:@"share-settings"]];
return cell;
@ -1198,7 +1197,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:shareLinkCellIdentifier];
}
cell.textLabel.text = @"Share link";
cell.textLabel.text = NSLocalizedString(@"Share link", nil);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryView = _publicSwtich;
_publicSwtich.on = (_room.type == kNCRoomTypePublic) ? YES : NO;
@ -1215,7 +1214,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:passwordCellIdentifier];
}
cell.textLabel.text = (_room.hasPassword) ? @"Change password" : @"Set password";
cell.textLabel.text = (_room.hasPassword) ? NSLocalizedString(@"Change password", nil) : NSLocalizedString(@"Set password", nil);
[cell.imageView setImage:(_room.hasPassword) ? [UIImage imageNamed:@"password-settings"] : [UIImage imageNamed:@"no-password-settings"]];
return cell;
@ -1236,7 +1235,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:lobbyCellIdentifier];
}
cell.textLabel.text = @"Lobby";
cell.textLabel.text = NSLocalizedString(@"Lobby", nil);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryView = _lobbySwtich;
_lobbySwtich.on = (_room.lobbyState == NCRoomLobbyStateModeratorsOnly) ? YES : NO;
@ -1252,7 +1251,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:lobbyTimerCellIdentifier];
}
cell.textLabel.text = @"Start time";
cell.textLabel.text = NSLocalizedString(@"Start time", nil);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryView = _lobbyDateTextField;
NSDate *date = [[NSDate alloc] initWithTimeIntervalSince1970:_room.lobbyTimer];
@ -1280,7 +1279,7 @@ typedef enum ModificationError {
if (participant.participantType == kNCParticipantTypeGuest) {
UIColor *guestAvatarColor = [UIColor colorWithRed:0.84 green:0.84 blue:0.84 alpha:1.0]; /*#d5d5d5*/
NSString *avatarName = ([participant.displayName isEqualToString:@""]) ? @"?" : participant.displayName;
NSString *guestName = ([participant.displayName isEqualToString:@""]) ? @"Guest" : participant.displayName;
NSString *guestName = ([participant.displayName isEqualToString:@""]) ? NSLocalizedString(@"Guest", nil) : participant.displayName;
cell.labelTitle.text = guestName;
[cell.contactImage setImageWithString:avatarName color:guestAvatarColor circular:true];
} else {
@ -1323,7 +1322,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:leaveRoomCellIdentifier];
}
cell.textLabel.text = @"Leave conversation";
cell.textLabel.text = NSLocalizedString(@"Leave conversation", nil);
cell.textLabel.textColor = [UIColor colorWithRed:1.00 green:0.23 blue:0.19 alpha:1.0]; //#FF3B30
[cell.imageView setImage:[UIImage imageNamed:@"exit-action"]];
@ -1337,7 +1336,7 @@ typedef enum ModificationError {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:deleteRoomCellIdentifier];
}
cell.textLabel.text = @"Delete conversation";
cell.textLabel.text = NSLocalizedString(@"Delete conversation", nil);
cell.textLabel.textColor = [UIColor colorWithRed:1.00 green:0.23 blue:0.19 alpha:1.0]; //#FF3B30
[cell.imageView setImage:[UIImage imageNamed:@"delete-action"]];

Просмотреть файл

@ -34,7 +34,7 @@
// Contacts placeholder view
_roomSearchBackgroundView = [[PlaceholderView alloc] init];
[_roomSearchBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"conversations-placeholder"]];
[_roomSearchBackgroundView.placeholderText setText:@"No results found."];
[_roomSearchBackgroundView.placeholderText setText:NSLocalizedString(@"No results found", nil)];
[_roomSearchBackgroundView.placeholderView setHidden:YES];
[_roomSearchBackgroundView.loadingView startAnimating];
self.tableView.backgroundView = _roomSearchBackgroundView;
@ -61,7 +61,7 @@
if ([date isToday]) {
[formatter setDateFormat:@"HH:mm"];
} else if ([date isYesterday]) {
return @"Yesterday";
return NSLocalizedString(@"Yesterday", nil);
} else {
[formatter setDateFormat:@"dd/MM/yy"];
}

Просмотреть файл

@ -68,8 +68,8 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
// Align header's title to ContactsTableViewCell's label
self.tableView.separatorInset = UIEdgeInsetsMake(0, 72, 0, 0);
self.addButton.accessibilityLabel = @"Create a new conversation";
self.addButton.accessibilityHint = @"Double tap to create group, public or one to one conversations.";
self.addButton.accessibilityLabel = NSLocalizedString(@"Create a new conversation", nil);
self.addButton.accessibilityHint = NSLocalizedString(@"Double tap to create group, public or one to one conversations.", nil);
[self createRefreshControl];
[self setNavigationLogoButton];
@ -132,7 +132,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
// Rooms placeholder view
_roomsBackgroundView = [[PlaceholderView alloc] init];
[_roomsBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"conversations-placeholder"]];
[_roomsBackgroundView.placeholderText setText:@"You are not part of any conversation. Press + to start a new one."];
[_roomsBackgroundView.placeholderText setText:NSLocalizedString(@"You are not part of any conversation. Press + to start a new one.", nil)];
[_roomsBackgroundView.placeholderView setHidden:YES];
[_roomsBackgroundView.loadingView startAnimating];
self.tableView.backgroundView = _roomsBackgroundView;
@ -276,7 +276,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:logoImage];
}
self.navigationItem.titleView.accessibilityLabel = @"Nextcloud Talk";
self.navigationItem.titleView.accessibilityHint = @"Double tap to change accounts or add a new one.";
self.navigationItem.titleView.accessibilityHint = NSLocalizedString(@"Double tap to change accounts or add a new one.", nil);
}
-(void)showAccountsMenu:(UIButton*)sender
@ -292,7 +292,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
[menuArray addObject:accountModel];
[actionsArray addObject:account];
}
FTPopOverMenuModel *addAccountModel = [[FTPopOverMenuModel alloc] initWithTitle:@"Add account" image:[UIImage imageNamed:@"add-settings"] selected:NO accessoryView:nil];
FTPopOverMenuModel *addAccountModel = [[FTPopOverMenuModel alloc] initWithTitle:NSLocalizedString(@"Add account", nil) image:[UIImage imageNamed:@"add-settings"] selected:NO accessoryView:nil];
[menuArray addObject:addAccountModel];
[actionsArray addObject:@"AddAccountAction"];
@ -431,8 +431,8 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
UIButton *profileButton = [UIButton buttonWithType:UIButtonTypeCustom];
[profileButton addTarget:self action:@selector(showUserProfile) forControlEvents:UIControlEventTouchUpInside];
profileButton.frame = CGRectMake(0, 0, 30, 30);
profileButton.accessibilityLabel = @"User profile and settings";
profileButton.accessibilityHint = @"Double tap to go to user profile and application settings";
profileButton.accessibilityLabel = NSLocalizedString(@"User profile and settings", nil);
profileButton.accessibilityHint = NSLocalizedString(@"Double tap to go to user profile and application settings", nil);
TalkAccount *activeAccount = [[NCDatabaseManager sharedInstance] activeAccount];
UIImage *profileImage = [[NCAPIController sharedInstance] userProfileImageForAccount:activeAccount withSize:CGSizeMake(90, 90)];
@ -493,13 +493,13 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
}
UIAlertController *optionsActionSheet =
[UIAlertController alertControllerWithTitle:@"Notifications"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Notifications", nil)
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[optionsActionSheet addAction:[self actionForNotificationLevel:kNCRoomNotificationLevelAlways forRoom:room]];
[optionsActionSheet addAction:[self actionForNotificationLevel:kNCRoomNotificationLevelMention forRoom:room]];
[optionsActionSheet addAction:[self actionForNotificationLevel:kNCRoomNotificationLevelNever forRoom:room]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -537,17 +537,16 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
}
TalkAccount *activeAccount = [[NCDatabaseManager sharedInstance] activeAccount];
NSString *shareMessage = [NSString stringWithFormat:@"Join the conversation at %@/index.php/call/%@",
activeAccount.server, room.token];
NSString *joinConversationString = NSLocalizedString(@"Join the conversation at", nil);
if (room.name && ![room.name isEqualToString:@""]) {
shareMessage = [NSString stringWithFormat:@"Join the conversation%@ at %@/index.php/call/%@",
[NSString stringWithFormat:@" \"%@\"", room.name], activeAccount.server, room.token];
joinConversationString = [NSString stringWithFormat:NSLocalizedString(@"Join the conversation %@ at", nil), [NSString stringWithFormat:@"\"%@\"", room.name]];
}
NSString *shareMessage = [NSString stringWithFormat:@"%@ %@/index.php/call/%@", joinConversationString, activeAccount.server, room.token];
NSArray *items = @[shareMessage];
UIActivityViewController *controller = [[UIActivityViewController alloc]initWithActivityItems:items applicationActivities:nil];
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
NSString *emailSubject = [NSString stringWithFormat:@"%@ invitation", appDisplayName];
NSString *emailSubject = [NSString stringWithFormat:NSLocalizedString(@"%@ invitation", nil), appDisplayName];
[controller setValue:emailSubject forKey:@"subject"];
// Presentation on iPads
@ -616,10 +615,10 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
}
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:@"Leave conversation"
message:@"Do you really want to leave this conversation?"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Leave conversation", nil)
message:NSLocalizedString(@"Do you really want to leave this conversation?", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"Leave" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Leave", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[_rooms removeObjectAtIndex:indexPath.row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[[NCAPIController sharedInstance] removeSelfFromRoom:room.token forAccount:[[NCDatabaseManager sharedInstance] activeAccount] withCompletionBlock:^(NSInteger errorCode, NSError *error) {
@ -632,7 +631,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
}];
}];
[confirmDialog addAction:confirmAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:cancelAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}
@ -645,10 +644,10 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
}
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:@"Delete conversation"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Delete conversation", nil)
message:room.deletionMessage
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:@"Delete" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
UIAlertAction *confirmAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Delete", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
[_rooms removeObjectAtIndex:indexPath.row];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[[NCAPIController sharedInstance] deleteRoom:room.token forAccount:[[NCDatabaseManager sharedInstance] activeAccount] withCompletionBlock:^(NSError *error) {
@ -659,7 +658,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
}];
}];
[confirmDialog addAction:confirmAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:cancelAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}
@ -677,7 +676,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
preferredStyle:UIAlertControllerStyleActionSheet];
// Add/Remove room to/from favorites
UIAlertAction *favoriteAction = [UIAlertAction actionWithTitle:(room.isFavorite) ? @"Remove from favorites" : @"Add to favorites"
UIAlertAction *favoriteAction = [UIAlertAction actionWithTitle:(room.isFavorite) ? NSLocalizedString(@"Remove from favorites", nil) : NSLocalizedString(@"Add to favorites", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
if (room.isFavorite) {
@ -691,7 +690,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
[optionsActionSheet addAction:favoriteAction];
// Notification levels
if ([[NCSettingsController sharedInstance] serverHasTalkCapability:kCapabilityNotificationLevels]) {
UIAlertAction *notificationsAction = [UIAlertAction actionWithTitle:[NSString stringWithFormat:@"Notifications: %@", room.notificationLevelString]
UIAlertAction *notificationsAction = [UIAlertAction actionWithTitle:[NSString stringWithFormat:NSLocalizedString(@"Notifications: %@", nil), room.notificationLevelString]
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self setNotificationLevelForRoomAtIndexPath:indexPath];
@ -702,7 +701,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
// Share link
if (room.isPublic) {
// Share Link
UIAlertAction *shareLinkAction = [UIAlertAction actionWithTitle:@"Share conversation link"
UIAlertAction *shareLinkAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Share conversation link", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self shareLinkFromRoomAtIndexPath:indexPath];
@ -711,7 +710,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
[optionsActionSheet addAction:shareLinkAction];
}
// Room info
UIAlertAction *roomInfoAction = [UIAlertAction actionWithTitle:@"Conversation info"
UIAlertAction *roomInfoAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Conversation info", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self presentRoomInfoForRoomAtIndexPath:indexPath];
@ -719,7 +718,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
[roomInfoAction setValue:[[UIImage imageNamed:@"room-info-action"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[optionsActionSheet addAction:roomInfoAction];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -747,7 +746,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
if ([date isToday]) {
[formatter setDateFormat:@"HH:mm"];
} else if ([date isYesterday]) {
return @"Yesterday";
return NSLocalizedString(@"Yesterday", nil);
} else {
[formatter setDateFormat:@"dd/MM/yy"];
}
@ -757,11 +756,11 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
- (void)showLeaveRoomLastModeratorErrorForRoom:(NCRoom *)room
{
UIAlertController *leaveRoomFailedDialog =
[UIAlertController alertControllerWithTitle:@"Could not leave conversation"
message:[NSString stringWithFormat:@"You need to promote a new moderator before you can leave %@.", room.displayName]
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Could not leave conversation", nil)
message:[NSString stringWithFormat:NSLocalizedString(@"You need to promote a new moderator before you can leave %@.", nil), room.displayName]
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:nil];
[leaveRoomFailedDialog addAction:okAction];
[self presentViewController:leaveRoomFailedDialog animated:YES completion:nil];
@ -791,7 +790,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"More";
return NSLocalizedString(@"More", nil);
}
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath
@ -806,9 +805,9 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
room = [_resultTableViewController.rooms objectAtIndex:indexPath.row];
}
NSString *deleteButtonText = @"Delete";
NSString *deleteButtonText = NSLocalizedString(@"Delete", nil);
if (room.isLeavable) {
deleteButtonText = @"Leave";
deleteButtonText = NSLocalizedString(@"Leave", nil);
}
return deleteButtonText;
}

Просмотреть файл

@ -31,7 +31,7 @@
// Contacts placeholder view
_contactsBackgroundView = [[PlaceholderView alloc] init];
[_contactsBackgroundView.placeholderImage setImage:[UIImage imageNamed:@"contacts-placeholder"]];
[_contactsBackgroundView.placeholderText setText:@"No results found."];
[_contactsBackgroundView.placeholderText setText:NSLocalizedString(@"No results found", nil)];
[self showSearchingUI];
self.tableView.backgroundView = _contactsBackgroundView;
}

Просмотреть файл

@ -65,7 +65,7 @@ typedef enum AboutSection {
{
[super viewDidLoad];
self.navigationItem.title = @"Profile";
self.navigationItem.title = NSLocalizedString(@"Profile", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -202,11 +202,11 @@ typedef enum AboutSection {
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
NSString *actionTitle = (multiAccountEnabled) ? @"Remove account" : @"Log out";
NSString *actionTitle = (multiAccountEnabled) ? NSLocalizedString(@"Remove account", nil) : NSLocalizedString(@"Log out", nil);
UIImage *actionImage = (multiAccountEnabled) ? [UIImage imageNamed:@"delete-action"] : [UIImage imageNamed:@"logout"];
if (multiAccountEnabled) {
UIAlertAction *addAccountAction = [UIAlertAction actionWithTitle:@"Add account"
UIAlertAction *addAccountAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Add account", nil)
style:UIAlertActionStyleDefault
handler:^void (UIAlertAction *action) {
[self addNewAccount];
@ -222,7 +222,7 @@ typedef enum AboutSection {
}];
[logOutAction setValue:[actionImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[optionsActionSheet addAction:logOutAction];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -240,9 +240,9 @@ typedef enum AboutSection {
- (void)showLogoutConfirmationDialog
{
NSString *alertTitle = (multiAccountEnabled) ? @"Remove account" : @"Log out";
NSString *alertMessage = (multiAccountEnabled) ? @"Do you really want to remove this account?" : @"Do you really want to log out from this account?";
NSString *actionTitle = (multiAccountEnabled) ? @"Remove" : @"Log out";
NSString *alertTitle = (multiAccountEnabled) ? NSLocalizedString(@"Remove account", nil) : NSLocalizedString(@"Log out", nil);
NSString *alertMessage = (multiAccountEnabled) ? NSLocalizedString(@"Do you really want to remove this account?", nil) : NSLocalizedString(@"Do you really want to log out from this account?", nil);
NSString *actionTitle = (multiAccountEnabled) ? NSLocalizedString(@"Remove", nil) : NSLocalizedString(@"Log out", nil);
UIAlertController *confirmDialog =
[UIAlertController alertControllerWithTitle:alertTitle
@ -252,7 +252,7 @@ typedef enum AboutSection {
[self logout];
}];
[confirmDialog addAction:confirmAction];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil];
[confirmDialog addAction:cancelAction];
[self presentViewController:confirmDialog animated:YES completion:nil];
}
@ -308,7 +308,7 @@ typedef enum AboutSection {
[userStatusActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[userStatusActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
userStatusActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -333,7 +333,7 @@ typedef enum AboutSection {
NSArray *videoResolutions = [[[NCSettingsController sharedInstance] videoSettingsModel] availableVideoResolutions];
NSString *storedResolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
UIAlertController *optionsActionSheet =
[UIAlertController alertControllerWithTitle:@"Video quality"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Video quality", nil)
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
@ -355,7 +355,7 @@ typedef enum AboutSection {
[optionsActionSheet addAction:action];
}
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -370,7 +370,7 @@ typedef enum AboutSection {
NSArray *supportedBrowsers = [[NCSettingsController sharedInstance] supportedBrowsers];
NSString *defaultBrowser = [[NCSettingsController sharedInstance] defaultBrowser];
UIAlertController *optionsActionSheet =
[UIAlertController alertControllerWithTitle:@"Open links in"
[UIAlertController alertControllerWithTitle:NSLocalizedString(@"Open links in", nil)
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
@ -391,7 +391,7 @@ typedef enum AboutSection {
[optionsActionSheet addAction:action];
}
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[optionsActionSheet addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleCancel handler:nil]];
// Presentation on iPads
optionsActionSheet.popoverPresentationController.sourceView = self.tableView;
@ -461,23 +461,23 @@ typedef enum AboutSection {
SettingsSection settingsSection = [[sections objectAtIndex:section] intValue];
switch (settingsSection) {
case kSettingsSectionUserStatus:
return @"Status";
return NSLocalizedString(@"Status", nil);
break;
case kSettingsSectionAccounts:
return @"Accounts";
return NSLocalizedString(@"Accounts", nil);
break;
case kSettingsSectionConfiguration:
return @"Configuration";
return NSLocalizedString(@"Configuration", nil);
break;
case kSettingsSectionLock:
return @"Lock";
return NSLocalizedString(@"Lock", nil);
break;
case kSettingsSectionAbout:
return @"About";
return NSLocalizedString(@"About", nil);
break;
default:
@ -498,7 +498,7 @@ typedef enum AboutSection {
return [NSString stringWithFormat:@"%@ %@ %@", appName, appVersion, copyright];
}
if (settingsSection == kSettingsSectionUserStatus && [_activeUserStatus.status isEqualToString:kUserStatusDND]) {
return @"All notifications are muted";
return NSLocalizedString(@"All notifications are muted", nil);
}
return nil;
@ -542,7 +542,7 @@ typedef enum AboutSection {
cell.textLabel.text = [_activeUserStatus readableUserStatus];
[cell.imageView setImage:[UIImage imageNamed:[_activeUserStatus userStatusImageNameOfSize:24]]];
} else {
cell.textLabel.text = @"Fetching status…";
cell.textLabel.text = NSLocalizedString(@"Fetching status…", nil);
}
}
break;
@ -576,7 +576,7 @@ typedef enum AboutSection {
cell = [tableView dequeueReusableCellWithIdentifier:videoConfigurationCellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:videoConfigurationCellIdentifier];
cell.textLabel.text = @"Video quality";
cell.textLabel.text = NSLocalizedString(@"Video quality", nil);
[cell.imageView setImage:[UIImage imageNamed:@"videocall-settings"]];
}
NSString *resolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
@ -588,7 +588,7 @@ typedef enum AboutSection {
cell = [tableView dequeueReusableCellWithIdentifier:browserConfigurationCellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:browserConfigurationCellIdentifier];
cell.textLabel.text = @"Open links in";
cell.textLabel.text = NSLocalizedString(@"Open links in", nil);
cell.imageView.contentMode = UIViewContentModeCenter;
[cell.imageView setImage:[UIImage imageNamed:@"browser-settings"]];
}
@ -609,15 +609,15 @@ typedef enum AboutSection {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:lockOnCellIdentifier];
}
cell.textLabel.text = @"Lock screen";
cell.textLabel.text = NSLocalizedString(@"Lock screen", nil);
if ([[[NCSettingsController sharedInstance] lockScreenPasscode] length] > 0) {
cell.imageView.image = [UIImage imageNamed:@"password-settings"];
cell.detailTextLabel.text = @"On";
cell.detailTextLabel.text = NSLocalizedString(@"On", nil);
}
else {
cell.imageView.image = [UIImage imageNamed:@"no-password-settings"];
cell.detailTextLabel.text = @"Off";
cell.detailTextLabel.text = NSLocalizedString(@"Off", nil);
}
}
break;
@ -626,14 +626,14 @@ typedef enum AboutSection {
cell = [tableView dequeueReusableCellWithIdentifier:lockUseSimplyCellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:lockUseSimplyCellIdentifier];
cell.textLabel.text = @"Password type";
cell.textLabel.text = NSLocalizedString(@"Password type", nil);
cell.imageView.image = [UIImage imageNamed:@"key"];
}
if ([[NCSettingsController sharedInstance] lockScreenPasscodeType] == NCPasscodeTypeSimple) {
cell.detailTextLabel.text = @"Simple";
cell.detailTextLabel.text = NSLocalizedString(@"Simple", nil);
} else {
cell.detailTextLabel.text = @"Strong";
cell.detailTextLabel.text = NSLocalizedString(@"Strong", nil);
}
}
@ -650,7 +650,7 @@ typedef enum AboutSection {
cell = [tableView dequeueReusableCellWithIdentifier:privacyCellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:privacyCellIdentifier];
cell.textLabel.text = @"Privacy";
cell.textLabel.text = NSLocalizedString(@"Privacy", nil);
[cell.imageView setImage:[UIImage imageNamed:@"privacy"]];
}
}
@ -660,7 +660,7 @@ typedef enum AboutSection {
cell = [tableView dequeueReusableCellWithIdentifier:sourceCodeCellIdentifier];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:sourceCodeCellIdentifier];
cell.textLabel.text = @"Get source code";
cell.textLabel.text = NSLocalizedString(@"Get source code", nil);
[cell.imageView setImage:[UIImage imageNamed:@"github"]];
}
}
@ -859,10 +859,10 @@ typedef enum AboutSection {
}
BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:@"com.nextcloud.Talk"];
touchIDManager.promptText = @"Scan fingerprint to authenticate";
touchIDManager.promptText = NSLocalizedString(@"Scan fingerprint to authenticate", nil);
viewController.touchIDManager = touchIDManager;
viewController.title = @"Activating lock screen";
viewController.title = NSLocalizedString(@"Activating lock screen", nil);
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
@ -886,10 +886,10 @@ typedef enum AboutSection {
}
BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:@"com.nextcloud.Talk"];
touchIDManager.promptText = @"Scan fingerprint to authenticate";
touchIDManager.promptText = NSLocalizedString(@"Scan fingerprint to authenticate", nil);
viewController.touchIDManager = touchIDManager;
viewController.title = @"Removing lock screen";
viewController.title = NSLocalizedString(@"Removing lock screen", nil);
viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];

Просмотреть файл

@ -27,7 +27,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Resolutions";
self.navigationItem.title = NSLocalizedString(@"Resolutions", nil);
_videoResolutions = [[[NCSettingsController sharedInstance] videoSettingsModel] availableVideoResolutions];
}

Просмотреть файл

@ -36,7 +36,7 @@ typedef enum VideoSettingsSection {
{
[super viewDidLoad];
self.navigationItem.title = @"Video calls";
self.navigationItem.title = NSLocalizedString(@"Video calls", nil);
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
@ -74,11 +74,11 @@ typedef enum VideoSettingsSection {
{
switch (section) {
case kVideoSettingsSectionResolution:
return @"Quality";
return NSLocalizedString(@"Quality", nil);
break;
case kVideoSettingsSectionDefaultVideo:
return @"Settings";
return NSLocalizedString(@"Settings", nil);
break;
}
@ -98,7 +98,7 @@ typedef enum VideoSettingsSection {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kVideoResolutionCellIdentifier];
}
cell.textLabel.text = @"Video resolution";
cell.textLabel.text = NSLocalizedString(@"Video resolution", nil);
NSString *resolution = [[[NCSettingsController sharedInstance] videoSettingsModel] currentVideoResolutionSettingFromStore];
cell.detailTextLabel.text = [[[NCSettingsController sharedInstance] videoSettingsModel] readableResolution:resolution];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@ -111,7 +111,7 @@ typedef enum VideoSettingsSection {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kDefaultVideoToggleCellIdentifier];
}
cell.textLabel.text = @"Video disabled on start";
cell.textLabel.text = NSLocalizedString(@"Video disabled on start", nil);
cell.selectionStyle = UITableViewCellSelectionStyleNone;
BOOL videoDisabled = [[[NCSettingsController sharedInstance] videoSettingsModel] videoDisabledSettingFromStore];
[_videoDisabledSwitch setOn:videoDisabled];