l10n: 自定义汉化文件

This commit is contained in:
xkeyC 2024-05-05 21:03:11 +08:00
parent 2c744cc5bd
commit 9af96a2061
6 changed files with 59 additions and 8 deletions

View File

@ -570,6 +570,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Install custom file"), MessageLookupByLibrary.simpleMessage("Install custom file"),
"home_localization_action_rsi_launcher_localization": "home_localization_action_rsi_launcher_localization":
MessageLookupByLibrary.simpleMessage("RSILauncher Localization"), MessageLookupByLibrary.simpleMessage("RSILauncher Localization"),
"home_localization_action_select_customize_file":
MessageLookupByLibrary.simpleMessage("Click to select INI file"),
"home_localization_advanced_action_install": "home_localization_advanced_action_install":
MessageLookupByLibrary.simpleMessage( MessageLookupByLibrary.simpleMessage(
"Installation of Localization"), "Installation of Localization"),
@ -632,6 +634,11 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage( MessageLookupByLibrary.simpleMessage(
"Localization has a new version!"), "Localization has a new version!"),
"home_localization_new_version_installed": m34, "home_localization_new_version_installed": m34,
"home_localization_select_customize_file":
MessageLookupByLibrary.simpleMessage(
"Please select custom Localization file"),
"home_localization_select_customize_file_ini":
MessageLookupByLibrary.simpleMessage("Please select INI file"),
"home_localization_title_localization_tools": "home_localization_title_localization_tools":
MessageLookupByLibrary.simpleMessage("Localization tool"), MessageLookupByLibrary.simpleMessage("Localization tool"),
"home_login_action_title_box_one_click_launch": "home_login_action_title_box_one_click_launch":

View File

@ -512,6 +512,8 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("安装自定义文件"), MessageLookupByLibrary.simpleMessage("安装自定义文件"),
"home_localization_action_rsi_launcher_localization": "home_localization_action_rsi_launcher_localization":
MessageLookupByLibrary.simpleMessage("RSI 启动器汉化"), MessageLookupByLibrary.simpleMessage("RSI 启动器汉化"),
"home_localization_action_select_customize_file":
MessageLookupByLibrary.simpleMessage("点击选择 ini 文件"),
"home_localization_advanced_action_install": "home_localization_advanced_action_install":
MessageLookupByLibrary.simpleMessage("安装汉化"), MessageLookupByLibrary.simpleMessage("安装汉化"),
"home_localization_advanced_action_mod_change": "home_localization_advanced_action_mod_change":
@ -569,6 +571,10 @@ class MessageLookup extends MessageLookupByLibrary {
"home_localization_new_version_available": "home_localization_new_version_available":
MessageLookupByLibrary.simpleMessage("汉化有新版本!"), MessageLookupByLibrary.simpleMessage("汉化有新版本!"),
"home_localization_new_version_installed": m34, "home_localization_new_version_installed": m34,
"home_localization_select_customize_file":
MessageLookupByLibrary.simpleMessage("请选择自定义汉化文件"),
"home_localization_select_customize_file_ini":
MessageLookupByLibrary.simpleMessage("请选择 ini 文件"),
"home_localization_title_localization_tools": "home_localization_title_localization_tools":
MessageLookupByLibrary.simpleMessage("汉化工具"), MessageLookupByLibrary.simpleMessage("汉化工具"),
"home_login_action_title_box_one_click_launch": "home_login_action_title_box_one_click_launch":

View File

@ -4753,6 +4753,36 @@ class S {
args: [v0], args: [v0],
); );
} }
/// `Please select INI file`
String get home_localization_select_customize_file_ini {
return Intl.message(
'Please select INI file',
name: 'home_localization_select_customize_file_ini',
desc: '',
args: [],
);
}
/// `Please select custom Localization file`
String get home_localization_select_customize_file {
return Intl.message(
'Please select custom Localization file',
name: 'home_localization_select_customize_file',
desc: '',
args: [],
);
}
/// `Click to select INI file`
String get home_localization_action_select_customize_file {
return Intl.message(
'Click to select INI file',
name: 'home_localization_action_select_customize_file',
desc: '',
args: [],
);
}
} }
class AppLocalizationDelegate extends LocalizationsDelegate<S> { class AppLocalizationDelegate extends LocalizationsDelegate<S> {

View File

@ -820,5 +820,8 @@
"tools_action_unp4k_info": "Package Star Citizen P4K File", "tools_action_unp4k_info": "Package Star Citizen P4K File",
"tools_unp4k_title": "P4k viewer -> {v0}", "tools_unp4k_title": "P4k viewer -> {v0}",
"tools_unp4k_view_file": "Click the file to preview", "tools_unp4k_view_file": "Click the file to preview",
"tools_unp4k_msg_unknown_file_type": "Unknown file type\n{v0}" "tools_unp4k_msg_unknown_file_type": "Unknown file type\n{v0}",
"home_localization_select_customize_file_ini": "Please select INI file",
"home_localization_select_customize_file": "Please select custom Localization file",
"home_localization_action_select_customize_file": "Click to select INI file"
} }

View File

@ -786,5 +786,8 @@
"tools_action_unp4k_info": "解包星际公民 p4k 文件", "tools_action_unp4k_info": "解包星际公民 p4k 文件",
"tools_unp4k_title": "P4K 查看器 -> {v0}", "tools_unp4k_title": "P4K 查看器 -> {v0}",
"tools_unp4k_view_file": "单击文件以预览", "tools_unp4k_view_file": "单击文件以预览",
"tools_unp4k_msg_unknown_file_type": "未知文件类型\n{v0}" "tools_unp4k_msg_unknown_file_type": "未知文件类型\n{v0}",
"home_localization_select_customize_file_ini": "请选择 ini 文件",
"home_localization_select_customize_file": "请选择自定义汉化文件",
"home_localization_action_select_customize_file": "点击选择 ini 文件"
} }

View File

@ -17,7 +17,7 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget {
final isLoading = useState(false); final isLoading = useState(false);
void onSelectFile() async { void onSelectFile() async {
final result = await FilePicker.platform.pickFiles( final result = await FilePicker.platform.pickFiles(
dialogTitle: "请选择 ini 文件", dialogTitle: S.current.home_localization_select_customize_file_ini,
type: FileType.custom, type: FileType.custom,
allowedExtensions: ["ini"], allowedExtensions: ["ini"],
allowMultiple: false, allowMultiple: false,
@ -57,13 +57,14 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget {
), ),
onPressed: () => context.pop()), onPressed: () => context.pop()),
const SizedBox(width: 12), const SizedBox(width: 12),
const Text("请选择自定义汉化文件"), Text(S.current.home_localization_select_customize_file),
const Spacer(), const Spacer(),
if (selectedStringBuffer.value != null) if (selectedStringBuffer.value != null)
FilledButton( FilledButton(
child: const Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 6, vertical: 3), padding:
child: Text("确认"), const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
child: Text(S.current.app_common_tip_confirm),
), ),
onPressed: () { onPressed: () {
Navigator.pop(context, selectedStringBuffer.value); Navigator.pop(context, selectedStringBuffer.value);
@ -96,7 +97,8 @@ class LocalizationFromFileDialogUI extends HookConsumerWidget {
color: Colors.white.withOpacity(.6), color: Colors.white.withOpacity(.6),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
const Text("点击选择 ini 文件") Text(S.current
.home_localization_action_select_customize_file)
], ],
), ),
), ),