Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upLocalize the UWP UI #26665
Localize the UWP UI #26665
Comments
I only found strings in libsimpleservo/api. A few prompts and how the title is formatted. Also some resources need to be translated. The API to request the resources to the embedder is already in place, but not implemented on the C side. |
diff --git a/ports/libsimpleservo/api/src/lib.rs b/ports/libsimpleservo/api/src/lib.rs
index 7dd1881243..7df706ba5e 100644
--- a/ports/libsimpleservo/api/src/lib.rs
+++ b/ports/libsimpleservo/api/src/lib.rs
@@ -585,12 +585,14 @@ impl ServoGlue {
let fallback_title: String = if let Some(ref current_url) = self.current_url {
current_url.to_string()
} else {
+ // FIXME:L10N
String::from("Untitled")
};
let title = match title {
Some(ref title) if title.len() > 0 => &**title,
_ => &fallback_title,
};
+ // FIXME:L10N
let title = format!("{} - Servo", title);
self.callbacks.host_callbacks.on_title_changed(title);
},
@@ -702,9 +704,11 @@ impl ServoGlue {
EmbedderMsg::PromptPermission(prompt, sender) => {
let message = match prompt {
PermissionPrompt::Request(permission_name) => {
+ // FIXME:L10N
format!("Do you want to grant permission for {:?}?", permission_name)
},
PermissionPrompt::Insecure(permission_name) => {
+ // FIXME:L10N
format!(
"The {:?} feature is only safe to use in secure context, but servo can't guarantee\n\
that the current context is secure. Do you want to proceed and grant permission?",
@@ -824,6 +828,7 @@ impl EmbedderMethods for ServoEmbedderCallbacks {
let (sender, receiver) = ipc::channel().unwrap();
self.0.send((
None,
+ // FIXME:L10N
EmbedderMsg::ShowContextMenu(
sender,
Some("Would you like to exit the XR session?".into()),
@@ -870,6 +875,7 @@ impl EmbedderMethods for ServoEmbedderCallbacks {
);
registry.register(discovery);
} else {
+ // FIXME:L10N
let msg =
"Cannot initialize OpenXR - please ensure runtime is installed and enabled in \
the OpenXR developer portal app.\n\nImmersive mode will not function until \
@@ -956,6 +962,7 @@ impl ResourceReaderInstance {
}
impl ResourceReaderMethods for ResourceReaderInstance {
+ // FIXME:L10N
fn read(&self, res: Resource) -> Vec<u8> {
Vec::from(match res {
Resource::Preferences => &include_bytes!("../../../../resources/prefs.json")[..], |
|
Yeah for the rust side stuff I was thinking we'd have an embedder hook |
|
There's also the |
|
We display the NetworkError::SslValidation and NetworkError::Internal errors which come from the hyper and http crates. I'll see how we can handle these correctly. I think we can have a localized text + english error. |
|
Yeah I wouldn't localize error messages themselves, just the text around it |
There are two parts to this work:
Rather than building localization into the engine, if there are strings in Rust that should be localized, we should probably replace them with enum values that correspond with embedder strings, and modify the API to avoid string literals whenever possible.