11use std:: sync:: Arc ;
22
3+ use gettextrs:: gettext;
34use oo7:: { Key , ashpd:: WindowIdentifierType , dbus:: ServiceError } ;
45use serde:: { Deserialize , Serialize } ;
56use tokio:: sync:: OnceCell ;
@@ -11,6 +12,7 @@ use zbus::zvariant::{
1112use super :: secret_exchange;
1213use crate :: {
1314 error:: custom_service_error,
15+ i18n:: i18n_f,
1416 prompt:: { Prompt , PromptRole } ,
1517 service:: Service ,
1618} ;
@@ -156,16 +158,16 @@ impl Properties {
156158 fn for_lock ( keyring : & str , window_id : Option < & WindowIdentifierType > ) -> Self {
157159 Self {
158160 title : None ,
159- message : Some ( "Lock Keyring" . to_owned ( ) ) ,
160- description : Some ( format ! ( "Confirm locking '{keyring }' Keyring" ) ) ,
161+ message : Some ( gettext ( "Lock Keyring" ) ) ,
162+ description : Some ( i18n_f ( "Confirm locking '{}' Keyring" , & [ keyring ] ) ) ,
161163 warning : None ,
162164 password_new : None ,
163165 password_strength : None ,
164166 choice_label : None ,
165167 choice_chosen : None ,
166168 caller_window : window_id. map ( ToOwned :: to_owned) ,
167- continue_label : Some ( "Lock" . to_owned ( ) ) ,
168- cancel_label : Some ( "Cancel" . to_owned ( ) ) ,
169+ continue_label : Some ( gettext ( "Lock" ) ) ,
170+ cancel_label : Some ( gettext ( "Cancel" ) ) ,
169171 }
170172 }
171173
@@ -175,37 +177,39 @@ impl Properties {
175177 window_id : Option < & WindowIdentifierType > ,
176178 ) -> Self {
177179 Self {
178- title : Some ( "Unlock Keyring" . to_owned ( ) ) ,
179- message : Some ( "Authentication required" . to_owned ( ) ) ,
180- description : Some ( format ! (
181- "An application wants access to the keyring '{keyring}', but it is locked"
180+ title : Some ( gettext ( "Unlock Keyring" ) ) ,
181+ message : Some ( gettext ( "Authentication required" ) ) ,
182+ description : Some ( i18n_f (
183+ "An application wants access to the keyring '{}', but it is locked" ,
184+ & [ keyring] ,
182185 ) ) ,
183186 warning : warning. map ( ToOwned :: to_owned) ,
184187 password_new : None ,
185188 password_strength : None ,
186189 choice_label : None ,
187190 choice_chosen : None ,
188191 caller_window : window_id. map ( ToOwned :: to_owned) ,
189- continue_label : Some ( "Unlock" . to_owned ( ) ) ,
190- cancel_label : Some ( "Cancel" . to_owned ( ) ) ,
192+ continue_label : Some ( gettext ( "Unlock" ) ) ,
193+ cancel_label : Some ( gettext ( "Cancel" ) ) ,
191194 }
192195 }
193196
194197 fn for_create_collection ( label : & str , window_id : Option < & WindowIdentifierType > ) -> Self {
195198 Self {
196- title : Some ( "New Keyring Password" . to_owned ( ) ) ,
197- message : Some ( "Choose password for new keyring" . to_owned ( ) ) ,
198- description : Some ( format ! (
199- "An application wants to create a new keyring called '{label}'. Choose the password you want to use for it."
199+ title : Some ( gettext ( "New Keyring Password" ) ) ,
200+ message : Some ( gettext ( "Choose password for new keyring" ) ) ,
201+ description : Some ( i18n_f (
202+ "An application wants to create a new keyring called '{}'. Choose the password you want to use for it." ,
203+ & [ label] ,
200204 ) ) ,
201205 warning : None ,
202206 password_new : Some ( true ) ,
203207 password_strength : None ,
204208 choice_label : None ,
205209 choice_chosen : None ,
206210 caller_window : window_id. map ( ToOwned :: to_owned) ,
207- continue_label : Some ( "Create" . to_owned ( ) ) ,
208- cancel_label : Some ( "Cancel" . to_owned ( ) ) ,
211+ continue_label : Some ( gettext ( "Create" ) ) ,
212+ cancel_label : Some ( gettext ( "Cancel" ) ) ,
209213 }
210214 }
211215}
0 commit comments