mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
continue formatting
This commit is contained in:
@@ -26,11 +26,11 @@ void main(List<String> args) async {
|
||||
}
|
||||
|
||||
print('Alphabetizing all files...');
|
||||
|
||||
|
||||
for (var lang in langs) {
|
||||
final fileName = getArbFileName(lang);
|
||||
alphabetizeArbFile(fileName);
|
||||
}
|
||||
|
||||
print('Done!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:archive/archive_io.dart';
|
||||
final _dio = Dio();
|
||||
|
||||
final List<String> triplets = [
|
||||
"x86_64-linux-gnu", // linux desktop - majority of users onlinux
|
||||
"x86_64-linux-gnu", // linux desktop - majority of users onlinux
|
||||
// "i686-linux-gnu", // not supported by cake
|
||||
// "i686-meego-linux-gnu", // sailfishos (emulator)- not supported by cake
|
||||
// "aarch64-linux-gnu", // not (yet) supported by cake - (mostly) mobile linux
|
||||
@@ -18,7 +18,7 @@ final List<String> triplets = [
|
||||
"armv7a-linux-androideabi",
|
||||
// "i686-w64-mingw32", // 32bit windows - not supported by monero_c
|
||||
"x86_64-w64-mingw32",
|
||||
// "x86_64-apple-darwin11", // Intel macbooks (contrib) - not used by cake
|
||||
// "x86_64-apple-darwin11", // Intel macbooks (contrib) - not used by cake
|
||||
// "aarch64-apple-darwin11", // apple silicon macbooks (contrib) - not used by cake
|
||||
// "x86_64-host-apple-darwin", // not available on CI (yet)
|
||||
"aarch64-apple-darwin", // apple silicon macbooks
|
||||
@@ -55,10 +55,8 @@ Future<void> main() async {
|
||||
}
|
||||
if (Platform.isMacOS) {
|
||||
print("Generating ios framework");
|
||||
final result = Process.runSync("bash", [
|
||||
"-c",
|
||||
"cd scripts/ios && ./gen_framework.sh && cd ../.."
|
||||
]);
|
||||
print((result.stdout+result.stderr).toString().trim());
|
||||
final result =
|
||||
Process.runSync("bash", ["-c", "cd scripts/ios && ./gen_framework.sh && cd ../.."]);
|
||||
print((result.stdout + result.stderr).toString().trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,21 +13,21 @@ const srcDir = 'srcDir';
|
||||
const defaultLocale = 'en';
|
||||
|
||||
Future<void> main(List<String> args) async {
|
||||
final extraInfo = args.isNotEmpty ?
|
||||
args.fold(<String, dynamic>{}, (Map<String, dynamic> acc, String arg) {
|
||||
final parts = arg.split('=');
|
||||
var key = normalizeKeyName(parts[0]);
|
||||
if (key.contains('--')) {
|
||||
key = key.substring(2);
|
||||
}
|
||||
acc[key] = parts.length > 1
|
||||
? parts[1].isNotEmpty
|
||||
? parts[1]
|
||||
: inputPath
|
||||
: inputPath;
|
||||
return acc;
|
||||
})
|
||||
: <String, dynamic> {srcDir : inputPath};
|
||||
final extraInfo = args.isNotEmpty
|
||||
? args.fold(<String, dynamic>{}, (Map<String, dynamic> acc, String arg) {
|
||||
final parts = arg.split('=');
|
||||
var key = normalizeKeyName(parts[0]);
|
||||
if (key.contains('--')) {
|
||||
key = key.substring(2);
|
||||
}
|
||||
acc[key] = parts.length > 1
|
||||
? parts[1].isNotEmpty
|
||||
? parts[1]
|
||||
: inputPath
|
||||
: inputPath;
|
||||
return acc;
|
||||
})
|
||||
: <String, dynamic>{srcDir: inputPath};
|
||||
|
||||
final outputDir = Directory(outputPath);
|
||||
|
||||
@@ -59,10 +59,10 @@ Future<void> main(List<String> args) async {
|
||||
return;
|
||||
}
|
||||
final parts =
|
||||
fileName.substring('strings_'.length, fileName.length - '.arb'.length).split('_');
|
||||
fileName.substring('strings_'.length, fileName.length - '.arb'.length).split('_');
|
||||
final locale = parts.length > 1
|
||||
? '${parts.first.toLowerCase()}_${parts.sublist(1).join('_').toUpperCase()}'
|
||||
: parts.first.toLowerCase();
|
||||
? '${parts.first.toLowerCase()}_${parts.sublist(1).join('_').toUpperCase()}'
|
||||
: parts.first.toLowerCase();
|
||||
localePath[locale] = element.path;
|
||||
});
|
||||
|
||||
@@ -78,8 +78,7 @@ Future<void> main(List<String> args) async {
|
||||
output += part1;
|
||||
output += textDirectionDeclaration;
|
||||
|
||||
var inputContent =
|
||||
File(localePath[defaultLocale].toString()).readAsStringSync();
|
||||
var inputContent = File(localePath[defaultLocale].toString()).readAsStringSync();
|
||||
var config = json.decode(inputContent) as Map<String, dynamic>;
|
||||
|
||||
output += localizedStrings(config: config, hasOverride: false);
|
||||
@@ -161,4 +160,3 @@ String localizedStrings({required Map<String, dynamic> config, required bool has
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,4 +9,4 @@ Future<void> main(List<String> args) async => generateSecrets(args);
|
||||
Future<void> generateSecrets(List<String> args) async {
|
||||
await generateSecretsConfig(args);
|
||||
await importSecretsConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ Future<void> main(List<String> args) async {
|
||||
final pubspecDescription = File(pubspecDescriptionPath);
|
||||
|
||||
if (!pubspecBase.existsSync() || !pubspecDescription.existsSync()) {
|
||||
throw("$pubspecBasePath or $pubspecDescriptionPath doesn't exists");
|
||||
throw ("$pubspecBasePath or $pubspecDescriptionPath doesn't exists");
|
||||
}
|
||||
|
||||
final pubspecBaseContent = await pubspecBase.readAsString();
|
||||
final pubspecDescriptionContent = await pubspecDescription.readAsString();
|
||||
final pubSpecContent = pubspecDescriptionContent + '\n\n' + pubspecBaseContent;
|
||||
final pubSpecContent = pubspecDescriptionContent + '\n\n' + pubspecBaseContent;
|
||||
final outputPubspec = File(outputPubspecPath);
|
||||
|
||||
if (outputPubspec.existsSync()) {
|
||||
|
||||
@@ -61,9 +61,9 @@ Future<void> generateSecretsConfig(List<String> args) async {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
await writeConfig(baseConfigFile, SecretKey.base, existingSecrets: secrets);
|
||||
|
||||
|
||||
await writeConfig(evmChainsConfigFile, SecretKey.evmChainsSecrets);
|
||||
await writeConfig(solanaConfigFile, SecretKey.solanaSecrets);
|
||||
await writeConfig(nanoConfigFile, SecretKey.nanoSecrets);
|
||||
|
||||
@@ -157,4 +157,4 @@ String getLang(Locale l) => l == null
|
||||
: l.countryCode != null && l.countryCode!.isEmpty
|
||||
? l.languageCode
|
||||
: l.toString();
|
||||
""";
|
||||
""";
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ 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>;
|
||||
final List<dynamic> defaultLangChangelog =
|
||||
jsonDecode(await File("$changelogsFilePath/changelog_$defaultLang.json").readAsString())
|
||||
as List<dynamic>;
|
||||
|
||||
int currentLang = 0;
|
||||
for (final lang in langs) {
|
||||
@@ -50,7 +50,6 @@ void main() async {
|
||||
"\r$currentLang/${langs.length} langs done, $currentItem/${defaultLangChangelog.length} items done");
|
||||
}
|
||||
currentLang++;
|
||||
await File("$changelogsFilePath/changelog_$lang.json")
|
||||
.writeAsString(jsonEncode(out));
|
||||
await File("$changelogsFilePath/changelog_$lang.json").writeAsString(jsonEncode(out));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,11 +217,20 @@ IMPORTANT: Respond with a JSON object in the exact format, you must think about
|
||||
|
||||
void main(List<String> args) async {
|
||||
final parser = ArgParser()
|
||||
..addOption('source', abbr: 's', help: 'Path to source ARB file (e.g., ./res/values/strings_en.arb)', mandatory: true)
|
||||
..addOption('destination', abbr: 'd', help: 'Path to destination ARB file (e.g., ./res/values/strings_pl.arb)', mandatory: true)
|
||||
..addOption('source',
|
||||
abbr: 's',
|
||||
help: 'Path to source ARB file (e.g., ./res/values/strings_en.arb)',
|
||||
mandatory: true)
|
||||
..addOption('destination',
|
||||
abbr: 'd',
|
||||
help: 'Path to destination ARB file (e.g., ./res/values/strings_pl.arb)',
|
||||
mandatory: true)
|
||||
..addOption('key', abbr: 'k', help: 'Translate only this specific key (optional)')
|
||||
..addOption('ollama-url', help: 'Ollama server URL (default: http://localhost:11434)', defaultsTo: 'http://localhost:11434')
|
||||
..addOption('model', help: 'Ollama model name (default: gpt-oss:120b)', defaultsTo: 'gpt-oss:120b')
|
||||
..addOption('ollama-url',
|
||||
help: 'Ollama server URL (default: http://localhost:11434)',
|
||||
defaultsTo: 'http://localhost:11434')
|
||||
..addOption('model',
|
||||
help: 'Ollama model name (default: gpt-oss:120b)', defaultsTo: 'gpt-oss:120b')
|
||||
..addFlag('help', abbr: 'h', help: 'Show this help message', negatable: false);
|
||||
|
||||
try {
|
||||
@@ -268,7 +277,6 @@ void main(List<String> args) async {
|
||||
destinationArbPath: destinationPath,
|
||||
specificKey: specificKey,
|
||||
);
|
||||
|
||||
} catch (e) {
|
||||
print('Error: $e');
|
||||
print('Run with --help for more information.');
|
||||
|
||||
@@ -8,8 +8,7 @@ import 'utils/translation/translation_utils.dart';
|
||||
|
||||
void main(List<String> args) async {
|
||||
if (args.length != 1) {
|
||||
throw Exception(
|
||||
'Insufficient arguments!\n\nTry to run `./translation_add_lang.dart langCode`');
|
||||
throw Exception('Insufficient arguments!\n\nTry to run `./translation_add_lang.dart langCode`');
|
||||
}
|
||||
|
||||
final targetLang = args.first;
|
||||
|
||||
@@ -28,8 +28,7 @@ void main(List<String> args) async {
|
||||
|
||||
missingKeys.forEach((key) {
|
||||
print('Missing in "$lang": "$key"');
|
||||
if (doFix)
|
||||
missingDefaults[key] = arbObj[key] as String;
|
||||
if (doFix) missingDefaults[key] = arbObj[key] as String;
|
||||
});
|
||||
|
||||
if (missingDefaults.isNotEmpty) {
|
||||
|
||||
@@ -12,8 +12,7 @@ Future<void> main(List<String> args) async {
|
||||
}
|
||||
|
||||
Future<void> updateSecretsConfig(List<String> args) async {
|
||||
final extraInfo =
|
||||
args.fold(<String, dynamic>{}, (Map<String, dynamic> acc, String arg) {
|
||||
final extraInfo = args.fold(<String, dynamic>{}, (Map<String, dynamic> acc, String arg) {
|
||||
final parts = arg.split('=');
|
||||
final key = normalizeKeyName(parts[0]);
|
||||
acc[key] = parts.length > 1 ? parts[1] : 1;
|
||||
@@ -32,8 +31,7 @@ Future<void> updateSecretsConfig(List<String> args) async {
|
||||
return false;
|
||||
});
|
||||
|
||||
final fileConfig =
|
||||
json.decode(configFile.readAsStringSync()) as Map<String, dynamic>;
|
||||
final fileConfig = json.decode(configFile.readAsStringSync()) as Map<String, dynamic>;
|
||||
fileConfig.forEach((key, dynamic value) {
|
||||
if (secrets[key] == null) {
|
||||
secrets[key] = value;
|
||||
|
||||
Reference in New Issue
Block a user