-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(language): ✨ 支持中英文,Support Chinese and English
- Loading branch information
Showing
15 changed files
with
1,099 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart | ||
// This is a library that looks up messages for specific locales by | ||
// delegating to the appropriate library. | ||
|
||
// Ignore issues from commonly used lints in this file. | ||
// ignore_for_file:implementation_imports, file_names, unnecessary_new | ||
// ignore_for_file:unnecessary_brace_in_string_interps, directives_ordering | ||
// ignore_for_file:argument_type_not_assignable, invalid_assignment | ||
// ignore_for_file:prefer_single_quotes, prefer_generic_function_type_aliases | ||
// ignore_for_file:comment_references | ||
|
||
import 'dart:async'; | ||
|
||
import 'package:flutter/foundation.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:intl/message_lookup_by_library.dart'; | ||
import 'package:intl/src/intl_helpers.dart'; | ||
|
||
import 'messages_en.dart' as messages_en; | ||
import 'messages_en_US.dart' as messages_en_us; | ||
import 'messages_zh_Hans_CN.dart' as messages_zh_hans_cn; | ||
|
||
typedef Future<dynamic> LibraryLoader(); | ||
|
||
Map<String, LibraryLoader> _deferredLibraries = { | ||
'en': () => new SynchronousFuture(null), | ||
'en_US': () => new SynchronousFuture(null), | ||
'zh_Hans_CN': () => new SynchronousFuture(null), | ||
}; | ||
|
||
MessageLookupByLibrary? _findExact(String localeName) { | ||
switch (localeName) { | ||
case 'en': | ||
return messages_en.messages; | ||
case 'en_US': | ||
return messages_en_us.messages; | ||
case 'zh_Hans_CN': | ||
return messages_zh_hans_cn.messages; | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
/// User programs should call this before using [localeName] for messages. | ||
Future<bool> initializeMessages(String localeName) { | ||
var availableLocale = Intl.verifiedLocale( | ||
localeName, (locale) => _deferredLibraries[locale] != null, | ||
onFailure: (_) => null); | ||
if (availableLocale == null) { | ||
return new SynchronousFuture(false); | ||
} | ||
var lib = _deferredLibraries[availableLocale]; | ||
lib == null ? new SynchronousFuture(false) : lib(); | ||
initializeInternalMessageLookup(() => new CompositeMessageLookup()); | ||
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor); | ||
return new SynchronousFuture(true); | ||
} | ||
|
||
bool _messagesExistFor(String locale) { | ||
try { | ||
return _findExact(locale) != null; | ||
} catch (e) { | ||
return false; | ||
} | ||
} | ||
|
||
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { | ||
var actualLocale = | ||
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); | ||
if (actualLocale == null) return null; | ||
return _findExact(actualLocale); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart | ||
// This is a library that provides messages for a en locale. All the | ||
// messages from the main program should be duplicated here with the same | ||
// function name. | ||
|
||
// Ignore issues from commonly used lints in this file. | ||
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new | ||
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering | ||
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases | ||
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes | ||
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes | ||
|
||
import 'package:intl/intl.dart'; | ||
import 'package:intl/message_lookup_by_library.dart'; | ||
|
||
final messages = new MessageLookup(); | ||
|
||
typedef String MessageIfAbsent(String messageStr, List<dynamic> args); | ||
|
||
class MessageLookup extends MessageLookupByLibrary { | ||
String get localeName => 'en'; | ||
|
||
final messages = _notInlinedMessages(_notInlinedMessages); | ||
|
||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{ | ||
"text_about": MessageLookupByLibrary.simpleMessage("About"), | ||
"text_add_proxy": MessageLookupByLibrary.simpleMessage("Add Proxy"), | ||
"text_app_config_list": | ||
MessageLookupByLibrary.simpleMessage("Configuration List"), | ||
"text_author": MessageLookupByLibrary.simpleMessage("Author: @iyue"), | ||
"text_cancel": MessageLookupByLibrary.simpleMessage("Cancel"), | ||
"text_check_parameters": MessageLookupByLibrary.simpleMessage( | ||
"Please fill in all parameters!"), | ||
"text_check_update": | ||
MessageLookupByLibrary.simpleMessage("Check for Updates"), | ||
"text_config_cannot_be_modified": MessageLookupByLibrary.simpleMessage( | ||
"Configuration name cannot be modified!"), | ||
"text_config_name": | ||
MessageLookupByLibrary.simpleMessage("Configuration Name"), | ||
"text_configure": MessageLookupByLibrary.simpleMessage("Configure"), | ||
"text_confirm": MessageLookupByLibrary.simpleMessage("Confirm"), | ||
"text_current_latest": MessageLookupByLibrary.simpleMessage( | ||
"You are on the latest version"), | ||
"text_current_version": | ||
MessageLookupByLibrary.simpleMessage("Current Version"), | ||
"text_delete_proxy_tips": MessageLookupByLibrary.simpleMessage( | ||
"Are you sure you want to delete this proxy configuration?"), | ||
"text_describe": MessageLookupByLibrary.simpleMessage( | ||
"appproxy is a lightweight VPN proxy tool that supports HTTP and SOCKS5 protocols."), | ||
"text_download": MessageLookupByLibrary.simpleMessage("Download"), | ||
"text_get_version_info_check_networ": | ||
MessageLookupByLibrary.simpleMessage( | ||
"Failed to get version information, please check your network!"), | ||
"text_get_version_info_fail": MessageLookupByLibrary.simpleMessage( | ||
"Failed to get version information, please use domestic update channels!"), | ||
"text_is_open_check_update": | ||
MessageLookupByLibrary.simpleMessage("Enable Update Check"), | ||
"text_language": MessageLookupByLibrary.simpleMessage("Language"), | ||
"text_latest_version": | ||
MessageLookupByLibrary.simpleMessage("Latest Version"), | ||
"text_proxy": MessageLookupByLibrary.simpleMessage("Proxy"), | ||
"text_proxy_addr": | ||
MessageLookupByLibrary.simpleMessage("Proxy Address"), | ||
"text_proxy_passworld": | ||
MessageLookupByLibrary.simpleMessage("Password"), | ||
"text_proxy_port": MessageLookupByLibrary.simpleMessage("Proxy Port"), | ||
"text_proxy_type": MessageLookupByLibrary.simpleMessage("Proxy Type"), | ||
"text_proxy_username": MessageLookupByLibrary.simpleMessage("Username"), | ||
"text_search_app": | ||
MessageLookupByLibrary.simpleMessage("Search Applications"), | ||
"text_select_all": MessageLookupByLibrary.simpleMessage("Select All"), | ||
"text_server_config": | ||
MessageLookupByLibrary.simpleMessage("Configuration List"), | ||
"text_settings": MessageLookupByLibrary.simpleMessage("Settings"), | ||
"text_show_system_app": | ||
MessageLookupByLibrary.simpleMessage("Show System Applications"), | ||
"text_show_user_app": | ||
MessageLookupByLibrary.simpleMessage("Show User Applications"), | ||
"text_switch_language": | ||
MessageLookupByLibrary.simpleMessage("Switch the language"), | ||
"text_tips": MessageLookupByLibrary.simpleMessage("Tips"), | ||
"text_update_content": | ||
MessageLookupByLibrary.simpleMessage("Update Content:"), | ||
"text_update_time": MessageLookupByLibrary.simpleMessage("Update Time"), | ||
"text_update_tips": MessageLookupByLibrary.simpleMessage("Update Tips"), | ||
"text_version_update": | ||
MessageLookupByLibrary.simpleMessage("Version Update") | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart | ||
// This is a library that provides messages for a en_US locale. All the | ||
// messages from the main program should be duplicated here with the same | ||
// function name. | ||
|
||
// Ignore issues from commonly used lints in this file. | ||
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new | ||
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering | ||
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases | ||
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes | ||
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes | ||
|
||
import 'package:intl/intl.dart'; | ||
import 'package:intl/message_lookup_by_library.dart'; | ||
|
||
final messages = new MessageLookup(); | ||
|
||
typedef String MessageIfAbsent(String messageStr, List<dynamic> args); | ||
|
||
class MessageLookup extends MessageLookupByLibrary { | ||
String get localeName => 'en_US'; | ||
|
||
final messages = _notInlinedMessages(_notInlinedMessages); | ||
|
||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{ | ||
"text_about": MessageLookupByLibrary.simpleMessage("About"), | ||
"text_add_proxy": MessageLookupByLibrary.simpleMessage("Add Proxy"), | ||
"text_app_config_list": | ||
MessageLookupByLibrary.simpleMessage("Configuration List"), | ||
"text_author": MessageLookupByLibrary.simpleMessage("Author: @iyue"), | ||
"text_cancel": MessageLookupByLibrary.simpleMessage("Cancel"), | ||
"text_check_parameters": MessageLookupByLibrary.simpleMessage( | ||
"Please fill in all parameters!"), | ||
"text_check_update": | ||
MessageLookupByLibrary.simpleMessage("Check for Updates"), | ||
"text_config_cannot_be_modified": MessageLookupByLibrary.simpleMessage( | ||
"Configuration name cannot be modified!"), | ||
"text_config_name": | ||
MessageLookupByLibrary.simpleMessage("Configuration Name"), | ||
"text_configure": MessageLookupByLibrary.simpleMessage("Configure"), | ||
"text_confirm": MessageLookupByLibrary.simpleMessage("Confirm"), | ||
"text_current_latest": MessageLookupByLibrary.simpleMessage( | ||
"You are on the latest version"), | ||
"text_current_version": | ||
MessageLookupByLibrary.simpleMessage("Current Version"), | ||
"text_delete_proxy_tips": MessageLookupByLibrary.simpleMessage( | ||
"Are you sure you want to delete this proxy configuration?"), | ||
"text_describe": MessageLookupByLibrary.simpleMessage( | ||
"appproxy is a lightweight VPN proxy tool that supports HTTP and SOCKS5 protocols."), | ||
"text_download": MessageLookupByLibrary.simpleMessage("Download"), | ||
"text_get_version_info_check_networ": | ||
MessageLookupByLibrary.simpleMessage( | ||
"Failed to get version information, please check your network!"), | ||
"text_get_version_info_fail": MessageLookupByLibrary.simpleMessage( | ||
"Failed to get version information, please use domestic update channels!"), | ||
"text_is_open_check_update": | ||
MessageLookupByLibrary.simpleMessage("Enable Update Check"), | ||
"text_language": MessageLookupByLibrary.simpleMessage("Language"), | ||
"text_latest_version": | ||
MessageLookupByLibrary.simpleMessage("Latest Version"), | ||
"text_proxy": MessageLookupByLibrary.simpleMessage("Proxy"), | ||
"text_proxy_addr": | ||
MessageLookupByLibrary.simpleMessage("Proxy Address"), | ||
"text_proxy_passworld": | ||
MessageLookupByLibrary.simpleMessage("Password"), | ||
"text_proxy_port": MessageLookupByLibrary.simpleMessage("Proxy Port"), | ||
"text_proxy_type": MessageLookupByLibrary.simpleMessage("Proxy Type"), | ||
"text_proxy_username": MessageLookupByLibrary.simpleMessage("Username"), | ||
"text_search_app": | ||
MessageLookupByLibrary.simpleMessage("Search Applications"), | ||
"text_select_all": MessageLookupByLibrary.simpleMessage("Select All"), | ||
"text_server_config": | ||
MessageLookupByLibrary.simpleMessage("Configuration List"), | ||
"text_settings": MessageLookupByLibrary.simpleMessage("Settings"), | ||
"text_show_system_app": | ||
MessageLookupByLibrary.simpleMessage("Show System Applications"), | ||
"text_show_user_app": | ||
MessageLookupByLibrary.simpleMessage("Show User Applications"), | ||
"text_switch_language": | ||
MessageLookupByLibrary.simpleMessage("Switch the language"), | ||
"text_tips": MessageLookupByLibrary.simpleMessage("Tips"), | ||
"text_update_content": | ||
MessageLookupByLibrary.simpleMessage("Update Content:"), | ||
"text_update_time": MessageLookupByLibrary.simpleMessage("Update Time"), | ||
"text_update_tips": MessageLookupByLibrary.simpleMessage("Update Tips"), | ||
"text_version_update": | ||
MessageLookupByLibrary.simpleMessage("Version Update") | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart | ||
// This is a library that provides messages for a zh_Hans_CN locale. All the | ||
// messages from the main program should be duplicated here with the same | ||
// function name. | ||
|
||
// Ignore issues from commonly used lints in this file. | ||
// ignore_for_file:unnecessary_brace_in_string_interps, unnecessary_new | ||
// ignore_for_file:prefer_single_quotes,comment_references, directives_ordering | ||
// ignore_for_file:annotate_overrides,prefer_generic_function_type_aliases | ||
// ignore_for_file:unused_import, file_names, avoid_escaping_inner_quotes | ||
// ignore_for_file:unnecessary_string_interpolations, unnecessary_string_escapes | ||
|
||
import 'package:intl/intl.dart'; | ||
import 'package:intl/message_lookup_by_library.dart'; | ||
|
||
final messages = new MessageLookup(); | ||
|
||
typedef String MessageIfAbsent(String messageStr, List<dynamic> args); | ||
|
||
class MessageLookup extends MessageLookupByLibrary { | ||
String get localeName => 'zh_Hans_CN'; | ||
|
||
final messages = _notInlinedMessages(_notInlinedMessages); | ||
|
||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{ | ||
"text_about": MessageLookupByLibrary.simpleMessage("关于"), | ||
"text_add_proxy": MessageLookupByLibrary.simpleMessage("添加代理"), | ||
"text_app_config_list": MessageLookupByLibrary.simpleMessage("配置列表"), | ||
"text_author": MessageLookupByLibrary.simpleMessage("作者:@iyue"), | ||
"text_cancel": MessageLookupByLibrary.simpleMessage("取消"), | ||
"text_check_parameters": | ||
MessageLookupByLibrary.simpleMessage("参数请填写完整!"), | ||
"text_check_update": MessageLookupByLibrary.simpleMessage("更新检测"), | ||
"text_config_cannot_be_modified": | ||
MessageLookupByLibrary.simpleMessage("配置名称不可修改!"), | ||
"text_config_name": MessageLookupByLibrary.simpleMessage("配置名称"), | ||
"text_configure": MessageLookupByLibrary.simpleMessage("配置"), | ||
"text_confirm": MessageLookupByLibrary.simpleMessage("确定"), | ||
"text_current_latest": MessageLookupByLibrary.simpleMessage("当前是最新版本"), | ||
"text_current_version": MessageLookupByLibrary.simpleMessage("当前版本"), | ||
"text_delete_proxy_tips": | ||
MessageLookupByLibrary.simpleMessage("是否删除该代理配置?"), | ||
"text_describe": MessageLookupByLibrary.simpleMessage( | ||
"appproxy 是一个轻量级的VPN代理工具,支持HTTP, SOCKS5协议"), | ||
"text_download": MessageLookupByLibrary.simpleMessage("下载"), | ||
"text_get_version_info_check_networ": | ||
MessageLookupByLibrary.simpleMessage("获取版本信息失败,请检查网络!"), | ||
"text_get_version_info_fail": | ||
MessageLookupByLibrary.simpleMessage("获取版本信息失败,使用国内更新渠道!"), | ||
"text_is_open_check_update": | ||
MessageLookupByLibrary.simpleMessage("是否开启更新检测"), | ||
"text_language": MessageLookupByLibrary.simpleMessage("语言"), | ||
"text_latest_version": MessageLookupByLibrary.simpleMessage("最新版本"), | ||
"text_proxy": MessageLookupByLibrary.simpleMessage("代理"), | ||
"text_proxy_addr": MessageLookupByLibrary.simpleMessage("代理地址"), | ||
"text_proxy_passworld": MessageLookupByLibrary.simpleMessage("密码"), | ||
"text_proxy_port": MessageLookupByLibrary.simpleMessage("代理端口"), | ||
"text_proxy_type": MessageLookupByLibrary.simpleMessage("代理类型"), | ||
"text_proxy_username": MessageLookupByLibrary.simpleMessage("名户名"), | ||
"text_search_app": MessageLookupByLibrary.simpleMessage("搜索应用"), | ||
"text_select_all": MessageLookupByLibrary.simpleMessage("全选"), | ||
"text_server_config": MessageLookupByLibrary.simpleMessage("配置列表"), | ||
"text_settings": MessageLookupByLibrary.simpleMessage("设置"), | ||
"text_show_system_app": MessageLookupByLibrary.simpleMessage("显示系统应用"), | ||
"text_show_user_app": MessageLookupByLibrary.simpleMessage("显示用户应用"), | ||
"text_switch_language": MessageLookupByLibrary.simpleMessage("切换语言"), | ||
"text_tips": MessageLookupByLibrary.simpleMessage("提示"), | ||
"text_update_content": MessageLookupByLibrary.simpleMessage("更新内容:"), | ||
"text_update_time": MessageLookupByLibrary.simpleMessage("更新时间"), | ||
"text_update_tips": MessageLookupByLibrary.simpleMessage("更新提示"), | ||
"text_version_update": MessageLookupByLibrary.simpleMessage("版本更新") | ||
}; | ||
} |
Oops, something went wrong.