import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:intl/intl.dart' as intl; import 'app_localizations_zh.dart'; // ignore_for_file: type=lint /// Callers can lookup localized strings with an instance of AppLocalizations /// returned by `AppLocalizations.of(context)`. /// /// Applications need to include `AppLocalizations.delegate()` in their app's /// `localizationDelegates` list, and the locales they support in the app's /// `supportedLocales` list. For example: /// /// ```dart /// import 'l10n/app_localizations.dart'; /// /// return MaterialApp( /// localizationsDelegates: AppLocalizations.localizationsDelegates, /// supportedLocales: AppLocalizations.supportedLocales, /// home: MyApplicationHome(), /// ); /// ``` /// /// ## Update pubspec.yaml /// /// Please make sure to update your pubspec.yaml to include the following /// packages: /// /// ```yaml /// dependencies: /// # Internationalization support. /// flutter_localizations: /// sdk: flutter /// intl: any # Use the pinned version from flutter_localizations /// /// # Rest of dependencies /// ``` /// /// ## iOS Applications /// /// iOS applications define key application metadata, including supported /// locales, in an Info.plist file that is built into the application bundle. /// To configure the locales supported by your app, you’ll need to edit this /// file. /// /// First, open your project’s ios/Runner.xcworkspace Xcode workspace file. /// Then, in the Project Navigator, open the Info.plist file under the Runner /// project’s Runner folder. /// /// Next, select the Information Property List item, select Add Item from the /// Editor menu, then select Localizations from the pop-up menu. /// /// Select and expand the newly-created Localizations item then, for each /// locale your application supports, add a new item and select the locale /// you wish to add from the pop-up menu in the Value field. This list should /// be consistent with the languages listed in the AppLocalizations.supportedLocales /// property. abstract class AppLocalizations { AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString()); final String localeName; static AppLocalizations? of(BuildContext context) { return Localizations.of(context, AppLocalizations); } static const LocalizationsDelegate delegate = _AppLocalizationsDelegate(); /// A list of this localizations delegate along with the default localizations /// delegates. /// /// Returns a list of localizations delegates containing this delegate along with /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, /// and GlobalWidgetsLocalizations.delegate. /// /// Additional delegates can be added by appending to this list in /// MaterialApp. This list does not have to be used at all if a custom list /// of delegates is preferred or required. static const List> localizationsDelegates = >[ delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ]; /// A list of this localizations delegate's supported locales. static const List supportedLocales = [Locale('zh')]; /// 应用名称 /// /// In zh, this message translates to: /// **'SinoMed Cloud'** String get appName; /// 应用副标题 /// /// In zh, this message translates to: /// **'中方诊药云'** String get appSubtitle; /// 密码登录标签 /// /// In zh, this message translates to: /// **'密码登录'** String get passwordLogin; /// 验证码登录标签 /// /// In zh, this message translates to: /// **'验证码登录'** String get smsLogin; /// 手机号标签 /// /// In zh, this message translates to: /// **'手机号'** String get phoneNumber; /// 手机号输入提示/必填验证 /// /// In zh, this message translates to: /// **'请输入手机号'** String get phoneNumberRequired; /// 手机号格式验证 /// /// In zh, this message translates to: /// **'请输入正确的手机号'** String get phoneNumberInvalid; /// 密码标签 /// /// In zh, this message translates to: /// **'密码'** String get password; /// 密码输入提示/必填验证 /// /// In zh, this message translates to: /// **'请输入密码'** String get passwordRequired; /// 密码长度验证 /// /// In zh, this message translates to: /// **'密码长度不能少于6位'** String get passwordMinLength; /// 忘记密码链接 /// /// In zh, this message translates to: /// **'忘记密码?'** String get forgotPassword; /// 忘记密码功能提示 /// /// In zh, this message translates to: /// **'忘记密码功能待实现'** String get forgotPasswordNotImplemented; /// 登录按钮 /// /// In zh, this message translates to: /// **'登录'** String get login; /// 退出登录按钮 /// /// In zh, this message translates to: /// **'退出登录'** String get logout; /// 我的页面标题 /// /// In zh, this message translates to: /// **'我的'** String get mine; /// 修改密码按钮 /// /// In zh, this message translates to: /// **'修改密码'** String get changePassword; /// 修改密码成功提示 /// /// In zh, this message translates to: /// **'修改密码成功'** String get changePasswordSuccess; /// 修改密码失败提示 /// /// In zh, this message translates to: /// **'修改密码失败'** String get changePasswordFailed; /// 登录功能提示 /// /// In zh, this message translates to: /// **'登录功能待实现'** String get loginNotImplemented; /// 验证码标签 /// /// In zh, this message translates to: /// **'验证码'** String get smsCode; /// 验证码输入提示/必填验证 /// /// In zh, this message translates to: /// **'请输入验证码'** String get smsCodeRequired; /// 验证码长度验证 /// /// In zh, this message translates to: /// **'验证码为4位数字'** String get smsCodeLength; /// 验证码格式验证 /// /// In zh, this message translates to: /// **'验证码格式不正确'** String get smsCodeInvalid; /// 验证码已过期或未获取提示 /// /// In zh, this message translates to: /// **'请获取验证码'** String get smsCodeExpired; /// 验证码过期提示 /// /// In zh, this message translates to: /// **'验证码已过期'** String get smsCodeHasExpired; /// 验证码输入错误提示 /// /// In zh, this message translates to: /// **'验证码错误'** String get smsCodeError; /// 获取验证码按钮 /// /// In zh, this message translates to: /// **'获取验证码'** String get getSmsCode; /// 验证码发送成功提示 /// /// In zh, this message translates to: /// **'验证码已发送'** String get smsCodeSent; /// 重新获取验证码按钮文本 /// /// In zh, this message translates to: /// **'请重新获取验证码'** String get resendSmsCode; /// 验证码倒计时 /// /// In zh, this message translates to: /// **'{count}秒'** String smsCodeCountdown(int count); /// 输入新密码标题 /// /// In zh, this message translates to: /// **'新密码'** String get newPassword; /// 修改密码时新密码必填提示 /// /// In zh, this message translates to: /// **'请输入新密码'** String get newPasswordRequired; /// 密码格式验证 /// /// In zh, this message translates to: /// **'密码需8-16位,包含大小写字母和数字'** String get passwordFormatError; /// 修改密码时确认密码标题 /// /// In zh, this message translates to: /// **'再次确认密码'** String get confirmPassword; /// 修改密码时确认密码必填提示 /// /// In zh, this message translates to: /// **'请再次确认密码'** String get confirmPasswordRequired; /// 修改密码时确认密码不一致提示 /// /// In zh, this message translates to: /// **'两次密码不一致'** String get confirmPasswordError; /// 确定按钮文本 /// /// In zh, this message translates to: /// **'确定'** String get confirm; /// 取消按钮文本 /// /// In zh, this message translates to: /// **'取消'** String get cancel; /// 记住密码选项 /// /// In zh, this message translates to: /// **'记住密码'** String get rememberPassword; /// 媒体功能测试页面标题 /// /// In zh, this message translates to: /// **'媒体功能测试'** String get mediaTest; /// 快速测试标题 /// /// In zh, this message translates to: /// **'快速测试(自动压缩)'** String get quickTest; /// 从相册选择图片按钮 /// /// In zh, this message translates to: /// **'从相册选择图片'** String get pickFromGallery; /// 使用系统相机拍照按钮 /// /// In zh, this message translates to: /// **'使用系统相机拍照'** String get pickFromCamera; /// 专业相机测试标题 /// /// In zh, this message translates to: /// **'专业相机测试'** String get professionalCameraTest; /// 使用专业相机拍照按钮 /// /// In zh, this message translates to: /// **'使用专业相机拍照'** String get useProfessionalCamera; /// 图片处理测试标题 /// /// In zh, this message translates to: /// **'图片处理测试'** String get imageProcessingTest; /// 获取图片信息按钮 /// /// In zh, this message translates to: /// **'获取图片信息'** String get getImageInfo; /// 去除 EXIF 按钮 /// /// In zh, this message translates to: /// **'去除 EXIF(医疗脱敏)'** String get removeExif; /// 压缩图片按钮 /// /// In zh, this message translates to: /// **'压缩图片'** String get compressImage; /// 清除所有图片按钮 /// /// In zh, this message translates to: /// **'清除所有图片'** String get clearAllImages; /// 选择的图片标题 /// /// In zh, this message translates to: /// **'选择的图片'** String get selectedImage; /// 相册或系统相机标签 /// /// In zh, this message translates to: /// **'相册/系统相机'** String get galleryOrSystemCamera; /// 专业相机标签 /// /// In zh, this message translates to: /// **'专业相机'** String get professionalCamera; /// 暂无图片提示 /// /// In zh, this message translates to: /// **'暂无图片'** String get noImage; /// 图片信息标题 /// /// In zh, this message translates to: /// **'图片信息'** String get imageInfo; /// 图片宽度标签 /// /// In zh, this message translates to: /// **'宽度'** String get imageWidth; /// 图片高度标签 /// /// In zh, this message translates to: /// **'高度'** String get imageHeight; /// 图片大小标签 /// /// In zh, this message translates to: /// **'大小'** String get imageSize; /// 图片格式标签 /// /// In zh, this message translates to: /// **'格式'** String get imageFormat; /// 相册选择成功提示 /// /// In zh, this message translates to: /// **'相册选择成功'** String get galleryPickSuccess; /// 拍照成功提示 /// /// In zh, this message translates to: /// **'拍照成功'** String get cameraPhotoSuccess; /// 专业相机拍照成功提示 /// /// In zh, this message translates to: /// **'专业相机拍照成功'** String get professionalCameraSuccess; /// 获取图片信息成功提示 /// /// In zh, this message translates to: /// **'获取图片信息成功'** String get getImageInfoSuccess; /// EXIF 去除成功提示 /// /// In zh, this message translates to: /// **'EXIF 去除成功(医疗脱敏完成)'** String get removeExifSuccess; /// 图片压缩成功提示 /// /// In zh, this message translates to: /// **'图片压缩成功'** String get compressImageSuccess; /// 清除所有图片成功提示 /// /// In zh, this message translates to: /// **'已清除所有图片'** String get clearAllImagesSuccess; /// 用户取消选择提示 /// /// In zh, this message translates to: /// **'用户取消了选择'** String get userCancelledSelection; /// 用户取消拍照提示 /// /// In zh, this message translates to: /// **'用户取消了拍照'** String get userCancelledPhoto; /// 专业相机就绪提示 /// /// In zh, this message translates to: /// **'相机已就绪,是否立即拍照?'** String get cameraReady; /// 原始大小标签 /// /// In zh, this message translates to: /// **'原始大小'** String get originalSize; /// 压缩后大小标签 /// /// In zh, this message translates to: /// **'压缩后'** String get compressedSize; /// 压缩率标签 /// /// In zh, this message translates to: /// **'压缩率'** String get compressionRatio; /// 像素单位 /// /// In zh, this message translates to: /// **'px'** String get pixels; /// 千字节单位 /// /// In zh, this message translates to: /// **'KB'** String get kilobytes; /// 移动网络警告提示 /// /// In zh, this message translates to: /// **'当前为移动网络\n部分功能受限'** String get mobileNetworkWarning; /// 无网络连接提示 /// /// In zh, this message translates to: /// **'当前无网络连接'** String get noNetworkConnection; /// 页面未找到标题 /// /// In zh, this message translates to: /// **'页面未找到'** String get pageNotFound; /// 页面未找到提示(带URI) /// /// In zh, this message translates to: /// **'页面未找到: {uri}'** String pageNotFoundWithUri(String uri); /// 返回首页按钮 /// /// In zh, this message translates to: /// **'返回首页'** String get returnHome; /// 首页标签 /// /// In zh, this message translates to: /// **'首页'** String get home; /// 医院标签 /// /// In zh, this message translates to: /// **'医院'** String get hospital; /// 商城标签 /// /// In zh, this message translates to: /// **'商城'** String get mall; /// 图片加载失败提示 /// /// In zh, this message translates to: /// **'图片加载失败'** String get imageLoadFailed; /// 拍照按钮 /// /// In zh, this message translates to: /// **'拍照'** String get takePhoto; /// 重试按钮 /// /// In zh, this message translates to: /// **'重试'** String get retry; /// 加载失败提示 /// /// In zh, this message translates to: /// **'加载失败'** String get loadFailed; } class _AppLocalizationsDelegate extends LocalizationsDelegate { const _AppLocalizationsDelegate(); @override Future load(Locale locale) { return SynchronousFuture(lookupAppLocalizations(locale)); } @override bool isSupported(Locale locale) => ['zh'].contains(locale.languageCode); @override bool shouldReload(_AppLocalizationsDelegate old) => false; } AppLocalizations lookupAppLocalizations(Locale locale) { // Lookup logic when only language code is specified. switch (locale.languageCode) { case 'zh': return AppLocalizationsZh(); } throw FlutterError( 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely ' 'an issue with the localizations generation tool. Please file an issue ' 'on GitHub with a reproducible sample app and the gen-l10n configuration ' 'that was used.', ); }