Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Update strings from review. #2508

Merged
merged 4 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ subprojects {
lintOptions {
warningsAsErrors true
abortOnError (project.name != "support-test")

// With our L10N process its totally possible to have missing or (temporarily) extra translations.
disable 'MissingTranslation', 'ExtraTranslation'
}
}

Expand Down
28 changes: 9 additions & 19 deletions components/feature/contextmenu/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<!-- Text for context menu item to open the link in a new tab. -->
<string name="mozac_feature_contextmenu_open_link_in_new_tab">Open Link in New Tab</string>

<string name="mozac_feature_contextmenu_open_link_in_new_tab">Open link in new tab</string>
<!-- Text for context menu item to open the link in a private tab. -->
<string name="mozac_feature_contextmenu_open_link_in_private_tab">Open Link in Private Tab</string>

<string name="mozac_feature_contextmenu_open_link_in_private_tab">Open link in private tab</string>
<!-- Text for context menu item to open the image in a new tab. -->
<string name="mozac_feature_contextmenu_open_image_in_new_tab">Open Image in New Tab</string>

<string name="mozac_feature_contextmenu_open_image_in_new_tab">Open image in new tab</string>
<!-- Text for context menu item to share the link with an other app. -->
<string name="mozac_feature_contextmenu_share_link">Share Link</string>

<string name="mozac_feature_contextmenu_share_link">Share link</string>
<!-- Text for context menu item to copy the link to the clipboard. -->
<string name="mozac_feature_contextmenu_copy_link">Copy Link</string>

<string name="mozac_feature_contextmenu_copy_link">Copy link</string>
<!-- Text for context menu item to copy the URL pointing to the image to the clipboard. -->
<string name="mozac_feature_contextmenu_copy_image_location">Copy Image Location</string>

<string name="mozac_feature_contextmenu_copy_image_location">Copy image location</string>
<!-- Text for context menu item to save / download the image. -->
<string name="mozac_feature_contextmenu_save_image">Save Image</string>

<string name="mozac_feature_contextmenu_save_image">Save image</string>
<!-- Text for confirmation "snackbar" shown after opening a link in a new tab. -->
<string name="mozac_feature_contextmenu_snackbar_new_tab_opened">New tab opened</string>

<!-- Text for confirmation "snackbar" shown after opening a link in a new private tab. -->
<string name="mozac_feature_contextmenu_snackbar_new_private_tab_opened">New private tab opened</string>

<!-- Text for confirmation "snackbar" shown after copying a link or image URL to the clipboard. -->
<string name="mozac_feature_contextmenu_snackbar_text_copied">Text copied to clipboard</string>

<!-- Action shown in a "snacbkar" after opening a new/private tab. Clicking this action will switch to the newly opened tab. -->
<string name="mozac_feature_contextmenu_snackbar_action_switch">Switch</string>
</resources>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import android.net.Uri
import android.support.annotation.RequiresPermission
import android.widget.Toast
import mozilla.components.browser.session.Download
import mozilla.components.support.ktx.android.content.appName
import mozilla.components.support.ktx.android.content.isPermissionGranted
import mozilla.components.support.utils.DownloadUtils

Expand Down Expand Up @@ -155,7 +156,11 @@ class DownloadManager(
}

private fun showUnSupportFileErrorMessage() {
Toast.makeText(applicationContext, R.string.mozac_feature_downloads_file_not_supported, Toast.LENGTH_LONG)
val text = applicationContext.getString(
R.string.mozac_feature_downloads_file_not_supported2,
applicationContext.appName)

Toast.makeText(applicationContext, text, Toast.LENGTH_LONG)
.show()
}
}
Expand Down
13 changes: 5 additions & 8 deletions components/feature/downloads/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<!-- Alert dialog confirmation before download a file, this is the title. -->
<string name="mozac_feature_downloads_dialog_title">Download File</string>

<string name="mozac_feature_downloads_dialog_title">Download file</string>
<!-- Alert dialog confirmation before download a file, this is the positive action. -->
<string name="mozac_feature_downloads_dialog_download">Download</string>

<!-- Alert dialog confirmation before download a file, this is the negative action. -->
<string name="mozac_feature_downloads_dialog_cancel">Cancel</string>

<!-- Error shown when the user is trying to download a invalid file. -->
<string name="mozac_feature_downloads_file_not_supported">Download protocol not supported</string>
</resources>
<!-- Error shown when the user is trying to download a invalid file. %1$s will be replaced with the name of the app. -->
<string name="mozac_feature_downloads_file_not_supported2">%1$s can’t download this file type</string>
</resources>
23 changes: 4 additions & 19 deletions components/feature/prompts/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,54 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>
<!-- Text for confirmation for a positive action in dialog -->
<string name="mozac_feature_prompts_ok">OK</string>

<!-- Text for confirmation for a negative action in dialog. -->
<string name="mozac_feature_prompts_cancel">Cancel</string>

<!-- When a page shows many dialogs, this checkbox will appear for letting the user choose to prevent showing more dialogs. -->
<string name="mozac_feature_prompts_no_more_dialogs">Prevent this page from creating additional dialogs</string>

<!-- Title of a date picker dialog, this text is shown above a date picker. -->
<string name="mozac_feature_prompts_pick_a_date">Pick a date</string>

<!-- Title of a time picker dialog, this text is shown above a time picker. -->
<string name="mozac_feature_prompts_pick_a_time">Pick a time</string>

<!-- Title of a date and time picker dialog, this text is shown above the picker. -->
<string name="mozac_feature_prompts_pick_a_date_and_time">Pick a date and time</string>

<!-- Text for a positive button, when an user selects a date in date/time picker. -->
<string name="mozac_feature_prompts_set_date">Set</string>

