From e15432720c280febc3852ab4b0fe8dd05a458704 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 10 Jul 2017 18:44:46 -0400 Subject: [PATCH] Add arabic translation; begin work on right-to-left layout. // FREEBIE --- Signal.xcodeproj/project.pbxproj | 3 +++ Signal/src/views/ContactTableViewCell.m | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index f9b5b64d7..492969682 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -425,6 +425,7 @@ 3472229E1EB22FFE00E53955 /* AddToGroupViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddToGroupViewController.m; sourceTree = ""; }; 348F2EAD1F0D21BC00D4ECE0 /* DeviceSleepManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceSleepManager.swift; sourceTree = ""; }; 3495BC8F1F1400FF00B478F5 /* OWSAsserts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSAsserts.swift; sourceTree = ""; }; + 3495BC911F1426B800B478F5 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = translations/ar.lproj/Localizable.strings; sourceTree = ""; }; 3497DBEA1ECE257500DB2605 /* OWSCountryMetadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSCountryMetadata.h; sourceTree = ""; }; 3497DBEB1ECE257500DB2605 /* OWSCountryMetadata.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSCountryMetadata.m; sourceTree = ""; }; 3497DBED1ECE2E4700DB2605 /* DomainFrontingCountryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DomainFrontingCountryViewController.h; sourceTree = ""; }; @@ -1869,6 +1870,7 @@ sq, bg, Base, + ar, ); mainGroup = D221A07E169C9E5E00537ABF; productRefGroup = D221A08A169C9E5E00537ABF /* Products */; @@ -2414,6 +2416,7 @@ 454B35071D08EED80026D658 /* mk */, 4597E94E1D8313C100040CDE /* sq */, 4597E94F1D8313CB00040CDE /* bg */, + 3495BC911F1426B800B478F5 /* ar */, ); name = Localizable.strings; sourceTree = ""; diff --git a/Signal/src/views/ContactTableViewCell.m b/Signal/src/views/ContactTableViewCell.m index 8dcb421bc..de7b099ff 100644 --- a/Signal/src/views/ContactTableViewCell.m +++ b/Signal/src/views/ContactTableViewCell.m @@ -54,24 +54,26 @@ const NSUInteger kContactTableViewCellAvatarSize = 40; - (void)configureProgrammatically { + self.preservesSuperviewLayoutMargins = YES; + self.contentView.preservesSuperviewLayoutMargins = YES; + _avatarView = [AvatarImageView new]; [self.contentView addSubview:_avatarView]; _nameLabel = [UILabel new]; - _nameLabel.contentMode = UIViewContentModeLeft; _nameLabel.lineBreakMode = NSLineBreakByTruncatingTail; _nameLabel.font = [UIFont ows_dynamicTypeBodyFont]; [self.contentView addSubview:_nameLabel]; [_avatarView autoVCenterInSuperview]; - [_avatarView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:ScaleFromIPhone5To7Plus(14.f, 20.f)]; + [_avatarView.leadingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.leadingAnchor].active = YES; [_avatarView autoSetDimension:ALDimensionWidth toSize:kContactTableViewCellAvatarSize]; [_avatarView autoSetDimension:ALDimensionHeight toSize:kContactTableViewCellAvatarSize]; - [_nameLabel autoPinEdgeToSuperviewEdge:ALEdgeRight]; [_nameLabel autoPinEdgeToSuperviewEdge:ALEdgeTop]; [_nameLabel autoPinEdgeToSuperviewEdge:ALEdgeBottom]; - [_nameLabel autoPinEdge:ALEdgeLeft toEdge:ALEdgeRight ofView:_avatarView withOffset:12.f]; + [_nameLabel.leadingAnchor constraintEqualToAnchor:_avatarView.trailingAnchor constant:12.f].active = YES; + [_nameLabel.trailingAnchor constraintEqualToAnchor:self.contentView.layoutMarginsGuide.trailingAnchor].active = YES; // Force layout, since imageView isn't being initally rendered on App Store optimized build. [self layoutSubviews];