1
0
Fork 0

For #1181 - Use appName in string locations

master
Jeff Boek 2019-03-26 10:26:36 -07:00
parent ea3c9bdf7d
commit 756634bc6c
4 changed files with 39 additions and 7 deletions

View File

@ -106,13 +106,19 @@ class CustomTabsIntegration(
private val menuItems by lazy { private val menuItems by lazy {
listOf( listOf(
SimpleBrowserMenuItem( SimpleBrowserMenuItem(
context.getString(R.string.browser_menu_powered_by), {
val appName = context.getString(R.string.app_name)
context.getString(R.string.browser_menu_powered_by, appName).toUpperCase()
}(),
ToolbarMenu.CAPTION_TEXT_SIZE, ToolbarMenu.CAPTION_TEXT_SIZE,
DefaultThemeManager.resolveAttribute(R.attr.browserToolbarMenuIcons, context) DefaultThemeManager.resolveAttribute(R.attr.browserToolbarMenuIcons, context)
), ),
BrowserMenuDivider(), BrowserMenuDivider(),
SimpleBrowserMenuItem( SimpleBrowserMenuItem(
context.getString(R.string.browser_menu_open_in_fenix), {
val appName = context.getString(R.string.app_name)
context.getString(R.string.browser_menu_open_in_fenix, appName)
}(),
textColorResource = DefaultThemeManager.resolveAttribute( textColorResource = DefaultThemeManager.resolveAttribute(
R.attr.browserToolbarMenuIcons, R.attr.browserToolbarMenuIcons,
context context

View File

@ -293,6 +293,8 @@ class HomeFragment : Fragment(), CoroutineScope {
private fun setupPrivateBrowsingDescription() { private fun setupPrivateBrowsingDescription() {
// Format the description text to include a hyperlink // Format the description text to include a hyperlink
val appName = resources.getString(R.string.app_name)
private_session_description.text = resources.getString(R.string.private_browsing_explanation, appName)
val descriptionText = String val descriptionText = String
.format(private_session_description.text.toString(), System.getProperty("line.separator")) .format(private_session_description.text.toString(), System.getProperty("line.separator"))
val linkStartIndex = descriptionText.indexOf("\n\n") + 2 val linkStartIndex = descriptionText.indexOf("\n\n") + 2

View File

@ -81,6 +81,10 @@ class SettingsFragment : PreferenceFragmentCompat(), CoroutineScope, AccountObse
requireComponents.search.searchEngineManager.getDefaultSearchEngine(it).name requireComponents.search.searchEngineManager.getDefaultSearchEngine(it).name
} }
val aboutPreference = findPreference<Preference>(getString(R.string.pref_key_about))
val appName = getString(R.string.app_name)
aboutPreference?.title = getString(R.string.preferences_about, appName)
generateWordmark() generateWordmark()
setupPreferences() setupPreferences()
setupAccountUI() setupAccountUI()

View File

@ -4,7 +4,8 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources> <resources>
<!-- Name of the application --> <!-- Name of the application -->
<string name="app_name">GeckoView Preview</string> <string name="app_name">Fenix</string>
<!-- Home Fragment --> <!-- Home Fragment -->
<!-- Content description (not visible, for screen readers etc.): "Three dot" menu button. --> <!-- Content description (not visible, for screen readers etc.): "Three dot" menu button. -->
<string name="content_description_menu">More options</string> <string name="content_description_menu">More options</string>
@ -16,13 +17,16 @@
<string name="sessions_intro_description">Sessions help you return to the sites you visit often and those you\'ve just discovered. Start browsing and they\'ll begin to appear here. </string> <string name="sessions_intro_description">Sessions help you return to the sites you visit often and those you\'ve just discovered. Start browsing and they\'ll begin to appear here. </string>
<!-- Placeholder text shown in the search bar before a user enters text --> <!-- Placeholder text shown in the search bar before a user enters text -->
<string name="search_hint">Search or enter address</string> <string name="search_hint">Search or enter address</string>
<!-- Private Browsing --> <!-- Private Browsing -->
<!-- Title for private session option --> <!-- Title for private session option -->
<string name="private_browsing_title">You\'re in a private session</string> <string name="private_browsing_title">You\'re in a private session</string>
<!-- Explanation for private browsing displayed to users on home view when they first enable private mode --> <!-- Explanation for private browsing displayed to users on home view when they first enable private mode
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
<string name="private_browsing_explanation">%1$s clears your search and browsing history when you close your private session. While this doesn\'t make you anonymous to websites or your internet service provider, it makes it easier to keep what you do online private from anyone else who uses this device.\n\nCommon myths about private browsing</string> <string name="private_browsing_explanation">%1$s clears your search and browsing history when you close your private session. While this doesn\'t make you anonymous to websites or your internet service provider, it makes it easier to keep what you do online private from anyone else who uses this device.\n\nCommon myths about private browsing</string>
<!-- Delete session button to erase your history in a private session --> <!-- Delete session button to erase your history in a private session -->
<string name="private_browsing_delete_session">Delete session</string> <string name="private_browsing_delete_session">Delete session</string>
<!-- Browser Fragment --> <!-- Browser Fragment -->
<!-- Content description (not visible, for screen readers etc.): Navigate home --> <!-- Content description (not visible, for screen readers etc.): Navigate home -->
<string name="browser_home_button">Home</string> <string name="browser_home_button">Home</string>
@ -54,10 +58,13 @@
<string name="browser_menu_share">Share</string> <string name="browser_menu_share">Share</string>
<!-- Share menu title, displayed when a user is sharing their current site --> <!-- Share menu title, displayed when a user is sharing their current site -->
<string name="menu_share_with">Share with…</string> <string name="menu_share_with">Share with…</string>
<!-- Browser menu button shown in custom tabs that opens the current tab in Fenix --> <!-- Browser menu button shown in custom tabs that opens the current tab in Fenix
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
<string name="browser_menu_open_in_fenix">Open in %1$s</string> <string name="browser_menu_open_in_fenix">Open in %1$s</string>
<!-- Browser menu text shown in custom tabs to indicate this is a Fenix tab --> <!-- Browser menu text shown in custom tabs to indicate this is a Fenix tab
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
<string name="browser_menu_powered_by">POWERED BY %1$s</string> <string name="browser_menu_powered_by">POWERED BY %1$s</string>
<!-- Search Fragment --> <!-- Search Fragment -->
<!-- Button in the search view that lets a user search by scanning a QR code --> <!-- Button in the search view that lets a user search by scanning a QR code -->
<string name="search_scan_button">Scan</string> <string name="search_scan_button">Scan</string>
@ -65,9 +72,11 @@
<string name="search_shortcuts_button">Shortcuts</string> <string name="search_shortcuts_button">Shortcuts</string>
<!-- Button in the search view that lets a user navigate to the site in their clipboard --> <!-- Button in the search view that lets a user navigate to the site in their clipboard -->
<string name="awesomebar_clipboard_title">Fill link from clipboard</string> <string name="awesomebar_clipboard_title">Fill link from clipboard</string>
<!-- Settings Fragment --> <!-- Settings Fragment -->
<!-- Title for the settings page--> <!-- Title for the settings page-->
<string name="settings">Settings</string> <string name="settings">Settings</string>
<!-- Preferences --> <!-- Preferences -->
<!-- Preference category for basic settings --> <!-- Preference category for basic settings -->
<string name="preferences_category_basics">Basics</string> <string name="preferences_category_basics">Basics</string>
@ -81,7 +90,8 @@
<string name="preferences_rate">Rate on Google Play</string> <string name="preferences_rate">Rate on Google Play</string>
<!-- Preference for giving feedback about Fenix --> <!-- Preference for giving feedback about Fenix -->
<string name="preferences_feedback">Give feedback</string> <string name="preferences_feedback">Give feedback</string>
<!-- Preference linking to about page for Fenix --> <!-- Preference linking to about page for Fenix
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
<string name="preferences_about">About %1$s</string> <string name="preferences_about">About %1$s</string>
<!-- Preference for settings related to saved passwords --> <!-- Preference for settings related to saved passwords -->
<string name="preferences_passwords">Passwords</string> <string name="preferences_passwords">Passwords</string>
@ -117,6 +127,7 @@
<string name="preferences_show_search_suggestions">Show search suggestions</string> <string name="preferences_show_search_suggestions">Show search suggestions</string>
<!-- Preference for account settings --> <!-- Preference for account settings -->
<string name="preferences_account_settings">Account settings</string> <string name="preferences_account_settings">Account settings</string>
<!-- Site Permissions Preferences --> <!-- Site Permissions Preferences -->
<!-- Preference for reducing image sizes, bandwidth and platform-level optimizations --> <!-- Preference for reducing image sizes, bandwidth and platform-level optimizations -->
<string name="preference_optimize">Optimize</string> <string name="preference_optimize">Optimize</string>
@ -149,6 +160,7 @@
<string name="preference_phone_feature_notification">Notification</string> <string name="preference_phone_feature_notification">Notification</string>
<!-- Preference option for altering the notification access for all websites --> <!-- Preference option for altering the notification access for all websites -->
<string name="preference_option_phone_feature_ask_to_allow">Ask to allow</string> <string name="preference_option_phone_feature_ask_to_allow">Ask to allow</string>
<!-- Account Preferences --> <!-- Account Preferences -->
<!-- Preference for triggering sync --> <!-- Preference for triggering sync -->
<string name="preferences_sync_now">Sync now</string> <string name="preferences_sync_now">Sync now</string>
@ -168,6 +180,7 @@
<string name="sync_last_synced_summary">Last synced: %s</string> <string name="sync_last_synced_summary">Last synced: %s</string>
<!-- Label summary showing never synced --> <!-- Label summary showing never synced -->
<string name="sync_never_synced_summary">Last synced: never</string> <string name="sync_never_synced_summary">Last synced: never</string>
<!-- Advanced Preferences --> <!-- Advanced Preferences -->
<!-- Preference switch for Telemetry --> <!-- Preference switch for Telemetry -->
<string name="preferences_telemetry">Telemetry</string> <string name="preferences_telemetry">Telemetry</string>
@ -177,6 +190,7 @@
<string name="preferences_mozilla_location_service">Mozilla location service</string> <string name="preferences_mozilla_location_service">Mozilla location service</string>
<!-- Preference switch for app health report. --> <!-- Preference switch for app health report. -->
<string name="preferences_fenix_health_report">Fenix health report</string> <string name="preferences_fenix_health_report">Fenix health report</string>
<!-- Quick Action Sheet --> <!-- Quick Action Sheet -->
<!-- Option in Quick Action Sheet in the browser to share the current page --> <!-- Option in Quick Action Sheet in the browser to share the current page -->
<string name="quick_action_share">Share</string> <string name="quick_action_share">Share</string>
@ -190,6 +204,7 @@
<string name="quick_action_sheet">Quick action sheet</string> <string name="quick_action_sheet">Quick action sheet</string>
<!-- Content description (not visible, for screen readers etc.): Quick action sheet handle --> <!-- Content description (not visible, for screen readers etc.): Quick action sheet handle -->
<string name="quick_action_sheet_handle">Quick action sheet handle</string> <string name="quick_action_sheet_handle">Quick action sheet handle</string>
<!-- Library --> <!-- Library -->
<!-- Option in Library to open Sessions page --> <!-- Option in Library to open Sessions page -->
<string name="library_sessions">Sessions</string> <string name="library_sessions">Sessions</string>
@ -216,6 +231,7 @@
<p>%1$s puts you in control.</p> <p>%1$s puts you in control.</p>
<p>%1$s is produced by Mozilla. Our mission is to foster a healthy, open Internet.<br/> <p>%1$s is produced by Mozilla. Our mission is to foster a healthy, open Internet.<br/>
]]></string> ]]></string>
<!-- Sessions --> <!-- Sessions -->
<!-- Title for the list of tabs in the current session --> <!-- Title for the list of tabs in the current session -->
<string name="tabs_header_title">Current session</string> <string name="tabs_header_title">Current session</string>
@ -246,6 +262,7 @@
<!-- Text to tell the user how many more tabs this session has. <!-- Text to tell the user how many more tabs this session has.
The first parameter is how many extra tabs the session has. --> The first parameter is how many extra tabs the session has. -->
<string name="session_items_more">%1$d sites…</string> <string name="session_items_more">%1$d sites…</string>
<!-- History --> <!-- History -->
<!-- Text for the button to clear all history --> <!-- Text for the button to clear all history -->
<string name="history_delete_all">Delete history</string> <string name="history_delete_all">Delete history</string>
@ -264,6 +281,7 @@
<string name="history_older">Older</string> <string name="history_older">Older</string>
<!-- Text displayed in a notification when the user enters full screen mode --> <!-- Text displayed in a notification when the user enters full screen mode -->
<string name="full_screen_notification">Entering full screen mode</string> <string name="full_screen_notification">Entering full screen mode</string>
<!-- Crashes --> <!-- Crashes -->
<!-- Title text displayed on the tab crash page --> <!-- Title text displayed on the tab crash page -->
<string name="tab_crash_title">Sorry. %1$s can\'t get that tab back</string> <string name="tab_crash_title">Sorry. %1$s can\'t get that tab back</string>
@ -275,8 +293,10 @@
<string name="tab_crash_close">Close tab</string> <string name="tab_crash_close">Close tab</string>
<!-- Restore tab button text on the tab crash page --> <!-- Restore tab button text on the tab crash page -->
<string name="tab_crash_restore">Restore tab</string> <string name="tab_crash_restore">Restore tab</string>
<!-- Content Description for session item menu button --> <!-- Content Description for session item menu button -->
<string name="content_description_session_menu">Session options</string> <string name="content_description_session_menu">Session options</string>
<!-- Content Description for session item share button --> <!-- Content Description for session item share button -->
<string name="content_description_session_share">Share session</string> <string name="content_description_session_share">Share session</string>
</resources> </resources>