mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
* v6.0.2 Release candidate * v6.0.2 Release candidate * move btc ln up in the currency picker * disable bsc for swapsxyz * minor [skip ci] * hide dex/rate selection on swap screen * temp fix for evm tokens swaps icons until hive migration is done * minor [skip ci] * disable force dex providers for existing users and let them pick it from settings preference * Show bitcoin address types in swap picker (#3096) * Show bitcoin address types in swap picker * remove wrong conversion to bolt11 [skip ci] * feat: add Lightning invoice resolution and address normalization * automatically select contact wallet address based on the selected swap currency (whether it's bitcoin or lightning) * minor [skip ci] * default to bolt11 invoice for lightning swaps --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com> --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
57 lines
1.8 KiB
Dart
57 lines
1.8 KiB
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'print_verbose_dummy.dart';
|
|
import 'utils/translation/translation_constants.dart';
|
|
import 'utils/translation/translation_utils.dart';
|
|
|
|
const changelogsFilePath = "./assets/new-ui/changelog/text";
|
|
|
|
void main() async {
|
|
final List<dynamic> defaultLangChangelog = jsonDecode(
|
|
await File("$changelogsFilePath/changelog_$defaultLang.json").readAsString())
|
|
as List<dynamic>;
|
|
|
|
int currentLang = 0;
|
|
for (final lang in langs) {
|
|
int currentItem = 0;
|
|
if (lang == defaultLang) continue;
|
|
List<Map<String, String>> out = [];
|
|
for (final item in defaultLangChangelog) {
|
|
final itemMap = item as Map<String, dynamic>;
|
|
|
|
late final String newTitle;
|
|
late final String newDescription;
|
|
|
|
if (itemMap.containsKey("title") &&
|
|
itemMap["title"] is String &&
|
|
(itemMap["title"]! as String).isNotEmpty) {
|
|
newTitle = await getTranslation((itemMap["title"]! as String), lang);
|
|
} else {
|
|
newTitle = "";
|
|
}
|
|
|
|
if (itemMap.containsKey("description") &&
|
|
itemMap["description"] is String &&
|
|
(itemMap["description"]! as String).isNotEmpty) {
|
|
newDescription = await getTranslation((itemMap["description"]! as String), lang);
|
|
} else {
|
|
newDescription = "";
|
|
}
|
|
|
|
out.add({
|
|
if (itemMap["icon"] != null) "icon": itemMap["icon"] as String,
|
|
if (itemMap["title"] != null) "title": newTitle,
|
|
if (itemMap["description"] != null) "description": newDescription,
|
|
});
|
|
|
|
currentItem++;
|
|
printV(
|
|
"\r$currentLang/${langs.length} langs done, $currentItem/${defaultLangChangelog.length} items done");
|
|
}
|
|
currentLang++;
|
|
await File("$changelogsFilePath/changelog_$lang.json")
|
|
.writeAsString(jsonEncode(out));
|
|
}
|
|
}
|