#274-android-l10n: Update create account string to avoid partial translations. (#16065)

Co-authored-by: mcarare <mihai.carare.dev@gmail.com>
This commit is contained in:
liuche 2020-10-20 14:56:40 -07:00 committed by GitHub
parent e514ede697
commit bc5f0ac7e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 17 deletions

View File

@ -6,7 +6,6 @@ package org.mozilla.fenix.settings.account
import android.Manifest
import android.os.Bundle
import android.text.Spanned
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -26,7 +25,6 @@ import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.addUnderline
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.ext.showToolbar
@ -125,17 +123,10 @@ class TurnOnSyncFragment : Fragment(), AccountObserver {
DefaultSyncController(activity = activity as HomeActivity)
)
val createAccountActionText = getString(R.string.sign_in_create_account_link)
val fullText = getString(R.string.sign_in_create_account_text, createAccountActionText)
val spanStart = fullText.indexOf(createAccountActionText, 0, false)
val spanEnd = spanStart + createAccountActionText.length
view.createAccount.apply {
text = fullText
addUnderline(
spanStart,
spanEnd,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
text = HtmlCompat.fromHtml(
getString(R.string.sign_in_create_account_text),
HtmlCompat.FROM_HTML_MODE_LEGACY
)
setOnClickListener(createAccountClickListener)
}

View File

@ -1144,11 +1144,8 @@
<string name="sign_in_with_camera">Sign in with your camera</string>
<!-- Text shown for settings option for sign with email -->
<string name="sign_in_with_email">Use email instead</string>
<!-- Text shown for settings option for create new account description.
'Firefox' intentionally hardcoded here. %s is to be replaced with the create account link text-->
<string name="sign_in_create_account_text">No account? %s to sync Firefox between devices.</string>
<!--Text shown for settings option for create new account link -->
<string name="sign_in_create_account_link">Create one</string>
<!-- Text shown for settings option for create new account text.'Firefox' intentionally hardcoded here.-->
<string name="sign_in_create_account_text"><![CDATA[No account? <u>Create one</u> to sync Firefox between devices.]]></string>
<!-- Text shown in confirmation dialog to sign out of account -->
<string name="sign_out_confirmation_message">Firefox will stop syncing with your account, but wont delete any of your browsing data on this device.</string>
<!-- Text shown in confirmation dialog to sign out of account. The first parameter is the name of the app (e.g. Firefox Preview) -->