Commit 2969f9f5 authored by Severin Rudie's avatar Severin Rudie
Browse files

For mozilla-mobile/fenix#5540: add 'no internet' error

parent 8690c00d
......@@ -33,7 +33,7 @@ object ErrorPages {
.use { it.readText() }
.replace("%pageTitle%", context.getString(R.string.mozac_browser_errorpages_page_title))
.replace("%backButton%", context.getString(R.string.mozac_browser_errorpages_page_go_back))
.replace("%button%", context.getString(R.string.mozac_browser_errorpages_page_refresh))
.replace("%button%", context.getString(errorType.refreshButtonRes))
.replace("%messageShort%", context.getString(errorType.titleRes))
.replace("%messageLong%", context.getString(errorType.messageRes, uri))
.replace("%css%", css)
......@@ -45,7 +45,8 @@ object ErrorPages {
*/
enum class ErrorType(
@StringRes val titleRes: Int,
@StringRes val messageRes: Int
@StringRes val messageRes: Int,
@StringRes val refreshButtonRes: Int = R.string.mozac_browser_errorpages_page_refresh
) {
UNKNOWN(
R.string.mozac_browser_errorpages_generic_title,
......@@ -111,6 +112,11 @@ enum class ErrorType(
R.string.mozac_browser_errorpages_unknown_host_title,
R.string.mozac_browser_errorpages_unknown_host_message
),
ERROR_NO_INTERNET(
R.string.mozac_browser_errorpages_no_internet_title,
R.string.mozac_browser_errorpages_no_internet_message,
R.string.mozac_browser_errorpages_no_internet_refresh_button
),
ERROR_MALFORMED_URI(
R.string.mozac_browser_errorpages_malformed_uri_title,
R.string.mozac_browser_errorpages_malformed_uri_message
......
......@@ -170,6 +170,13 @@
</ul>
]]></string>
<!-- The document title and heading of an error page. -->
<string name="mozac_browser_errorpages_no_internet_title">No internet connection</string>
<!-- The main body text of this error page. It will be shown beneath the title -->
<string name="mozac_browser_errorpages_no_internet_message">Check your network connection or try reloading the page in a few moments.</string>
<!-- Text that will show up on the button at the bottom of the error page -->
<string name="mozac_browser_errorpages_no_internet_refresh_button">Reload</string>
<!-- The document title and heading of an error page. -->
<string name="mozac_browser_errorpages_malformed_uri_title">Invalid Address</string>
<string name="mozac_browser_errorpages_malformed_uri_message"><![CDATA[
......
......@@ -12,6 +12,9 @@ permalink: /changelog/
* [Gecko](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Gecko.kt)
* [Configuration](https://github.com/mozilla-mobile/android-components/blob/master/buildSrc/src/main/java/Config.kt)
* **browser-errorpages**
* Added strings for "no network connection" error pages
# 23.0.0
* [Commits](https://github.com/mozilla-mobile/android-components/compare/v22.0.0...v23.0.0)
......@@ -58,7 +61,7 @@ permalink: /changelog/
* **support-base**
* Deprecated `BackHandler` interface. Use the `UserInteractionHandler.onBackPressed` instead.
* Added generic `UserInteractionHandler` interface for fragments, features and other components that want to handle user interactions such as ‘back’ or 'home' button presses.
# 22.0.0
* [Commits](https://github.com/mozilla-mobile/android-components/compare/v22.0.0...master)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment