debug done

Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
dignow
2023-06-29 22:25:01 +08:00
parent 4c1eb75129
commit 2c0918fc06
4 changed files with 26 additions and 7 deletions

View File

@@ -999,13 +999,23 @@ Widget msgboxIcon(String type) {
// title should be null
Widget msgboxContent(String type, String title, String text) {
String translateText(String text) {
List<String> words = text.split(' ');
if (words.isNotEmpty && words[0].endsWith('_tip')) {
words[0] = translate(words[0]);
return words.join(' ');
if (text.indexOf('Failed') == 0 && text.contains(': ')) {
List<String> words = text.split(': ');
for (var i = 0; i < words.length; ++i) {
words[i] = translate(words[i]);
}
text = words.join(': ');
} 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(