Skip to content

Commit

Permalink
make translations a bit better to handle
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Dec 10, 2023
1 parent e60525f commit 3dcf2df
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 39 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,9 @@ fun App()
update = { }
)
UIScaleItem(
label = i18n("UI Scale"),
description = "${i18n("current_value:")}: "
+ " " + ui_scale + ", " + i18n("drag Slider to change")) {
label = i18n("ui.ui_scale"),
description = "${i18n("ui.current_value")}: "
+ " " + ui_scale + ", " + i18n("ui.drag_slider_to_change")) {
Row(horizontalArrangement = Arrangement.spacedBy(2.dp),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.width(200.dp)) {
Expand Down Expand Up @@ -1529,7 +1529,7 @@ private fun MainAppStart()
{
Dialog(
onCloseRequest = { isAskingToClose = false },
title = i18n("Close TRIfA ?"),
title = i18n("ui.close_trifa"),
) {
Button(onClick = {
if (tox_running_state_wrapper == "running")
Expand All @@ -1554,7 +1554,7 @@ private fun MainAppStart()
closing_application = true
}
}) {
Text(i18n("Yes"))
Text(i18n("ui.yes"))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ import java.io.File
@Composable
fun SettingDetails()
{
SettingDetail(i18n("Settings")) {/*
SettingDetail(i18n("ui.settings_headline")) {/*
// val dummylist = listOf("Sue Helen", "JR", "Pamela")
DetailItem(label = i18n("settings.display.theme.title"), description = "${i18n("access.settings.current_value")}: " + i18n("settings.display.theme") + // NON-NLS
", " + i18n("access.settings.click_to_change_value")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun ContactList(
state = scrollState,
modifier = Modifier
.semantics {
contentDescription = i18n("access.contact.list")
contentDescription = i18n("ui.access_contact_list")
}
.selectableGroup()
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun GroupList(
state = scrollState,
modifier = Modifier
.semantics {
contentDescription = i18n("access.group.list")
contentDescription = i18n("ui.access_group_list")
}
.selectableGroup()
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fun GroupPeerList(
state = scrollState,
modifier = Modifier
.semantics {
contentDescription = i18n("access.grouppeer.list")
contentDescription = i18n("ui.access_group_peerlist")
}
.selectableGroup()
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fun BriarSidebarButton(
)
} else if (sideBarButtonState is Warning)
{
Icon(Icons.Default.Error, i18n("mailbox.status.problem"), modifier = Modifier.offset((-12).dp, 12.dp).size(16.dp), tint = MaterialTheme.colors.error)
Icon(Icons.Default.Error, i18n("ui.generic_error"), modifier = Modifier.offset((-12).dp, 12.dp).size(16.dp), tint = MaterialTheme.colors.error)
}
},
) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/org/briarproject/briar/desktop/ui/AboutScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fun AboutScreen(

IconButton(
icon = Icons.Filled.ArrowBack,
contentDescription = i18n("access.return_to_previous_screen"),
contentDescription = i18n("ui.return_to_previous_screen"),
onClick = onBackButton,
modifier = Modifier.align(TopStart)
)
Expand All @@ -88,7 +88,7 @@ fun AboutScreen(modifier: Modifier = Modifier.padding(16.dp)) {
)
}
var state by remember { mutableStateOf(0) }
val titles = listOf(i18n("about.category.general"), i18n("about.category.dependencies"))
val titles = listOf(i18n("ui.about.category_general"), i18n("ui.about.category_dependencies"))
TabRow(selectedTabIndex = state, backgroundColor = MaterialTheme.colors.background) {
titles.forEachIndexed { index, title ->
Tab(
Expand Down Expand Up @@ -197,7 +197,7 @@ private fun GeneralInfo() {
VerticallyScrollableArea { scrollState ->
LazyColumn(
modifier = Modifier.semantics {
contentDescription = i18n("access.about.list.general")
contentDescription = i18n("ui.about.list_general")
},
state = scrollState
) {
Expand Down Expand Up @@ -252,7 +252,7 @@ private fun AboutEntry(entry: Entry) =
val clipboardManager = LocalClipboardManager.current
IconButton(
icon = Icons.Filled.ContentCopy,
contentDescription = i18n("copy"),
contentDescription = i18n("ui.copy"),
onClick = {
clipboardManager.setText(AnnotatedString(entry.value))
}
Expand All @@ -267,7 +267,7 @@ private fun Libraries() {
VerticallyScrollableArea { scrollState ->
LazyColumn(
modifier = Modifier.semantics {
contentDescription = i18n("access.about.list.dependencies")
contentDescription = i18n("ui.about.list_dependencies")
},
state = scrollState
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import org.briarproject.briar.desktop.utils.InternationalizationUtils.i18n
@Composable
fun ExplainerChat() {
Theme {
Explainer(headline = i18n("No Contacts selected"), text = i18n("Select a Contact to start chatting"))
Explainer(headline = i18n("ui.no_contacts_selected"), text = i18n("ui.select_contact_to_start_chatting"))
}
}

val PARAGRAPH_WIDTH = 540.dp

@Composable
fun ExplainerToxNotRunning() =
Explainer(headline = InternationalizationUtils.i18n("Tox is not running"), text = InternationalizationUtils.i18n("press the <start> button"))
Explainer(headline = i18n("ui.tox_is_not_running"), text = i18n("ui.press_the_start_button"))
{}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import org.briarproject.briar.desktop.utils.InternationalizationUtils.i18n
fun ExplainerGroup()
{
Theme {
Explainer(headline = i18n("No Groups selected"), text = i18n("Select a Group to start chatting"))
Explainer(headline = i18n("ui.no_groups_selected"), text = i18n("ui.select_group_to_start_chatting"))
}
}
32 changes: 26 additions & 6 deletions src/main/resources/strings/trifa_material.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@
# TRIfA Material
# Copyright (C) 2023 Zoff
#

# Miscellaneous
Yes=Yes
Close\ TRIfA\ ?=Close TRIfA ?
No\ Contacts\ selected=No Contacts selected
Select\ a\ Contact\ to\ start\ chatting=Select a Contact to start chatting
ui.yes=Yes
ui.settings_headline=Settings
ui.close_trifa=Close TRIfA ?
ui.access_contact_list=Access Contactlist
ui.access_group_list=Access Grouplist
ui.access_group_peerlist=Access Group Peerlist
ui.no_contacts_selected=No Contacts selected
ui.generic_error=some Error
ui.copy=copy
ui.about.category_general=General
ui.about.list_general=General
ui.about.list_dependencies=Dependencies
ui.about.category_dependencies=Dependencies
ui.return_to_previous_screen=return to previous screen
ui.ui_scale=UI Scale
ui.current_value=current value
ui.drag_slider_to_change=drag Slider to change
ui.tox_is_not_running=Tox is not running
ui.no_groups_selected=No Groups selected
ui.select_group_to_start_chatting=Select a Group to start chatting
ui.press_the_start_button=press the <start> button
ui.select_contact_to_start_chatting=Select a Contact to start chatting
access.list.selected.yes=selected
access.list.selected.no=not selected
access.logo=logo
about.trifa_material_version=TRIfA Material Version
9 changes: 6 additions & 3 deletions src/main/resources/strings/trifa_material_de.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Miscellaneous
Yes=Ja
Close\ TRIfA\ ?=TRIfA schliessen ?
#
# TRIfA Material
# Copyright (C) 2023 Zoff
#
ui.yes=Ja
ui.close_trifa=TRIfA schliessen ?
11 changes: 6 additions & 5 deletions src/main/resources/strings/trifa_material_nb_NO.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@


# Miscellaneous
Yes=Ja
Close\ TRIfA\ ?=Lukk TRIfA?
#
# TRIfA Material
# Copyright (C) 2023 Zoff
#
ui.yes=Ja
ui.close_trifa=Lukk TRIfA?
15 changes: 8 additions & 7 deletions src/main/resources/strings/trifa_material_pl.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@


# Miscellaneous
Yes=Tak
Close\ TRIfA\ ?=Zamknąć TRIfA?
Select\ a\ Contact\ to\ start\ chatting=Wybierz kontakt, aby rozpocząć rozmowę
No\ Contacts\ selected=Nie wybrano żadnego kontaktu
#
# TRIfA Material
# Copyright (C) 2023 Zoff
#
ui.yes=Tak
ui.close_trifa=Zamknąć TRIfA?
ui.select_contact_to_start_chatting=Wybierz kontakt, aby rozpocząć rozmowę
ui.no_contacts_selected=Nie wybrano żadnego kontaktu

0 comments on commit 3dcf2df

Please sign in to comment.