Skip to content

Commit

Permalink
Merge branch 'main' into scott/pcp/initial-confirm-details-controller
Browse files Browse the repository at this point in the history
  • Loading branch information
scottkicks committed Mar 6, 2024
2 parents d7767d4 + 83e9ddf commit 134bcf3
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 19 deletions.
1 change: 1 addition & 0 deletions Kickstarter-iOS/Locales/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@
"You_canceled_your_pledge_for_this_project" = "You canceled your pledge for this project.";
"You_cant_use_this_credit_card_to_back_a_project_from_project_country" = "You can’t use this credit card to back a project from %{project_country}.";
"You_have_successfully_backed_project_html" = "You have successfully backed <b>%{project_name}</b>. This project is now one step closer to a reality, thanks to you. Spread the word!";
"You_have_successfully_backed_project_post_campaign_html" = "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>\n<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>\n<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>";
"You_launched_this_project_on_launch_date" = "You launched this project on %{launch_date}. For creator tools, head to our website!";
"You_need_to_pledge_at_least_reward_minimum_for_this_reward" = "You need to pledge at least %{reward_minimum} for this reward.";
"You_pledged_on_date" = "<b>You pledged</b> on %{pledge_date}";
Expand Down
3 changes: 2 additions & 1 deletion Kickstarter-iOS/Locales/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@
"You_canceled_your_pledge_for_this_project" = "Du hast den Finanzierungsbeitrag für dieses Projekt zurückgezogen.";
"You_cant_use_this_credit_card_to_back_a_project_from_project_country" = "Diese Karte kann nicht verwendet werden, um ein Projekt aus dem folgenden Land zu unterstützen: %{project_country}.";
"You_have_successfully_backed_project_html" = "Dank deiner Unterstützung ist <b>%{project_name}</b> seiner Verwirklichung einen Schritt näher. Sag es weiter!";
"You_have_successfully_backed_project_post_campaign_html" = "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>\n<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>\n<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>";
"You_launched_this_project_on_launch_date" = "Du hast dieses Projekt am %{launch_date} veröffentlicht. Tools für Projektgründer findest du auf unserer Website.";
"You_need_to_pledge_at_least_reward_minimum_for_this_reward" = "Diese Belohnung hat einen Mindestfinanzierungsbeitrag von %{reward_minimum}.";
"You_pledged_on_date" = "<b>Finanzierungsbeitrag geleistet</b> im %{pledge_date}";
Expand Down Expand Up @@ -1467,7 +1468,7 @@
"login_tout.generic_intent.title" = "Hoppla! Um fortzufahren, musst du dich auf Kickstarter einloggen. Du kannst dich unten mit deinem Facebook-Konto oder deiner E-Mail-Adresse anmelden oder dich neu registrieren.";
"login_tout.generic_intent.traditional_login_button" = "Anmelden";
"login_tout.generic_intent.traditional_signup_button" = "Registrieren";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Sign up or Log in";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Registrieren oder Anmelden";
"login_tout.generic_intent.traditional_title" = "Benutze deine E-Mail-Adresse:";
"login_tout.help_sheet.cancel" = "Abbrechen";
"login_tout.help_sheet.contact" = "Kontakt";
Expand Down
3 changes: 2 additions & 1 deletion Kickstarter-iOS/Locales/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@
"You_canceled_your_pledge_for_this_project" = "Has cancelado tu contribución a este proyecto.";
"You_cant_use_this_credit_card_to_back_a_project_from_project_country" = "No puedes usar esta tarjeta de crédito para patrocinar un proyecto de %{project_country}.";
"You_have_successfully_backed_project_html" = "Has patrocinado <b>%{project_name}</b> con éxito. Gracias a ti, este proyecto está ahora un paso más cerca de hacerse realidad. ¡Corre la voz!";
"You_have_successfully_backed_project_post_campaign_html" = "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>\n<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>\n<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>";
"You_launched_this_project_on_launch_date" = "Publicaste el proyecto el %{launch_date}. Encuentra las herramientas para creadores en nuestro sitio web.";
"You_need_to_pledge_at_least_reward_minimum_for_this_reward" = "Debes contribuir, al menos, %{reward_minimum} para obtener esta recompensa.";
"You_pledged_on_date" = "<b>Contribuiste</b> el %{pledge_date}";
Expand Down Expand Up @@ -1467,7 +1468,7 @@
"login_tout.generic_intent.title" = "¡Un momentito! Primero tienes que iniciar sesión con tu cuenta de Kickstarter para continuar. Regístrate o inicia sesión con tu dirección de correo electrónico o con tu cuenta de Facebook.";
"login_tout.generic_intent.traditional_login_button" = "Iniciar sesión";
"login_tout.generic_intent.traditional_signup_button" = "Registrar";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Sign up or Log in";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Registrarme o iniciar sesión";
"login_tout.generic_intent.traditional_title" = "Utiliza tu dirección de correo electrónico:";
"login_tout.help_sheet.cancel" = "Cancelar";
"login_tout.help_sheet.contact" = "Contacto";
Expand Down
3 changes: 2 additions & 1 deletion Kickstarter-iOS/Locales/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@
"You_canceled_your_pledge_for_this_project" = "Vous avez annulé votre engagement.";
"You_cant_use_this_credit_card_to_back_a_project_from_project_country" = "Impossible d'accepter cette carte pour soutenir un projet depuis le pays suivant : %{project_country}.";
"You_have_successfully_backed_project_html" = "Vous vous êtes engagé à soutenir le projet <b>%{project_name}</b>. Ce projet se rapproche tout doucement de son objectif grâce à vous. Parlez-en à votre entourage !";
"You_have_successfully_backed_project_post_campaign_html" = "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>\n<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>\n<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>";
"You_launched_this_project_on_launch_date" = "Vous avez lancé ce projet le %{launch_date}. Rendez-vous sur notre site Web pour accéder aux outils du créateur !";
"You_need_to_pledge_at_least_reward_minimum_for_this_reward" = "Vous devez vous engager à hauteur de %{reward_minimum} ou plus pour sélectionner cette récompense.";
"You_pledged_on_date" = "<b>Votre engagement</b> du %{pledge_date}";
Expand Down Expand Up @@ -1467,7 +1468,7 @@
"login_tout.generic_intent.title" = "Oh là ! Vous devez vous connecter à votre compte Kickstarter pour continuer. Vous pouvez vous connecter ou vous inscrire ci-dessous avec votre adresse e-mail ou votre compte Facebook.";
"login_tout.generic_intent.traditional_login_button" = "Connexion";
"login_tout.generic_intent.traditional_signup_button" = "Inscription";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Sign up or Log in";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Inscription ou connexion";
"login_tout.generic_intent.traditional_title" = "Utilisez votre adresse e-mail :";
"login_tout.help_sheet.cancel" = "Annuler";
"login_tout.help_sheet.contact" = "Contact";
Expand Down
3 changes: 2 additions & 1 deletion Kickstarter-iOS/Locales/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@
"You_canceled_your_pledge_for_this_project" = "このプロジェクトのプレッジはキャンセルされました。";
"You_cant_use_this_credit_card_to_back_a_project_from_project_country" = "%{project_country} のプロジェクトをバックするのにこのクレジットカードを利用することはできません。";
"You_have_successfully_backed_project_html" = "<b>%{project_name}</b>へのバックが完了しました。このプロジェクトは、成功に一歩近づきました!ありがとうございます。";
"You_have_successfully_backed_project_post_campaign_html" = "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>\n<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>\n<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>";
"You_launched_this_project_on_launch_date" = "%{launch_date} にこのプロジェクトをローンチしました。クリエイター向けツールにアクセスするには、Kickstarter ウェブサイトにアクセスしてください!";
"You_need_to_pledge_at_least_reward_minimum_for_this_reward" = "このリワードには、最低%{reward_minimum}のプレッジが必要です。";
"You_pledged_on_date" = "%{pledge_date} に<b>プレッジ</b>";
Expand Down Expand Up @@ -1467,7 +1468,7 @@
"login_tout.generic_intent.title" = "続行するにはアカウントにログインが必要です。 メールアドレス、Facebookアカウントで登録するか、ログインしてください。";
"login_tout.generic_intent.traditional_login_button" = "ログイン";
"login_tout.generic_intent.traditional_signup_button" = "サインアップ";
"login_tout.generic_intent.traditional_signup_or_login_button" = "Sign up or Log in";
"login_tout.generic_intent.traditional_signup_or_login_button" = "サインアップ or ログイン\n";
"login_tout.generic_intent.traditional_title" = "メールアドレスを使用:";
"login_tout.help_sheet.cancel" = "キャンセル";
"login_tout.help_sheet.contact" = "お問い合わせ";
Expand Down
46 changes: 38 additions & 8 deletions Library/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13069,6 +13069,35 @@ Veuillez réessayer ultérieurement."
substitutions: ["project_name": project_name]
)
}
/**
"<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>
<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>
<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>"

- **en**: "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>
<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>
<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>"
- **de**: "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>
<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>
<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>"
- **es**: "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>
<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>
<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>"
- **fr**: "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>
<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>
<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>"
- **ja**: "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>
<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>
<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>"
*/
public static func You_have_successfully_backed_project_post_campaign_html(project_name: String, pledge_total: String, user_email: String) -> String {
return localizedString(
key: "You_have_successfully_backed_project_post_campaign_html",
defaultValue: "<p>You have successfully backed <b>%{project_name}</b>. Your pledge of <b>%{pledge_total}</b> has been collected.</p>\n<p>You’ll receive a confirmation email at %{user_email} when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.</p>\n<p>This project is now one step closer to a reality, thanks to you. Spread the word!</p>",
count: nil,
substitutions: ["project_name": project_name, "pledge_total": pledge_total, "user_email": user_email]
)
}
/**
"You launched this project on %{launch_date}. For creator tools, head to our website!"

Expand Down Expand Up @@ -19281,7 +19310,7 @@ Veuillez réessayer ultérieurement."
- **de**: "Gesamt %{backers_count} Unterstützer, %{percent_funded} finanziert, noch %{time_left}"
- **es**: "De momento tiene %{backers_count} patrocinadores, financiado al %{percent_funded}, tiempo restante: %{time_left}"
- **fr**: "%{backers_count} contributeurs, projet financé à %{percent_funded}, plus que %{time_left}"
- **ja**: "バッカー%{backers_count} 人%{percent_funded} 達成、%{time_left} で締切"
- **ja**: "バッカー%{backers_count} 人%{percent_funded} 達成、%{time_left} で締切"
*/
public static func discovery_baseball_card_stats_accessibility_non_live_stat_value(backers_count: Int, percent_funded: String, time_left: String) -> String {
return localizedString(
Expand Down Expand Up @@ -22011,10 +22040,11 @@ iOSの場合、設定からFacebookのアクセスを許可してください。
"Sign up or Log in"

- **en**: "Sign up or Log in"
- **de**: "Sign up or Log in"
- **es**: "Sign up or Log in"
- **fr**: "Sign up or Log in"
- **ja**: "Sign up or Log in"
- **de**: "Registrieren oder Anmelden"
- **es**: "Registrarme o iniciar sesión"
- **fr**: "Inscription ou connexion"
- **ja**: "サインアップ or ログイン
"
*/
public static func login_tout_generic_intent_traditional_signup_or_login_button() -> String {
return localizedString(
Expand Down Expand Up @@ -22692,7 +22722,7 @@ iOSの場合、設定からFacebookのアクセスを許可してください。

- **en**: "BACKED %{project_count} PROJECTS"
- **de**: "HAT %{project_count} PROJEKTE UNTERSTÜTZT"
- **es**: "%{project_count} PROYECTOS PATROCINADOS"
- **es**: "%{project_count} PROYECTOS APOYADOS"
- **fr**: "%{project_count} PROJETS SOUTENUS"
- **ja**: "%{project_count} プロジェクトへバック済"
*/
Expand Down Expand Up @@ -25803,7 +25833,7 @@ unterstützt"
patrocinados"
- **fr**: "%{projects_count}
projets soutenus"
- **ja**: "%{projects_count} \n件バック済み"
- **ja**: "%{projects_count}\n件バック済み"
*/
public static func projects_count_newline_backed(projects_count: Int) -> String {
return localizedString(
Expand Down Expand Up @@ -26755,7 +26785,7 @@ projets enregistrés"
- **de**: "%{created_count} erstellt"
- **es**: "%{created_count} creados"
- **fr**: "%{created_count} projets créés"
- **ja**: "%{created_count} プロジェクト"
- **ja**: "%{created_count}プロジェクト"
*/
public static func social_following_friend_projects_count_created(created_count: Int) -> String {
return localizedString(
Expand Down
24 changes: 19 additions & 5 deletions Library/ViewModels/ThanksViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,25 @@ public final class ThanksViewModel: ThanksViewModelType, ThanksViewModelInputs,

self.backedProjectText = self.configureWithDataProperty.signal
.skipNil()
.map { project, _, _, _ in

let string = Strings.You_have_successfully_backed_project_html(
project_name: project.name
)
.map { project, _, _, pledgeTotal in

let string: String

if featurePostCampaignPledgeEnabled(),
project.isInPostCampaignPledgingPhase,
let email = AppEnvironment.current.currentUserEmail {
let formattedTotal = Format.formattedCurrency(pledgeTotal, country: project.country)

string = Strings.You_have_successfully_backed_project_post_campaign_html(
project_name: project.name,
pledge_total: formattedTotal,
user_email: email
)
} else {
string = Strings.You_have_successfully_backed_project_html(
project_name: project.name
)
}

return string
.simpleHtmlAttributedString(font: UIFont.ksr_subhead(), bold: UIFont.ksr_subhead().bolded)
Expand Down
30 changes: 28 additions & 2 deletions Library/ViewModels/ThanksViewModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ final class ThanksViewModelTests: TestCase {
private func thanksPageData(
project: Project = Project.template,
reward: Reward = Reward.template,
checkoutData: KSRAnalytics.CheckoutPropertiesData? = nil
checkoutData: KSRAnalytics.CheckoutPropertiesData? = nil,
pledgeTotal: Double = 1
) -> ThanksPageData {
return (project, reward, checkoutData, 1)
return (project, reward, checkoutData, pledgeTotal)
}

func testDismissToRootViewController() {
Expand Down Expand Up @@ -113,6 +114,31 @@ final class ThanksViewModelTests: TestCase {
)
}

func testDisplayBackedProjectText_postCampaignBackings() {
let mockConfigClient = MockRemoteConfigClient()
mockConfigClient.features = [
RemoteConfigFeature.postCampaignPledgeEnabled.rawValue: true
]

var project = Project.template
project.name = "Test Project"
project.isInPostCampaignPledgingPhase = true
project.country = Project.Country.jp

withEnvironment(Environment(currentUserEmail: "test@user.com", remoteConfigClient: mockConfigClient)) {
self.vm.inputs.configure(with: self.thanksPageData(project: project, pledgeTotal: 127))
self.vm.inputs.viewDidLoad()

self.backedProjectText.assertValues(
[
"""
You have successfully backed Test Project. Your pledge of ¥127 has been collected.\nYou’ll receive a confirmation email at test@user.com when your rewards are ready to fulfill so that you can finalize and pay shipping and tax.\nThis project is now one step closer to a reality, thanks to you. Spread the word!\n
"""
], "Name of project emits"
)
}
}

func testRatingAlert_Initial() {
withEnvironment(currentUser: .template) {
showRatingAlert.assertValueCount(0, "Rating Alert does not emit")
Expand Down

0 comments on commit 134bcf3

Please sign in to comment.