<!-- Text for a button that clears the selected input in the date/time picker. -->
<string name="mozac_feature_prompts_clear">Clear</string>

<!-- Text for the title of an authentication dialog. -->
<string name="mozac_feature_prompt_sign_in">Sign In</string>

<string name="mozac_feature_prompt_sign_in">Sign in</string>
<!-- Text for username field in an authentication dialog. -->
<string name="mozac_feature_prompt_username_hint">Username</string>

<!-- Text for password field in an authentication dialog. -->
<string name="mozac_feature_prompt_password_hint">Password</string>

<!-- Text for a label for the field when prompt requesting a text is shown. -->
<!-- For more info take a look here https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt -->
<string name="mozac_feature_prompts_content_description_input_label">Label for entering a text input field</string>

<!-- Title of a color picker dialog, this text is shown above a color picker. -->
<string name="mozac_feature_prompts_choose_a_color">Choose a color</string>

<!-- Text of a confirm button in dialog requesting to open a new window. -->
<string name="mozac_feature_prompts_allow">Allow</string>

<!-- Text of a negative button in dialog requesting to open a new window. -->
<string name="mozac_feature_prompts_deny">Deny</string>

<!-- Text of the title of a dialog when a page is requesting to open a new window. -->
<string name="mozac_feature_prompts_popup_dialog_title">Prevent this site from opening this pop-up window?</string>
</resources>
<string name="mozac_feature_prompts_popup_dialog_title">Prevent this site from opening a pop-up window?</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ class SitePermissionsFeature(
}

private fun createDoNotAskAgainCheckBox(context: Context): CheckBox {
val doNotAskAgainTitle = context.getString(R.string.mozac_feature_sitepermissions_do_not_ask_again_on_this_site)
val doNotAskAgainTitle = context.getString(
R.string.mozac_feature_sitepermissions_do_not_ask_again_on_this_site2)
return CheckBox(doNotAskAgainTitle, true)
}

Expand Down Expand Up @@ -576,15 +577,15 @@ class SitePermissionsFeature(
private fun getCameraTextOptions(cameraPermissions: List<Permission>): Pair<String, String> {
val context = anchorView.context
val option1Text = if (cameraPermissions[0].isBackCamera) {
R.string.mozac_feature_sitepermissions_back_facing_camera
R.string.mozac_feature_sitepermissions_back_facing_camera2
} else {
R.string.mozac_feature_sitepermissions_selfie_camera
R.string.mozac_feature_sitepermissions_selfie_camera2
}

val option2Text = if (cameraPermissions[1].isBackCamera) {
R.string.mozac_feature_sitepermissions_back_facing_camera
R.string.mozac_feature_sitepermissions_back_facing_camera2
} else {
R.string.mozac_feature_sitepermissions_selfie_camera
R.string.mozac_feature_sitepermissions_selfie_camera2
}
return context.getString(option1Text) to context.getString(option2Text)
}
Expand Down
22 changes: 6 additions & 16 deletions components/feature/sitepermissions/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
<?xml version="1.0" encoding="utf-8"?><!-- This Source Code Form is subject to the terms of the Mozilla Public
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources>

<!-- Title of a dialog for a notification permission request. -->
<string name="mozac_feature_sitepermissions_notification_title">Allow %1$s to send notifications?</string>

<!-- Title of a dialog for a camera permission request. -->
<string name="mozac_feature_sitepermissions_camera_title">Allow %1$s to use your camera?</string>

<!-- Title of a dialog for a microphone permission request. -->
<string name="mozac_feature_sitepermissions_microfone_title">Allow %1$s to use your microphone?</string>

<!-- Title of a dialog for a location permission request. -->
<string name="mozac_feature_sitepermissions_location_title">Allow %1$s to use your location?</string>

<!-- Title of a dialog for a camera and microphone permission request. -->
<string name="mozac_feature_sitepermissions_camera_and_microphone">Allow %1$s to use your camera and microphone?</string>

<!-- Option in a dialog for requesting a microphone permission, this option will give access to
the first microphone-->
<string name="mozac_feature_sitepermissions_option_microphone_one">Microphone 1</string>

<!-- Option in a dialog for requesting a camera permission, this option will give access to
back facing camera-->
<string name="mozac_feature_sitepermissions_back_facing_camera">Back facing camera</string>

<string name="mozac_feature_sitepermissions_back_facing_camera2">Rear-facing camera</string>
<!-- Option in a dialog for requesting a camera permission, this option will give access to
front facing camera-->
<string name="mozac_feature_sitepermissions_selfie_camera">Selfie back camera</string>

<string name="mozac_feature_sitepermissions_selfie_camera2">Front-facing camera</string>
Amejia481 marked this conversation as resolved.
Show resolved Hide resolved
<!-- Text for a positive button in a permission request dialog, this button will give
access to this permission-->
<string name="mozac_feature_sitepermissions_allow">Allow</string>

<!-- Text for a negative button in a permission request dialog, this button will do not give
access to this permission-->
<string name="mozac_feature_sitepermissions_not_allow">Don’t allow</string>

<!-- Text for a checkbox in a permission request dialog, this will allow to not show again the prompt-->
<string name="mozac_feature_sitepermissions_do_not_ask_again_on_this_site">Don’t ask again on this site</string>
</resources>
<string name="mozac_feature_sitepermissions_do_not_ask_again_on_this_site2">Remember decision for this site</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ val Context.appVersionName: String?
return packageInfo.versionName
}

/**
* Returns the name (label) of the application or the package name as a fallback.
*/
val Context.appName: String
get() {
return packageManager.getApplicationLabel(applicationInfo)?.toString()
?: packageName
}

/**
* Returns the handle to a system-level service by name.
*/
Expand Down