forked from 1b-agent/opencadstudio-upstream
Complete application localization across all supported languages
This commit is contained in:
1 parent
96c794c072
commit
d66e89ca19
78 files changed
+26043
-877
No files matched your search
+13
-9
@@ -442,20 +442,24 @@ pub mod web_diag {
|
||||
padding:8px 12px;max-height:40vh;overflow:auto;\
|
||||
user-select:text;cursor:text;",
|
||||
);
|
||||
// Inline `onclick` keeps this dependency-free (no JS closures):
|
||||
// Copy puts the full error text on the clipboard; Dismiss
|
||||
// removes the overlay so the app stays usable underneath.
|
||||
overlay.set_inner_html(
|
||||
"<div><b>OpenCADStudio renderer error</b> — please copy \
|
||||
this into a bug report: \
|
||||
<button style=\"margin-left:8px\" onclick=\"navigator.clipboard.writeText(\
|
||||
document.getElementById('ocs-err-text').innerText)\">Copy</button> \
|
||||
<button onclick=\"document.getElementById('ocs-err').remove()\">\
|
||||
Dismiss</button></div>\
|
||||
"<div><b id=\"ocs-err-title\"></b> \
|
||||
<button id=\"ocs-err-copy\" style=\"margin-left:8px\" onclick=\"navigator.clipboard.writeText(\
|
||||
document.getElementById('ocs-err-text').innerText)\"></button> \
|
||||
<button id=\"ocs-err-dismiss\" onclick=\"document.getElementById('ocs-err').remove()\"></button></div>\
|
||||
<pre id=\"ocs-err-text\" style=\"margin:6px 0 0;\
|
||||
white-space:pre-wrap;user-select:text;\"></pre>",
|
||||
);
|
||||
let _ = body.append_child(&overlay);
|
||||
for (id, label) in [
|
||||
("ocs-err-title", crate::t!("OpenCADStudio renderer error — copy this into a bug report:")),
|
||||
("ocs-err-copy", crate::t!("Copy")),
|
||||
("ocs-err-dismiss", crate::t!("Dismiss")),
|
||||
] {
|
||||
if let Some(element) = doc.get_element_by_id(id) {
|
||||
element.set_text_content(Some(label.as_ref()));
|
||||
}
|
||||
}
|
||||
match doc.get_element_by_id("ocs-err-text") {
|
||||
Some(pre) => pre,
|
||||
None => return,
|
||||
|
||||
Reference in new issue
Block a user