|
|
@ -27,7 +27,7 @@ object SupportUtils {
|
|
|
|
val escapedTopic = getEncodedTopicUTF8(topic.topicStr)
|
|
|
|
val escapedTopic = getEncodedTopicUTF8(topic.topicStr)
|
|
|
|
val appVersion = getAppVersion(context)
|
|
|
|
val appVersion = getAppVersion(context)
|
|
|
|
val osTarget = "Android"
|
|
|
|
val osTarget = "Android"
|
|
|
|
val langTag = Locale.getDefault().isO3Language
|
|
|
|
val langTag = getLanguageTag(Locale.getDefault())
|
|
|
|
return "https://support.mozilla.org/1/mobile/$appVersion/$osTarget/$langTag/$escapedTopic"
|
|
|
|
return "https://support.mozilla.org/1/mobile/$appVersion/$osTarget/$langTag/$escapedTopic"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -47,4 +47,12 @@ object SupportUtils {
|
|
|
|
throw IllegalStateException("Unable find package details for Fenix", e)
|
|
|
|
throw IllegalStateException("Unable find package details for Fenix", e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun getLanguageTag(locale: Locale): String {
|
|
|
|
|
|
|
|
val language = locale.language
|
|
|
|
|
|
|
|
val country = locale.country // Can be an empty string.
|
|
|
|
|
|
|
|
return if (country == "") {
|
|
|
|
|
|
|
|
language
|
|
|
|
|
|
|
|
} else "$language-$country"
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|