summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@mullvad.net>2025-08-04 14:47:28 +0200
committerJon Petersson <jon.petersson@mullvad.net>2025-08-04 14:47:28 +0200
commitda498cde94770735de2baa37f55f000e7bae5a61 (patch)
treec54d9ef1a6604c2a69d8851a157ee15b1b111958
parent5c3108972e272890c9c31e07b545a66d7227fef9 (diff)
parent0ac35438f3be791d7e17003f3672fba69978b35b (diff)
downloadmullvadvpn-da498cde94770735de2baa37f55f000e7bae5a61.tar.xz
mullvadvpn-da498cde94770735de2baa37f55f000e7bae5a61.zip
Merge branch 'adjust-ui-to-handle-a-pseudo-language-ios-1208'
-rw-r--r--ios/Localizations/AppLanguage.swift11
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideStatusView.swift1
-rw-r--r--ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideViewController.swift3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOffIllustration.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOnIllustration.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/IconBack.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/IconChevron.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/IconReload.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/IconSpinner.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/Supporting Files/Assets.xcassets/MultihopIllustration.imageset/Contents.json3
-rw-r--r--ios/MullvadVPN/View controllers/ChangeLog/BulletPointText.swift4
-rw-r--r--ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift1
-rw-r--r--ios/MullvadVPN/View controllers/Login/LoginContentView.swift1
-rw-r--r--ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift1
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SelectableSettingsCell.swift5
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsCell.swift18
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift2
-rw-r--r--ios/MullvadVPN/View controllers/Tunnel/ConnectionView/HeaderView.swift1
18 files changed, 42 insertions, 27 deletions
diff --git a/ios/Localizations/AppLanguage.swift b/ios/Localizations/AppLanguage.swift
index b299938235..8b1788bd81 100644
--- a/ios/Localizations/AppLanguage.swift
+++ b/ios/Localizations/AppLanguage.swift
@@ -93,15 +93,6 @@ enum AppLanguage: String, CaseIterable, Identifiable {
}
}
- static var allSorted: [AppLanguage] {
- AppLanguage.allCases
- .sorted { $0.displayName.localizedCaseInsensitiveCompare($1.displayName) == .orderedAscending }
- }
-
- static func from(_ code: String) -> AppLanguage {
- AppLanguage(rawValue: code) ?? .english
- }
-
var flagEmoji: String {
let base: UInt32 = 127397
var flagString = ""
@@ -140,6 +131,6 @@ enum AppLanguage: String, CaseIterable, Identifiable {
let locale = Locale(identifier: fullCode)
let langCode = locale.languageCode ?? defaultCode
- return AppLanguage.from(langCode)
+ return AppLanguage(rawValue: langCode) ?? .english
}
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideStatusView.swift b/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideStatusView.swift
index 49bf33e184..ba61d67066 100644
--- a/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideStatusView.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideStatusView.swift
@@ -65,6 +65,7 @@ class IPOverrideStatusView: UIView {
func setStatus(_ status: IPOverrideStatus) {
titleLabel.text = status.title.uppercased()
+ titleLabel.numberOfLines = 0
statusIcon.image = status.icon
descriptionLabel.text = status.description
}
diff --git a/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideViewController.swift b/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideViewController.swift
index ad1f252a18..72f90c18aa 100644
--- a/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideViewController.swift
+++ b/ios/MullvadVPN/Coordinators/Settings/IPOverride/IPOverrideViewController.swift
@@ -142,6 +142,7 @@ class IPOverrideViewController: UIViewController {
value: "Import via text",
comment: ""
), for: .normal)
+ importTextButton.titleLabel?.textAlignment = .center
let importFileButton = AppButton(style: .default)
importFileButton.addTarget(self, action: #selector(didTapImportFileButton), for: .touchUpInside)
@@ -151,7 +152,7 @@ class IPOverrideViewController: UIViewController {
value: "Import file",
comment: ""
), for: .normal)
-
+ importFileButton.titleLabel?.textAlignment = .center
let stackView = UIStackView(arrangedSubviews: [importTextButton, importFileButton])
stackView.distribution = .fillEqually
stackView.spacing = 12
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOffIllustration.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOffIllustration.imageset/Contents.json
index b08fd4512f..2a0ee90ff5 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOffIllustration.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOffIllustration.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "DaitaOffIllustration.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOnIllustration.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOnIllustration.imageset/Contents.json
index 2c526d5886..f8bdf7fbe4 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOnIllustration.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/DaitaOnIllustration.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "DaitaOnIllustration.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconBack.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconBack.imageset/Contents.json
index 3fdd0272f2..95c337ce84 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconBack.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconBack.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "icon-chevron-left-circle.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconChevron.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconChevron.imageset/Contents.json
index 0f9c8bfe26..587cca428f 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconChevron.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconChevron.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "icon-chevron-right.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconReload.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconReload.imageset/Contents.json
index 7b4ca873dd..3198fe006e 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconReload.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconReload.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "icon-reconnect.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconSpinner.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconSpinner.imageset/Contents.json
index d4a87fb733..28a0afd871 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconSpinner.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/IconSpinner.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "spinner.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/Supporting Files/Assets.xcassets/MultihopIllustration.imageset/Contents.json b/ios/MullvadVPN/Supporting Files/Assets.xcassets/MultihopIllustration.imageset/Contents.json
index c5e6c25658..829a1fb31b 100644
--- a/ios/MullvadVPN/Supporting Files/Assets.xcassets/MultihopIllustration.imageset/Contents.json
+++ b/ios/MullvadVPN/Supporting Files/Assets.xcassets/MultihopIllustration.imageset/Contents.json
@@ -2,7 +2,8 @@
"images" : [
{
"filename" : "MultihopIllustration.svg",
- "idiom" : "universal"
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
}
],
"info" : {
diff --git a/ios/MullvadVPN/View controllers/ChangeLog/BulletPointText.swift b/ios/MullvadVPN/View controllers/ChangeLog/BulletPointText.swift
index 93d0b234a7..a6345236a5 100644
--- a/ios/MullvadVPN/View controllers/ChangeLog/BulletPointText.swift
+++ b/ios/MullvadVPN/View controllers/ChangeLog/BulletPointText.swift
@@ -12,7 +12,7 @@ struct BulletPointText: View {
let bullet = "•"
var body: some View {
- HStack(alignment: .firstTextBaseline) {
+ HStack {
Text(bullet)
.font(.body)
.foregroundColor(UIColor.secondaryTextColor.color)
@@ -20,8 +20,6 @@ struct BulletPointText: View {
.font(.body)
.foregroundColor(UIColor.secondaryTextColor.color)
.lineLimit(nil)
- .multilineTextAlignment(.leading)
}
- .frame(maxWidth: .infinity, alignment: .leading)
}
}
diff --git a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
index 3bc8e317bc..b00187d8c9 100644
--- a/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
+++ b/ios/MullvadVPN/View controllers/CreationAccount/Welcome/WelcomeContentView.swift
@@ -82,6 +82,7 @@ final class WelcomeContentView: UIView, Sendable {
label.textColor = .white
label.setContentHuggingPriority(.defaultLow, for: .horizontal)
label.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
+ label.numberOfLines = 0
return label
}()
diff --git a/ios/MullvadVPN/View controllers/Login/LoginContentView.swift b/ios/MullvadVPN/View controllers/Login/LoginContentView.swift
index 23e02d6a41..74c4dd1bc0 100644
--- a/ios/MullvadVPN/View controllers/Login/LoginContentView.swift
+++ b/ios/MullvadVPN/View controllers/Login/LoginContentView.swift
@@ -84,6 +84,7 @@ class LoginContentView: UIView {
value: "Don’t have an account number?",
comment: ""
)
+ textLabel.numberOfLines = 0
return textLabel
}()
diff --git a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift
index a41bdd2187..939e782af8 100644
--- a/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift
+++ b/ios/MullvadVPN/View controllers/ProblemReport/ProblemReportReviewViewController.swift
@@ -63,6 +63,7 @@ class ProblemReportReviewViewController: UIViewController {
textView.font = .mullvadSmall
textView.adjustsFontForContentSizeCategory = true
textView.backgroundColor = .systemBackground
+ textView.textAlignment = .left
view.addConstrainedSubviews([textView]) {
textView.pinEdgesToSuperview(.all().excluding(.top))
diff --git a/ios/MullvadVPN/View controllers/Settings/SelectableSettingsCell.swift b/ios/MullvadVPN/View controllers/Settings/SelectableSettingsCell.swift
index b458219f77..f5196c7655 100644
--- a/ios/MullvadVPN/View controllers/Settings/SelectableSettingsCell.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SelectableSettingsCell.swift
@@ -14,6 +14,11 @@ class SelectableSettingsCell: SettingsCell {
imageView.contentMode = .center
imageView.tintColor = .white
imageView.alpha = 0
+ imageView
+ .setContentCompressionResistancePriority(
+ .required,
+ for: .horizontal
+ )
return imageView
}()
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift b/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
index fe701f7818..0d7097a55b 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsCell.swift
@@ -37,6 +37,15 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
let rightContentContainer = UIView()
var infoButtonHandler: InfoButtonHandler? { didSet {
infoButton.isHidden = infoButtonHandler == nil
+
+ let buttonWidth: CGFloat = 24
+ let buttonAreaWidth = UIMetrics.contentLayoutMargins.leading + UIMetrics
+ .contentLayoutMargins.trailing + 24
+
+ infoButton.widthAnchor
+ .constraint(
+ equalToConstant: infoButton.isHidden ? 0 : buttonAreaWidth
+ ).isActive = true
}}
var disclosureType: SettingsDisclosureType = .none {
@@ -82,7 +91,6 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
}()
private var subCellLeadingIndentation: CGFloat = 0
- private let buttonWidth: CGFloat = 24
private let infoButton: UIButton = {
let button = UIButton(type: .custom)
@@ -115,9 +123,6 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
setLayoutMargins()
- let buttonAreaWidth = UIMetrics.contentLayoutMargins.leading + UIMetrics
- .contentLayoutMargins.trailing + buttonWidth
-
let infoButtonConstraint = infoButton.trailingAnchor.constraint(
greaterThanOrEqualTo: mainContentContainer.trailingAnchor
)
@@ -127,7 +132,11 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
switch style {
case .subtitle:
titleLabel.pinEdgesToSuperview(.init([.top(0), .leading(0)]))
+ titleLabel.trailingAnchor
+ .constraint(lessThanOrEqualTo: mainContentContainer.trailingAnchor)
detailTitleLabel.pinEdgesToSuperview(.all().excluding([.top, .trailing]))
+ detailTitleLabel.trailingAnchor
+ .constraint(lessThanOrEqualTo: mainContentContainer.trailingAnchor)
detailTitleLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor)
infoButtonConstraint
@@ -142,7 +151,6 @@ class SettingsCell: UITableViewCell, CustomCellDisclosureHandling {
constant: -UIMetrics.interButtonSpacing
)
infoButton.centerYAnchor.constraint(equalTo: titleLabel.centerYAnchor)
- infoButton.widthAnchor.constraint(equalToConstant: buttonAreaWidth)
}
contentView.addConstrainedSubviews([leftContentContainer, mainContentContainer, rightContentContainer]) {
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift b/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift
index 4ad7da0ee1..91f89e29b1 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsHeaderView.swift
@@ -18,7 +18,7 @@ class SettingsHeaderView: UITableViewHeaderFooterView {
titleLabel.font = .mullvadSmallSemiBold
titleLabel.adjustsFontForContentSizeCategory = true
titleLabel.textColor = UIColor.Cell.titleTextColor
- titleLabel.numberOfLines = 0
+ titleLabel.numberOfLines = 1
return titleLabel
}()
diff --git a/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/HeaderView.swift b/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/HeaderView.swift
index 6b3f3414b0..5f4ceecdaf 100644
--- a/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/HeaderView.swift
+++ b/ios/MullvadVPN/View controllers/Tunnel/ConnectionView/HeaderView.swift
@@ -42,6 +42,7 @@ extension ConnectionView {
.foregroundStyle(UIColor.primaryTextColor.color.opacity(0.6))
.padding(.top, 2)
.accessibilityIdentifier(AccessibilityIdentifier.connectionPanelServerLabel.asString)
+ .multilineTextAlignment(.leading)
}
}