Added locale to support URI

pull/204/head
M66B 3 years ago
parent e0bab3e77c
commit 473cb3a4b4

@ -226,7 +226,7 @@ public class ActivityBilling extends ActivityBase implements PurchasingListener,
private void onPurchaseError(Intent intent) { private void onPurchaseError(Intent intent) {
String message = intent.getStringExtra("message"); String message = intent.getStringExtra("message");
Uri uri = Uri.parse(Helper.SUPPORT_URI); Uri uri = Helper.getSupportUri(this);
if (!TextUtils.isEmpty(message)) if (!TextUtils.isEmpty(message))
uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build(); uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build();
Helper.view(this, uri, true); Helper.view(this, uri, true);

@ -277,7 +277,7 @@ public class ActivityBilling extends ActivityBase implements /*PurchasesUpdatedL
private void onPurchaseError(Intent intent) { private void onPurchaseError(Intent intent) {
String message = intent.getStringExtra("message"); String message = intent.getStringExtra("message");
Uri uri = Uri.parse(Helper.SUPPORT_URI); Uri uri = Helper.getSupportUri(this);
if (!TextUtils.isEmpty(message)) if (!TextUtils.isEmpty(message))
uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build(); uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build();
Helper.view(this, uri, true); Helper.view(this, uri, true);

@ -156,7 +156,7 @@ public class Helper {
static final String PRIVACY_URI = "https://email.faircode.eu/privacy/"; static final String PRIVACY_URI = "https://email.faircode.eu/privacy/";
static final String XDA_URI = "https://forum.xda-developers.com/showthread.php?t=3824168"; static final String XDA_URI = "https://forum.xda-developers.com/showthread.php?t=3824168";
static final String SUPPORT_URI = "https://contact.faircode.eu/?product=fairemailsupport&version=" + BuildConfig.VERSION_NAME; static final String SUPPORT_URI = "https://contact.faircode.eu/";
static final String TEST_URI = "https://play.google.com/apps/testing/" + BuildConfig.APPLICATION_ID; static final String TEST_URI = "https://play.google.com/apps/testing/" + BuildConfig.APPLICATION_ID;
static final String BIMI_PRIVACY_URI = "https://datatracker.ietf.org/doc/html/draft-brotman-ietf-bimi-guidance-03#section-7.4"; static final String BIMI_PRIVACY_URI = "https://datatracker.ietf.org/doc/html/draft-brotman-ietf-bimi-guidance-03#section-7.4";
static final String FAVICON_PRIVACY_URI = "https://en.wikipedia.org/wiki/Favicon"; static final String FAVICON_PRIVACY_URI = "https://en.wikipedia.org/wiki/Favicon";
@ -803,8 +803,16 @@ public class Helper {
} }
static Uri getSupportUri(Context context) { static Uri getSupportUri(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
String language = prefs.getString("language", null);
Locale slocale = Resources.getSystem().getConfiguration().locale;
return Uri.parse(SUPPORT_URI) return Uri.parse(SUPPORT_URI)
.buildUpon() .buildUpon()
.appendQueryParameter("product", "fairemailsupport")
.appendQueryParameter("version", BuildConfig.VERSION_NAME)
.appendQueryParameter("locale", slocale.toString())
.appendQueryParameter("language", language == null ? "" : language)
.appendQueryParameter("installed", Helper.hasValidFingerprint(context) ? "" : "Other") .appendQueryParameter("installed", Helper.hasValidFingerprint(context) ? "" : "Other")
.build(); .build();
} }

@ -278,7 +278,7 @@ public class ActivityBilling extends ActivityBase implements PurchasesUpdatedLis
private void onPurchaseError(Intent intent) { private void onPurchaseError(Intent intent) {
String message = intent.getStringExtra("message"); String message = intent.getStringExtra("message");
Uri uri = Uri.parse(Helper.SUPPORT_URI); Uri uri = Helper.getSupportUri(this);
if (!TextUtils.isEmpty(message)) if (!TextUtils.isEmpty(message))
uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build(); uri = uri.buildUpon().appendQueryParameter("message", "IAB: " + message).build();
Helper.view(this, uri, true); Helper.view(this, uri, true);

Loading…
Cancel
Save