Skip to content

String duplicate #1454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 29, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import io.element.android.libraries.designsystem.theme.components.TextButton
import io.element.android.libraries.matrix.api.auth.OidcDetails
import io.element.android.libraries.testtags.TestTags
import io.element.android.libraries.testtags.testTag
import io.element.android.libraries.ui.strings.CommonStrings

@Composable
fun ConfirmAccountProviderView(
Expand Down Expand Up @@ -86,7 +87,7 @@ fun ConfirmAccountProviderView(
footer = {
ButtonColumnMolecule {
Button(
text = stringResource(id = R.string.screen_account_provider_continue),
text = stringResource(id = CommonStrings.action_continue),
showProgress = isLoading,
onClick = { eventSink.invoke(ConfirmAccountProviderEvents.Continue) },
enabled = state.submitEnabled || isLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fun LoginPasswordView(
Spacer(modifier = Modifier.weight(1f))
// Submit
Button(
text = stringResource(R.string.screen_login_submit),
text = stringResource(CommonStrings.action_continue),
showProgress = isLoading,
onClick = ::submit,
enabled = state.submitEnabled || isLoading,
Expand Down Expand Up @@ -199,7 +199,7 @@ internal fun LoginForm(
eventSink(LoginPasswordEvents.SetLogin(it))
}),
placeholder = {
Text(text = stringResource(R.string.screen_login_username_hint))
Text(text = stringResource(CommonStrings.common_username))
},
onValueChange = {
loginFieldState = it
Expand Down Expand Up @@ -246,7 +246,7 @@ internal fun LoginForm(
eventSink(LoginPasswordEvents.SetPassword(it))
},
placeholder = {
Text(text = stringResource(R.string.screen_login_password_hint))
Text(text = stringResource(CommonStrings.common_password))
},
visualTransformation = if (passwordVisible) VisualTransformation.None else PasswordVisualTransformation(),
trailingIcon = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.theme.components.ModalBottomSheet
import io.element.android.libraries.designsystem.theme.components.Text
import io.element.android.libraries.theme.ElementTheme
import io.element.android.libraries.ui.strings.CommonStrings
import kotlinx.coroutines.launch

@Composable
Expand Down Expand Up @@ -133,7 +134,7 @@ private fun ColumnScope.RetrySendMenuContents(
ListItem(
headlineContent = {
Text(
text = stringResource(R.string.screen_room_retry_send_menu_remove_action),
text = stringResource(CommonStrings.action_remove),
style = ElementTheme.typography.fontBodyLgRegular,
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.PreviewParameter
import io.element.android.features.preferences.impl.R
import io.element.android.libraries.designsystem.components.preferences.PreferenceSwitch
import io.element.android.libraries.designsystem.components.preferences.PreferenceView
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import io.element.android.libraries.designsystem.preview.ElementPreview
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
import io.element.android.libraries.ui.strings.CommonStrings

@Composable
Expand All @@ -39,16 +40,13 @@ fun AdvancedSettingsView(
) {
PreferenceSwitch(
title = stringResource(id = CommonStrings.common_rich_text_editor),
// TODO i18n
subtitle = "Disable the rich text editor to type Markdown manually",
subtitle = stringResource(id = R.string.screen_advanced_settings_rich_text_editor_description),
isChecked = state.isRichTextEditorEnabled,
onCheckedChange = { state.eventSink(AdvancedSettingsEvents.SetRichTextEditorEnabled(it)) },
)
PreferenceSwitch(
// TODO i18n
title = "Developer mode",
// TODO i18n
subtitle = "The developer mode activates hidden features. For developers only!",
title = stringResource(id = R.string.screen_advanced_settings_developer_mode),
subtitle = stringResource(id = R.string.screen_advanced_settings_developer_mode_description),
isChecked = state.isDeveloperModeEnabled,
onCheckedChange = { state.eventSink(AdvancedSettingsEvents.SetDeveloperModeEnabled(it)) },
)
Expand Down
3 changes: 3 additions & 0 deletions features/preferences/impl/src/main/res/values/localazy.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="screen_advanced_settings_developer_mode">"Developer mode"</string>
<string name="screen_advanced_settings_developer_mode_description">"Enable to have access to features and functionality for developers."</string>
<string name="screen_advanced_settings_rich_text_editor_description">"Disable the rich text editor to type Markdown manually."</string>
<string name="screen_edit_profile_display_name">"Display name"</string>
<string name="screen_edit_profile_display_name_placeholder">"Your display name"</string>
<string name="screen_edit_profile_error">"An unknown error was encountered and the information couldn\'t be changed."</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ internal fun MembersSection(
) {
PreferenceCategory(modifier = modifier) {
PreferenceText(
title = stringResource(R.string.screen_room_details_people_title),
title = stringResource(CommonStrings.common_people),
icon = Icons.Outlined.Person,
currentValue = memberCount.toString(),
onClick = openRoomMemberList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private fun RoomMemberListTopBar(
modifier = modifier,
title = {
Text(
text = stringResource(R.string.screen_room_details_people_title),
text = stringResource(CommonStrings.common_people),
style = ElementTheme.typography.aliasScreenTitle,
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal fun HeaderContent(verificationFlowStep: FlowStep, modifier: Modifier =
}
val titleTextId = when (verificationFlowStep) {
FlowStep.Initial -> R.string.screen_session_verification_open_existing_session_title
FlowStep.Canceled -> R.string.screen_session_verification_cancelled_title
FlowStep.Canceled -> CommonStrings.common_verification_cancelled
FlowStep.AwaitingOtherDeviceResponse -> R.string.screen_session_verification_waiting_to_accept_title
FlowStep.Ready, is FlowStep.Verifying, FlowStep.Completed -> R.string.screen_session_verification_compare_emojis_title
}
Expand Down Expand Up @@ -190,7 +190,7 @@ internal fun BottomMenu(screenState: VerifySelfSessionState, goBack: () -> Unit)
R.string.screen_session_verification_they_match
}
}
FlowStep.Ready -> R.string.screen_session_verification_positive_button_ready
FlowStep.Ready -> CommonStrings.action_start
else -> null
}
val negativeButtonTitle = when (verificationViewState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import android.os.Build
import androidx.annotation.ChecksSdkIntAtLeast
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.BlurredEdgeTreatment
import androidx.compose.ui.draw.blur
import androidx.compose.ui.draw.drawBehind
Expand Down Expand Up @@ -94,8 +93,8 @@ fun Modifier.blurredShapeShadow(
fun Modifier.blurCompat(
radius: Dp,
edgeTreatment: BlurredEdgeTreatment = BlurredEdgeTreatment.Rectangle
): Modifier = composed {
when {
): Modifier {
return when {
radius.value == 0f -> this
canUseBlur() -> blur(radius, edgeTreatment)
else -> this // Added in case we find a way to make this work on older devices
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tools/lint/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@

<!-- DI -->
<!-- issue id="JvmStaticProvidesInObjectDetector" severity="error" /-->

<!-- Compose -->
<issue id="UnnecessaryComposedModifier" severity="error" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit (a lot) unrelated, but since I was looking at lint reports, I took the opportunity to also change this, in a dedicated commit.

</lint>
1 change: 1 addition & 0 deletions tools/localazy/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
{
"name": ":features:preferences:impl",
"includeRegex": [
"screen_advanced_settings_.*",
"screen_edit_profile_.*"
]
},
Expand Down