misc: Various improvements to strings

This commit is contained in:
Kévin Commaille 2023-11-02 12:22:15 +01:00
parent f2a2d0cae1
commit 3a973fc80a
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416
20 changed files with 52 additions and 38 deletions

View File

@ -74,7 +74,8 @@
<property name="wrap">True</property>
<property name="wrap-mode">word-char</property>
<property name="justify">center</property>
<property name="label" translatable="yes" comments="Fractal is the application name and shouldn't be translated">Welcome to Fractal</property>
<!-- Translators: Fractal is the application name. -->
<property name="label" translatable="yes">Welcome to Fractal</property>
<style>
<class name="title-1"/>
</style>

View File

@ -931,6 +931,7 @@ impl Room {
/// The display name of this room.
pub fn display_name(&self) -> String {
let display_name = self.imp().name.borrow().clone();
// Translators: This is displayed when the room name is unknown yet.
display_name.unwrap_or_else(|| gettext("Unknown"))
}

View File

@ -174,7 +174,7 @@ impl NotificationsPage {
error!("Could not deserialize push rules: {error}");
toast!(
self,
gettext("Could not load notifications settings. Try again later")
gettext("Could not load notifications settings. Try again later.")
);
}
},
@ -187,7 +187,7 @@ impl NotificationsPage {
error!("Could not get push rules: {error}");
toast!(
self,
gettext("Could not load notifications settings. Try again later")
gettext("Could not load notifications settings. Try again later.")
);
}
}

View File

