-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Paywalls] Add default locale (#1809)
### Motivation Support new `default_locale` property in paywall data ### Description If localization for preferred language isn't found, use the default locale before falling back to the first locale. #### Demo https://github.com/user-attachments/assets/fae5bfb1-d22b-4d69-a944-ff3311c47ee5 --------- Co-authored-by: Toni Rico <toni.rico.diez@revenuecat.com>
- Loading branch information
1 parent
d26a594
commit 335d0b2
Showing
4 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
examples/paywall-tester/src/main/java/com/revenuecat/paywallstester/Constants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.revenuecat.paywallstester | ||
|
||
object Constants { | ||
const val GOOGLE_API_KEY = "goog_uArAGtKQJeuXMWoSNXCAZBzTepD" | ||
const val GOOGLE_API_KEY = "API_KEY" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
purchases/src/test/resources/paywalldata-default-locale-with-missing_current_locale.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"template_name": "1", | ||
"localized_strings": { | ||
"es_ES": { | ||
"title": "Tienda", | ||
"subtitle": "Descripción", | ||
"call_to_action": "Comprar", | ||
"call_to_action_with_intro_offer": "Comprar", | ||
"offer_details": "{{ sub_price_per_month }} cada mes", | ||
"offer_details_with_intro_offer": "Comienza tu prueba de {{ sub_offer_duration }}, y después {{ sub_price_per_month }} cada mes" | ||
}, | ||
"pl_PL": { | ||
"title": "Sklep", | ||
"subtitle": "Opis", | ||
"call_to_action": "Kup", | ||
"call_to_action_with_intro_offer": "Kup", | ||
"offer_details": "{{ sub_price_per_month }} co miesiąc", | ||
"offer_details_with_intro_offer": "Rozpocznij swój {{ sub_offer_duration }} okres próbny, a następnie {{ sub_price_per_month }} co miesiąc" | ||
} | ||
}, | ||
"config": { | ||
"packages": ["$rc_monthly", "$rc_annual"], | ||
"images_webp": {}, | ||
"colors": { | ||
"light": { | ||
"background": "#FFFFFF", | ||
"text_1": "#FFFFFF", | ||
"call_to_action_background": "#FFFFFF", | ||
"call_to_action_foreground": "#FFFFFF", | ||
"accent_1": "#FFFFFF" | ||
}, | ||
"dark": null | ||
} | ||
}, | ||
"asset_base_url": "https://rc-paywalls.s3.amazonaws.com", | ||
"default_locale": "pl_PL" | ||
} |