| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572 |
- 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<AppLocalizations>(context, AppLocalizations);
- }
- static const LocalizationsDelegate<AppLocalizations> 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<LocalizationsDelegate<dynamic>> localizationsDelegates =
- <LocalizationsDelegate<dynamic>>[
- delegate,
- GlobalMaterialLocalizations.delegate,
- GlobalCupertinoLocalizations.delegate,
- GlobalWidgetsLocalizations.delegate,
- ];
- /// A list of this localizations delegate's supported locales.
- static const List<Locale> supportedLocales = <Locale>[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;
- }
- class _AppLocalizationsDelegate
- extends LocalizationsDelegate<AppLocalizations> {
- const _AppLocalizationsDelegate();
- @override
- Future<AppLocalizations> load(Locale locale) {
- return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
- }
- @override
- bool isSupported(Locale locale) =>
- <String>['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.',
- );
- }
|