@ -207,8 +207,10 @@ impl ImportExportKeysSubpage {
let imp = self.imp();
if self.mode() == KeysSubpageMode::Export {
// Translators: 'Room encryption keys' are encryption keys for all rooms.
self.set_title(&gettext("Export Room Encryption Keys"));
imp.description.set_label(&gettext(
// Translators: 'Room encryption keys' are encryption keys for all rooms.
"Exporting your room encryption keys allows you to make a backup to be able to decrypt your messages in end-to-end encrypted rooms on another device or with another Matrix client.",
));
imp.instructions.set_label(&gettext(
@ -217,8 +219,10 @@ impl ImportExportKeysSubpage {
imp.confirm_passphrase_box.set_visible(true);
imp.proceed_button.set_label(&gettext("Export Keys"));
} else {
// Translators: 'Room encryption keys' are encryption keys for all rooms.
self.set_title(&gettext("Import Room Encryption Keys"));
imp.description.set_label(&gettext(
// Translators: 'Room encryption keys' are encryption keys for all rooms.
"Importing your room encryption keys allows you to decrypt your messages in end-to-end encrypted rooms with a previous backup from a Matrix client.",
));
imp.instructions.set_label(&gettext(

View File

@ -167,10 +167,12 @@ fn update_cross_signing_key_status(label: &gtk::Label, available: bool) {
if available {
label.add_css_class("success");
label.remove_css_class("error");
// Translators: As in "The signing key is available".
label.set_text(&gettext("Available"));
} else {
label.add_css_class("error");
label.remove_css_class("success");
// Translators: As in "The signing key is not available".
label.set_text(&gettext("Not available"));
}
}

View File

@ -6,9 +6,11 @@
<property name="name">security</property>
<child>
<object class="AdwPreferencesGroup">
<!-- Translators: 'Room encryption keys' are encryption keys for all rooms. -->
<property name="title" translatable="yes">Room Encryption Keys</property>
<child>
<object class="ComponentsButtonRow">
<!-- Translators: 'Room encryption keys' are encryption keys for all rooms. -->
<property name="title" translatable="yes">Export Room Encryption Keys</property>
<property name="to-subpage">true</property>
<signal name="activated" handler="show_export_keys_page" swapped="yes"/>
@ -16,6 +18,7 @@
</child>
<child>
<object class="ComponentsButtonRow">
<!-- Translators: 'Room encryption keys' are encryption keys for all rooms. -->
<property name="title" translatable="yes">Import Room Encryption Keys</property>
<property name="to-subpage">true</property>
<signal name="activated" handler="handle_import_keys" swapped="yes"/>

View File

@ -205,6 +205,7 @@ impl PublicRoomRow {
fn update_button(&self, public_room: &PublicRoom) {
let button = &self.imp().button;
if public_room.room().is_some() {
// Translators: This is a verb, as in 'View Room'.
button.set_label(&gettext("View"));
} else {
button.set_label(&gettext("Join"));

View File

@ -9,6 +9,7 @@
<object class="AdwHeaderBar">
<child type="title">
<object class="AdwWindowTitle">
<!-- Translators: This is a verb. -->
<property name="title" translatable="yes">Invite</property>
</object>
</child>
@ -34,6 +35,7 @@
<property name="spacing">24</property>
<property name="orientation">vertical</property>
<accessibility>
<!-- Translators: This is a verb. -->
<property name="label" translatable="yes">Invite</property>
</accessibility>
<child>

View File

@ -83,6 +83,7 @@
<object class="AdwStatusPage" id="no_search_page">
<property name="vexpand">True</property>
<property name="icon-name">system-search-symbolic</property>
<!-- Translators: In this string, this is a verb. -->
<property name="title" translatable="yes">Search</property>
<property name="description" translatable="yes">Search for users to invite them to this room.</property>
</object>

View File

@ -60,6 +60,7 @@
</child>
<child>
<object class="GtkLabel">
<!-- Translators: This is a verb. -->
<property name="label" translatable="yes">Invite</property>
</object>
</child>

View File

@ -20,7 +20,8 @@
<attribute name="hidden-when">action-missing</attribute>
</item>
<item>
<!-- Translators: In this string, 'Forward' is a verb. -->
<!-- Translators: In this string, 'Forward' is a verb, this is to
re-send the same message in another room, like forwarding an e-mail. -->
<attribute name="label" translatable="yes">_Forward</attribute>
<attribute name="action">event.forward</attribute>
<attribute name="hidden-when">action-missing</attribute>

View File

@ -371,7 +371,7 @@ fn build_content(
parent.set_child(Some(&child));
child
};
child.with_text(gettext("This message was redacted."), format);
child.with_text(gettext("This message was removed."), format);
}
content => {
warn!("Unsupported event content: {content:?}");

View File

@ -113,7 +113,9 @@
<property name="bottom-margin">7</property>
<property name="wrap-mode">word</property>
<accessibility>
<property name="label" translatable="yes">Message Entry</property>
<!-- Translators: This is the name of the input widget where messages
are entered before being sent, for accessibility tools. -->
<property name="label" translatable="yes">Message Composer</property>
</accessibility>
</object>
</property>

View File

@ -120,6 +120,7 @@ impl StateTombstone {
fn update_button_label(&self, room: &Room) {
let button = &self.imp().new_room_btn;
if room.successor().is_some() {
// Translators: This is a verb, as in 'View Room'.
button.set_label(&gettext("View"));
} else {
button.set_label(&gettext("Join"));

View File

@ -3,7 +3,7 @@ use gtk::{glib, glib::clone, prelude::*, CompositeTemplate};
use crate::{
components::{Avatar, OverlappingBox},
i18n::{gettext_f, ngettext_f},
i18n::ngettext_f,
prelude::*,
session::model::{Member, TypingList},
utils::BoundObjectWeakRef,
@ -162,43 +162,24 @@ impl TypingRow {
}
fn update_label(&self, list: &TypingList) {
let len = list.n_items();
if len == 0 {
let n = list.n_items();
if n == 0 {
// Don't update anything, the `is-empty` property should trigger a revealer
// animation.
return;
}
let members = list.members();
let user = members[0].display_name();
let label = if len == 1 {
let user = members[0].display_name();
// Translators: Do NOT translate the content between '{' and '}', this is a
// variable name.
gettext_f("<b>{user}</b> is typing…", &[("user", &user)])
} else {
let user1 = members[0].display_name();
let user2 = members[1].display_name();
let n = len - 2;
if n == 0 {
gettext_f(
// Translators: Do NOT translate the content between '{' and '}', these are
// variable names.
"<b>{user1}</b> and <b>{user2}</b> are typing…",
&[("user1", &user1), ("user2", &user2)],
)
} else {
ngettext_f(
// Translators: Do NOT translate the content between '{' and '}', these are
// variable names.
"<b>{user1}</b>, <b>{user2}</b> and 1 other are typing…",
"<b>{user1}</b>, <b>{user2}</b> and {n} others are typing…",
n,
&[("user1", &user1), ("user2", &user2), ("n", &n.to_string())],
)
}
};
let label = ngettext_f(
// Translators: Do NOT translate the content between '{' and '}', these are
// variable names.
"<b>{user}</b> is typing…",
"{n} members are typing…",
n,
&[("user", &user), ("n", &n.to_string())],
);
self.imp().label.set_label(&label);
}
}

View File

@ -288,6 +288,7 @@
</child>
<child>
<object class="SpinnerButton" id="emoji_not_match_btn">
<!-- Translators: During emoji comparison, this is the label of the button to click when the emojis do not match. -->
<property name="label" translatable="yes">Do Not Match</property>
<property name="halign">center</property>
<style>
@ -298,6 +299,7 @@
</child>
<child>
<object class="SpinnerButton" id="emoji_match_btn">
<!-- Translators: During emoji comparison, this is the label of the button to click when the emojis match. -->
<property name="label" translatable="yes">Match</property>
<property name="halign">center</property>
<style>

View File

@ -51,6 +51,7 @@
<object class="AdwStatusPage">
<property name="vexpand">True</property>
<property name="icon-name">system-search-symbolic</property>
<!-- Translators: In this string, this is a verb. -->
<property name="title" translatable="yes">Search</property>
<property name="description" translatable="yes">Search for people to start a new chat with</property>
</object>

View File

@ -140,6 +140,7 @@ impl JoinRoomDialog {
.joined_room((&*room_id).into())
.is_some()
{
// Translators: This is a verb, as in 'View Room'.
self.set_response_label("join", &gettext("_View"));
} else {
self.set_response_label("join", &gettext("_Join"));

View File

@ -151,8 +151,12 @@ impl CategoryRow {
let label = match from_type {
CategoryType::Invited => match to_type {
// Translators: This is an action to join a room and put it in the "Favorites"
// section.
CategoryType::Favorite => gettext("Join Room as Favorite"),
CategoryType::Normal => gettext("Join Room"),
// Translators: This is an action to join a room and put it in the "Low Priority"
// section.
CategoryType::LowPriority => gettext("Join Room as Low Priority"),
CategoryType::Left => gettext("Reject Invite"),
CategoryType::Direct => gettext("Join Room as People"),
@ -180,8 +184,12 @@ impl CategoryRow {
_ => to_type.to_string(),
},
CategoryType::Left => match to_type {
CategoryType::Favorite => gettext("Rejoin Room as Favorites"),
// Translators: This is an action to rejoin a room and put it in the "Favorites"
// section.
CategoryType::Favorite => gettext("Rejoin Room as Favorite"),
CategoryType::Normal => gettext("Rejoin Room"),
// Translators: This is an action to rejoin a room and put it in the "Low Priority"
// section.
CategoryType::LowPriority => gettext("Rejoin Room as Low Priority"),
CategoryType::Direct => gettext("Rejoin Room as People"),
_ => to_type.to_string(),

View File

@ -23,6 +23,7 @@
</child>
<child>
<object class="GtkShortcutsShortcut">
<!-- Translators: This shows and focuses the search input to find a room by its name in the room list. -->
<property name="title" translatable="yes" context="shortcut window">Search Room List</property>
<property name="accelerator">&lt;ctrl&gt;K</property>
</object>