Skip to content

Commit

Permalink
fix: string comma issue, finetune action menu label single line align…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
plateaukao committed Oct 6, 2024
1 parent a828a4e commit 899e643
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.AbstractComposeView
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.google.accompanist.drawablepainter.rememberDrawablePainter
Expand Down Expand Up @@ -168,3 +169,16 @@ fun ActionMenuItem(
}
}
}

@Preview
@Composable
fun PreviewActionMenuItem() {
MyTheme {
ActionMenuItem(
title = "Title",
iconDrawable = null,
onClicked = {},
onLongClicked = {},
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsPressedAsState
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -466,17 +467,24 @@ fun MenuItem(
)
}
}
Text(
Box(
modifier = Modifier
.fillMaxWidth()
.offset(y = if (showIcon) (-5).dp else 0.dp),
text = stringResource(id = titleResId),
textAlign = TextAlign.Center,
maxLines = 2,
lineHeight = if (!showIcon) 20.sp else 12.sp,
fontSize = fontSize,
color = MaterialTheme.colors.onBackground
)
.height(40.dp),
contentAlignment = Alignment.Center
) {
Text(
modifier = Modifier
.fillMaxWidth()
.offset(y = if (showIcon) (-5).dp else 10.dp),
text = stringResource(id = titleResId),
textAlign = TextAlign.Center,
maxLines = 2,
lineHeight = if (!showIcon) 20.sp else 12.sp,
fontSize = fontSize,
color = MaterialTheme.colors.onBackground
)
}
}
}

Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,6 @@
<string name="google_full_page">Google: Вся страница</string>
<string name="papago_dual_pane">Papago: В Режиме Разделённой Панели</string>
<string name="google_in_place">Google: На Месте</string>
<string name="setting_title_update_AdBlock">Обновить конфигурацию AdBlock</string>
<string name="setting_summary_update_AdBlock">Запустить обновление сайтов AdBlock</string>
<string name="setting_title_AdBlock_url">URL списка AdBlock</string>
<string name="setting_summary_AdBlock_URL">Если вы хотите использовать другую конфигурацию AdBlock, отредактируйте данный URL</string>
<string name="setting_title_AdBlock_auto_update">Автообновление AdBlock</string>
<string name="setting_summary_AdBlock_auto_update">Автоматически обновлять конфигурацию AdBlock каждую неделю</string>
<string name="toast_AdBlock_updated">AdBlock обновлён!</string>
<string name="toast_backup_successful">Резервная копия успешно создана!</string>
<string name="setting_title_enable_ssl_error_dialog">Показывать окно ошибок SSL</string>
<string name="setting_summary_enable_ssl_error_dialog">Показывать окно ошибки, когда что-то идёт не так с SSL</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<string name="setting_summary_nav_pos_right">Right</string>
<string name="setting_summary_nav_pos_left">Left</string>
<string name="setting_summary_nav_pos_center">Center</string>
<string name="setting_summary_nav_pos_not_show">Don't Show</string>
<string name="setting_summary_nav_pos_not_show">Don\'t Show</string>
<string name="setting_summary_nav_pos_custom">Custom</string>

<string name="setting_summary_tab">What should be shown at the start of the \"Overview\"? (start page, your bookmarks...)</string>
Expand Down Expand Up @@ -337,7 +337,7 @@
<string name="menu_receive">Receive data</string>
<string name="copy_link">Copy link</string>
<string name="setting_title_background_loading">Load non-active tabs</string>
<string name="setting_summary_background_loading">If tab is not activated, still load it's content in background</string>
<string name="setting_summary_background_loading">If tab is not activated, still load it\'s content in background</string>
<string name="dialog_content_ssl_error">The certificate of the site is not trusted. Proceed anyway?</string>
<string name="setting_title_search">Search</string>
<string name="dialog_toc_title">Table of Contents</string>
Expand Down

2 comments on commit 899e643

@Myron472
Copy link
Contributor

@Myron472 Myron472 commented on 899e643 Oct 6, 2024

Choose a reason for hiding this comment

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

Were these 7 strings in Russian translation file deleted intentionally?
Also ' symbol is called apostrophe (when used inside of words).

@plateaukao
Copy link
Owner Author

@plateaukao plateaukao commented on 899e643 Oct 7, 2024

Choose a reason for hiding this comment

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

Yes, I checked that they are non-used resources.
But seems not the case. Let me verify again. Sorry for that.

Oh, I found out why. The label should not be xxxx_AdBlock. they all should be xxx_adblock.
That's why they are listed as not used resources. I'll add back correct ones.

Please sign in to comment.