mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
make string 123 MiB of 456 MiB used translatable (#2723)
This commit is contained in:
@@ -314,6 +314,9 @@ pub enum StockMessage {
|
||||
|
||||
#[strum(props(fallback = "Broadcast List"))]
|
||||
BroadcastList = 115,
|
||||
|
||||
#[strum(props(fallback = "%1$s of %2$s used"))]
|
||||
PartOfTotallUsed = 116,
|
||||
}
|
||||
|
||||
impl StockMessage {
|
||||
@@ -988,6 +991,18 @@ pub(crate) async fn messages(context: &Context) -> String {
|
||||
translated(context, StockMessage::Messages).await
|
||||
}
|
||||
|
||||
/// Stock string: `%1$s of %2$s used`.
|
||||
pub(crate) async fn part_of_total_used(
|
||||
context: &Context,
|
||||
part: impl AsRef<str>,
|
||||
total: impl AsRef<str>,
|
||||
) -> String {
|
||||
translated(context, StockMessage::PartOfTotallUsed)
|
||||
.await
|
||||
.replace1(part)
|
||||
.replace2(total)
|
||||
}
|
||||
|
||||
/// Stock string: `Broadcast List`.
|
||||
/// Used as the default name for broadcast lists; a number may be added.
|
||||
pub(crate) async fn broadcast_list(context: &Context) -> String {
|
||||
|
||||
Reference in New Issue
Block a user