debug done
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
parent
4c1eb75129
commit
2c0918fc06
@ -999,13 +999,23 @@ Widget msgboxIcon(String type) {
|
|||||||
// title should be null
|
// title should be null
|
||||||
Widget msgboxContent(String type, String title, String text) {
|
Widget msgboxContent(String type, String title, String text) {
|
||||||
String translateText(String text) {
|
String translateText(String text) {
|
||||||
List<String> words = text.split(' ');
|
if (text.indexOf('Failed') == 0 && text.contains(': ')) {
|
||||||
if (words.isNotEmpty && words[0].endsWith('_tip')) {
|
List<String> words = text.split(': ');
|
||||||
words[0] = translate(words[0]);
|
for (var i = 0; i < words.length; ++i) {
|
||||||
return words.join(' ');
|
words[i] = translate(words[i]);
|
||||||
|
}
|
||||||
|
text = words.join(': ');
|
||||||
} else {
|
} else {
|
||||||
return translate(text);
|
List<String> words = text.split(' ');
|
||||||
|
if (words.length > 1 && words[0].endsWith('_tip')) {
|
||||||
|
words[0] = translate(words[0]);
|
||||||
|
final rest = text.substring(words[0].length + 1);
|
||||||
|
text = '${words[0]} ${translate(rest)}';
|
||||||
|
} else {
|
||||||
|
text = translate(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
|
@ -478,7 +478,7 @@ extern "C" fn notify_callback(conn_id: UINT32, msg: *const NOTIFICATION_MESSAGE)
|
|||||||
match (CStr::from_ptr(msg.msg as _).to_str(), details) {
|
match (CStr::from_ptr(msg.msg as _).to_str(), details) {
|
||||||
(Ok(m), Ok(d)) => {
|
(Ok(m), Ok(d)) => {
|
||||||
let msgtype = format!(
|
let msgtype = format!(
|
||||||
"{}-nocancel-nook-hasclose",
|
"custom-{}-nocancel-nook-hasclose",
|
||||||
if msg.r#type == 0 {
|
if msg.r#type == 0 {
|
||||||
"info"
|
"info"
|
||||||
} else if msg.r#type == 1 {
|
} else if msg.r#type == 1 {
|
||||||
|
@ -987,7 +987,7 @@ fn try_get_displays() -> ResultType<Vec<Display>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg(windows)]
|
#[cfg(all(windows, feature = "virtual_display_driver"))]
|
||||||
fn no_displays(displays: &Vec<Display>) -> bool {
|
fn no_displays(displays: &Vec<Display>) -> bool {
|
||||||
let display_len = displays.len();
|
let display_len = displays.len();
|
||||||
if display_len == 0 {
|
if display_len == 0 {
|
||||||
|
@ -5,6 +5,15 @@ function translate_text(text) {
|
|||||||
fds[i] = translate(fds[i]);
|
fds[i] = translate(fds[i]);
|
||||||
}
|
}
|
||||||
text = fds.join(': ');
|
text = fds.join(': ');
|
||||||
|
} else {
|
||||||
|
var fds = text.split(' ');
|
||||||
|
if (fds.length > 1 && fds[0].slice(-4) === '_tip') {
|
||||||
|
fds[0] = translate(fds[0]);
|
||||||
|
var rest = text.substring(fds[0].length + 1);
|
||||||
|
text = fds[0] + ' ' + translate(rest);
|
||||||
|
} else {
|
||||||
|
text = translate(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user