Skip to content

Commit

Permalink
優化:處理含有註解的語系檔案
Browse files Browse the repository at this point in the history
  • Loading branch information
SiongSng committed Nov 26, 2021
1 parent 7c6ec18 commit 3103212
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/function/LangUttily.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io';

import 'package:archive/archive.dart';
import 'package:json5/json5.dart';
import 'package:path/path.dart';

import '../Data/MinecraftVanillaLang.dart';
Expand Down Expand Up @@ -69,7 +70,9 @@ class LangUttily {
if (gameVersion == "1.12") {
englishLangMap = oldLangToMap(englishLang);
} else {
englishLangMap = Map<String, String>.from(json.decode(englishLang));
englishLangMap = Map<String, String>.from(JSON5.parse(
englishLang,
));
}

/// 假設先前已經存在語系檔案就新增回去
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
archive: ^3.1.5
args: ^2.3.0
dio: ^4.0.0
json5: ^0.7.0
path: ^1.8.0
toml: ^0.12.0

0 comments on commit 3103212

Please sign in to comment.