Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include app name in default session display name #227

Merged
merged 3 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
"login_tablet_device" = "Tablet";

"a11y_all_chats_user_avatar_menu" = "User menu";

// Parameter is the application display name (e.g. "ElementX")
"default_session_display_name" = "%@ iOS";
1 change: 1 addition & 0 deletions ElementX/Sources/Generated/InfoPlist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal enum ElementInfoPlist {
private static let _document = PlistDocument(path: "Info.plist")

internal static let cfBundleDevelopmentRegion: String = _document["CFBundleDevelopmentRegion"]
internal static let cfBundleDisplayName: String = _document["CFBundleDisplayName"]
internal static let cfBundleExecutable: String = _document["CFBundleExecutable"]
internal static let cfBundleIdentifier: String = _document["CFBundleIdentifier"]
internal static let cfBundleInfoDictionaryVersion: String = _document["CFBundleInfoDictionaryVersion"]
Expand Down
4 changes: 4 additions & 0 deletions ElementX/Sources/Generated/Strings+Untranslated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ extension ElementL10n {
public static let actionConfirm = ElementL10n.tr("Untranslated", "action_confirm")
/// Match
public static let actionMatch = ElementL10n.tr("Untranslated", "action_match")
/// %@ iOS
public static func defaultSessionDisplayName(_ p1: Any) -> String {
return ElementL10n.tr("Untranslated", "default_session_display_name", String(describing: p1))
}
/// Mobile
public static let loginMobileDevice = ElementL10n.tr("Untranslated", "login_mobile_device")
/// Tablet
Expand Down
3 changes: 1 addition & 2 deletions ElementX/Sources/Other/Extensions/UIDevice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ extension UIDevice {
}

var initialDisplayName: String {
let string = isPhone ? ElementL10n.loginMobileDevice : ElementL10n.loginTabletDevice
return "X \(string)"
ElementL10n.defaultSessionDisplayName(ElementInfoPlist.cfBundleDisplayName)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ struct AnalyticsPromptStrings {
init() {
// Create the opt in content with a placeholder.
let linkPlaceholder = "{link}"
var optInContent = AttributedString(ElementL10n.analyticsOptInContent(ElementInfoPlist.cfBundleName, linkPlaceholder))
var optInContent = AttributedString(ElementL10n.analyticsOptInContent(ElementInfoPlist.cfBundleDisplayName, linkPlaceholder))

guard let range = optInContent.range(of: linkPlaceholder) else {
self.optInContent = AttributedString(ElementL10n.analyticsOptInContent(ElementInfoPlist.cfBundleName,
self.optInContent = AttributedString(ElementL10n.analyticsOptInContent(ElementInfoPlist.cfBundleDisplayName,
ElementL10n.analyticsOptInContentLink))
MXLog.failure("Failed to add a link attribute to the opt in content.")
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct AnalyticsPrompt: View {
Image(uiImage: Asset.Images.analyticsLogo.image)
.padding(.bottom, 25)

Text(ElementL10n.analyticsOptInTitle(ElementInfoPlist.cfBundleName))
Text(ElementL10n.analyticsOptInTitle(ElementInfoPlist.cfBundleDisplayName))
.font(.element.title2Bold)
.multilineTextAlignment(.center)
.foregroundColor(.element.primaryContent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ final class HomeScreenCoordinator: Coordinator, Presentable {
guard let permalink = try? PermalinkBuilder.permalinkTo(userIdentifier: parameters.userSession.userID).absoluteString else {
return
}
let shareText = ElementL10n.inviteFriendsText(ElementInfoPlist.cfBundleName, permalink)
let shareText = ElementL10n.inviteFriendsText(ElementInfoPlist.cfBundleDisplayName, permalink)
let vc = UIActivityViewController(activityItems: [shareText], applicationActivities: nil)
hostingController.present(vc, animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct SplashScreenViewState: BindableState {
message: ElementL10n.ftueAuthCarouselEncryptedBody,
image: Asset.Images.splashScreenPage3),
SplashScreenPageContent(title: page4Title.tinting("."),
message: ElementL10n.ftueAuthCarouselWorkplaceBody(ElementInfoPlist.cfBundleName),
message: ElementL10n.ftueAuthCarouselWorkplaceBody(ElementInfoPlist.cfBundleDisplayName),
image: Asset.Images.splashScreenPage4)
]
bindings = SplashScreenBindings()
Expand Down
2 changes: 2 additions & 0 deletions ElementX/SupportingFiles/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
Expand Down
1 change: 1 addition & 0 deletions ElementX/SupportingFiles/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ targets:
path: ../SupportingFiles/Info.plist
properties:
UILaunchStoryboardName: LaunchScreen
CFBundleDisplayName: $(PRODUCT_NAME)
CFBundleShortVersionString: $(MARKETING_VERSION)
CFBundleVersion: $(CURRENT_PROJECT_VERSION)
UISupportedInterfaceOrientations: [
Expand Down
1 change: 1 addition & 0 deletions changelog.d/227.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include app name in default session display name