From e32e22de761a501b1cb1a8872028aebd688489c2 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 2 Dec 2024 16:57:52 +0100 Subject: [PATCH] Fix translation for general terms and privacy policy --- Linphone/Localizable.xcstrings | 156 +++++++++++++++--- .../Assistant/Fragments/LoginFragment.swift | 47 ++++-- .../Fragments/PermissionsFragment.swift | 3 +- 3 files changed, 162 insertions(+), 44 deletions(-) diff --git a/Linphone/Localizable.xcstrings b/Linphone/Localizable.xcstrings index 9c39cdf01..0c7de5d09 100644 --- a/Linphone/Localizable.xcstrings +++ b/Linphone/Localizable.xcstrings @@ -3,9 +3,6 @@ "strings" : { "" : { - }, - " et " : { - }, " has reacted by " : { @@ -18,21 +15,12 @@ }, ": %@" : { - }, - "." : { - }, "[Forgotten password?](https://subscribe.linphone.org/)" : { }, "[linphone.org/contact](https://linphone.org/contact)" : { - }, - "[nos conditions d’utilisation](https://linphone.org/general-terms)" : { - - }, - "[notre politique de confidentialité](https://linphone.org/privacy-policy)" : { - }, "*" : { @@ -189,9 +177,6 @@ }, "A subject and at least one participant is required to create a meeting" : { - }, - "Accept all" : { - }, "Account successfully logged out" : { @@ -389,6 +374,70 @@ } } }, + "assistant_dialog_general_terms_and_privacy_policy_message" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "By continuing, you accept our %@ and %@." + } + }, + "fr" : { + "stringUnit" : { + "state" : "needs_review", + "value" : "En continuant, vous acceptez nos %@ et %@." + } + } + } + }, + "assistant_dialog_general_terms_and_privacy_policy_title" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "General terms & privacy policy" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Conditions de service & politique de confidentialité" + } + } + } + }, + "assistant_dialog_general_terms_label" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "general terms" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "conditions de service" + } + } + } + }, + "assistant_dialog_privacy_policy_label" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "privacy policy" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "politique de confidentialité" + } + } + } + }, "assistant_permissions_access_camera_title" : { "localizations" : { "en" : { @@ -442,13 +491,13 @@ "en" : { "stringUnit" : { "state" : "translated", - "value" : "**Read contacts:** To display your contacts and find whom is using this app." + "value" : "**Read contacts:** To display your contacts and find whom is using %@." } }, "fr" : { "stringUnit" : { - "state" : "needs_review", - "value" : "**Contacts :** Pour vous afficher vos contacts et retrouver qui utilise cette application." + "state" : "translated", + "value" : "**Contacts :** Pour vous afficher vos contacts et retrouver qui utilise %@." } } } @@ -1002,9 +1051,6 @@ }, "Close" : { - }, - "Conditions de service" : { - }, "conference_failed_to_create_group_call_toast" : { "extractionState" : "manual", @@ -2359,15 +2405,28 @@ }, "Delete all history" : { - }, - "Deny all" : { - }, "Description" : { }, "Dialer" : { + }, + "dialog_accept" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Accept" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Accepter" + } + } + } }, "dialog_call" : { "localizations" : { @@ -2401,6 +2460,22 @@ } } }, + "dialog_deny" : { + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Deny" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Refuser" + } + } + } + }, "dialog_ok" : { "localizations" : { "en" : { @@ -2575,9 +2650,6 @@ }, "En attente d'autres participants..." : { - }, - "En continuant, vous acceptez ces conditions, " : { - }, "En pause" : { @@ -2784,6 +2856,12 @@ } } } + }, + "https://linphone.org/general-terms" : { + + }, + "https://linphone.org/privacy-policy" : { + }, "I prefere create an account" : { @@ -3877,6 +3955,30 @@ }, "Vidéo" : { + }, + "website_privacy_policy_url" : { + "extractionState" : "stale", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "https://linphone.org/privacy-policy" + } + } + }, + "shouldTranslate" : false + }, + "website_terms_and_conditions_url" : { + "extractionState" : "stale", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "https://linphone.org/general-terms" + } + } + }, + "shouldTranslate" : false }, "welcome_page_1_message" : { "localizations" : { diff --git a/Linphone/UI/Assistant/Fragments/LoginFragment.swift b/Linphone/UI/Assistant/Fragments/LoginFragment.swift index a53421ab8..a570ec995 100644 --- a/Linphone/UI/Assistant/Fragments/LoginFragment.swift +++ b/Linphone/UI/Assistant/Fragments/LoginFragment.swift @@ -293,21 +293,38 @@ struct LoginFragment: View { } if self.isShowPopup { - let contentPopup1 = Text("En continuant, vous acceptez ces conditions, ") - let contentPopup2 = Text("[notre politique de confidentialité](https://linphone.org/privacy-policy)").underline() - let contentPopup3 = Text(" et ") - let contentPopup4 = Text("[nos conditions d’utilisation](https://linphone.org/general-terms)").underline() - let contentPopup5 = Text(".") - PopupView(isShowPopup: $isShowPopup, - title: Text("Conditions de service"), - content: contentPopup1 + contentPopup2 + contentPopup3 + contentPopup4 + contentPopup5, - titleFirstButton: Text("Deny all"), - actionFirstButton: {self.isShowPopup.toggle()}, - titleSecondButton: Text("Accept all"), - actionSecondButton: {acceptGeneralTerms()}) - .background(.black.opacity(0.65)) - .onTapGesture { - self.isShowPopup.toggle() + let generalTerms = String(format: "[%@](%@)", String(localized: "assistant_dialog_general_terms_label"), String(localized: "https://linphone.org/general-terms")) + let privacyPolicy = String(format: "[%@](%@)", String(localized: "assistant_dialog_privacy_policy_label"), String(localized: "https://linphone.org/privacy-policy")) + let splitMsg = String(localized: "assistant_dialog_general_terms_and_privacy_policy_message").components(separatedBy: "%@") + if splitMsg.count == 3 { // We expect form of STRING %A STRING %@ STRING + let contentPopup1 = Text(.init(splitMsg[0])) + let contentPopup2 = Text(.init(generalTerms)).underline() + let contentPopup3 = Text(.init(splitMsg[1])) + let contentPopup4 = Text(.init(privacyPolicy)).underline() + let contentPopup5 = Text(.init(splitMsg[2])) + PopupView(isShowPopup: $isShowPopup, + title: Text("assistant_dialog_general_terms_and_privacy_policy_title"), + content: contentPopup1 + contentPopup2 + contentPopup3 + contentPopup4 + contentPopup5, + titleFirstButton: Text("dialog_deny"), + actionFirstButton: {self.isShowPopup.toggle()}, + titleSecondButton: Text("dialog_accept"), + actionSecondButton: {acceptGeneralTerms()}) + .background(.black.opacity(0.65)) + .onTapGesture { + self.isShowPopup.toggle() + } + } else { // backup just in case + PopupView(isShowPopup: $isShowPopup, + title: Text("assistant_dialog_general_terms_and_privacy_policy_title"), + content: Text(.init(String(format: String(localized: "assistant_dialog_general_terms_and_privacy_policy_message"), generalTerms, privacyPolicy))), + titleFirstButton: Text("dialog_deny"), + actionFirstButton: {self.isShowPopup.toggle()}, + titleSecondButton: Text("dialog_accept"), + actionSecondButton: {acceptGeneralTerms()}) + .background(.black.opacity(0.65)) + .onTapGesture { + self.isShowPopup.toggle() + } } } } diff --git a/Linphone/UI/Assistant/Fragments/PermissionsFragment.swift b/Linphone/UI/Assistant/Fragments/PermissionsFragment.swift index 1058525b3..dd1bc8836 100644 --- a/Linphone/UI/Assistant/Fragments/PermissionsFragment.swift +++ b/Linphone/UI/Assistant/Fragments/PermissionsFragment.swift @@ -103,8 +103,7 @@ struct PermissionsFragment: View { .padding(16) .background(Color.grayMain2c200) .cornerRadius(40) - - Text("assistant_permissions_read_contacts_title") + Text(.init(String(format: String(localized: "assistant_permissions_read_contacts_title"), Bundle.main.displayName))) .default_text_style(styleSize: 15) .padding(.leading, 10) }