app_localizations.dart 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. import 'dart:async';
  2. import 'package:flutter/foundation.dart';
  3. import 'package:flutter/widgets.dart';
  4. import 'package:flutter_localizations/flutter_localizations.dart';
  5. import 'package:intl/intl.dart' as intl;
  6. import 'app_localizations_zh.dart';
  7. // ignore_for_file: type=lint
  8. /// Callers can lookup localized strings with an instance of AppLocalizations
  9. /// returned by `AppLocalizations.of(context)`.
  10. ///
  11. /// Applications need to include `AppLocalizations.delegate()` in their app's
  12. /// `localizationDelegates` list, and the locales they support in the app's
  13. /// `supportedLocales` list. For example:
  14. ///
  15. /// ```dart
  16. /// import 'l10n/app_localizations.dart';
  17. ///
  18. /// return MaterialApp(
  19. /// localizationsDelegates: AppLocalizations.localizationsDelegates,
  20. /// supportedLocales: AppLocalizations.supportedLocales,
  21. /// home: MyApplicationHome(),
  22. /// );
  23. /// ```
  24. ///
  25. /// ## Update pubspec.yaml
  26. ///
  27. /// Please make sure to update your pubspec.yaml to include the following
  28. /// packages:
  29. ///
  30. /// ```yaml
  31. /// dependencies:
  32. /// # Internationalization support.
  33. /// flutter_localizations:
  34. /// sdk: flutter
  35. /// intl: any # Use the pinned version from flutter_localizations
  36. ///
  37. /// # Rest of dependencies
  38. /// ```
  39. ///
  40. /// ## iOS Applications
  41. ///
  42. /// iOS applications define key application metadata, including supported
  43. /// locales, in an Info.plist file that is built into the application bundle.
  44. /// To configure the locales supported by your app, you’ll need to edit this
  45. /// file.
  46. ///
  47. /// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
  48. /// Then, in the Project Navigator, open the Info.plist file under the Runner
  49. /// project’s Runner folder.
  50. ///
  51. /// Next, select the Information Property List item, select Add Item from the
  52. /// Editor menu, then select Localizations from the pop-up menu.
  53. ///
  54. /// Select and expand the newly-created Localizations item then, for each
  55. /// locale your application supports, add a new item and select the locale
  56. /// you wish to add from the pop-up menu in the Value field. This list should
  57. /// be consistent with the languages listed in the AppLocalizations.supportedLocales
  58. /// property.
  59. abstract class AppLocalizations {
  60. AppLocalizations(String locale)
  61. : localeName = intl.Intl.canonicalizedLocale(locale.toString());
  62. final String localeName;
  63. static AppLocalizations? of(BuildContext context) {
  64. return Localizations.of<AppLocalizations>(context, AppLocalizations);
  65. }
  66. static const LocalizationsDelegate<AppLocalizations> delegate =
  67. _AppLocalizationsDelegate();
  68. /// A list of this localizations delegate along with the default localizations
  69. /// delegates.
  70. ///
  71. /// Returns a list of localizations delegates containing this delegate along with
  72. /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
  73. /// and GlobalWidgetsLocalizations.delegate.
  74. ///
  75. /// Additional delegates can be added by appending to this list in
  76. /// MaterialApp. This list does not have to be used at all if a custom list
  77. /// of delegates is preferred or required.
  78. static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
  79. <LocalizationsDelegate<dynamic>>[
  80. delegate,
  81. GlobalMaterialLocalizations.delegate,
  82. GlobalCupertinoLocalizations.delegate,
  83. GlobalWidgetsLocalizations.delegate,
  84. ];
  85. /// A list of this localizations delegate's supported locales.
  86. static const List<Locale> supportedLocales = <Locale>[Locale('zh')];
  87. /// 应用名称
  88. ///
  89. /// In zh, this message translates to:
  90. /// **'SinoMed Cloud'**
  91. String get appName;
  92. /// 应用副标题
  93. ///
  94. /// In zh, this message translates to:
  95. /// **'中方诊药云'**
  96. String get appSubtitle;
  97. /// 密码登录标签
  98. ///
  99. /// In zh, this message translates to:
  100. /// **'密码登录'**
  101. String get passwordLogin;
  102. /// 验证码登录标签
  103. ///
  104. /// In zh, this message translates to:
  105. /// **'验证码登录'**
  106. String get smsLogin;
  107. /// 手机号标签
  108. ///
  109. /// In zh, this message translates to:
  110. /// **'手机号'**
  111. String get phoneNumber;
  112. /// 手机号输入提示/必填验证
  113. ///
  114. /// In zh, this message translates to:
  115. /// **'请输入手机号'**
  116. String get phoneNumberRequired;
  117. /// 手机号格式验证
  118. ///
  119. /// In zh, this message translates to:
  120. /// **'请输入正确的手机号'**
  121. String get phoneNumberInvalid;
  122. /// 密码标签
  123. ///
  124. /// In zh, this message translates to:
  125. /// **'密码'**
  126. String get password;
  127. /// 密码输入提示/必填验证
  128. ///
  129. /// In zh, this message translates to:
  130. /// **'请输入密码'**
  131. String get passwordRequired;
  132. /// 密码长度验证
  133. ///
  134. /// In zh, this message translates to:
  135. /// **'密码长度不能少于6位'**
  136. String get passwordMinLength;
  137. /// 忘记密码链接
  138. ///
  139. /// In zh, this message translates to:
  140. /// **'忘记密码?'**
  141. String get forgotPassword;
  142. /// 忘记密码功能提示
  143. ///
  144. /// In zh, this message translates to:
  145. /// **'忘记密码功能待实现'**
  146. String get forgotPasswordNotImplemented;
  147. /// 登录按钮
  148. ///
  149. /// In zh, this message translates to:
  150. /// **'登录'**
  151. String get login;
  152. /// 退出登录按钮
  153. ///
  154. /// In zh, this message translates to:
  155. /// **'退出登录'**
  156. String get logout;
  157. /// 我的页面标题
  158. ///
  159. /// In zh, this message translates to:
  160. /// **'我的'**
  161. String get mine;
  162. /// 修改密码按钮
  163. ///
  164. /// In zh, this message translates to:
  165. /// **'修改密码'**
  166. String get changePassword;
  167. /// 修改密码成功提示
  168. ///
  169. /// In zh, this message translates to:
  170. /// **'修改密码成功'**
  171. String get changePasswordSuccess;
  172. /// 修改密码失败提示
  173. ///
  174. /// In zh, this message translates to:
  175. /// **'修改密码失败'**
  176. String get changePasswordFailed;
  177. /// 登录功能提示
  178. ///
  179. /// In zh, this message translates to:
  180. /// **'登录功能待实现'**
  181. String get loginNotImplemented;
  182. /// 验证码标签
  183. ///
  184. /// In zh, this message translates to:
  185. /// **'验证码'**
  186. String get smsCode;
  187. /// 验证码输入提示/必填验证
  188. ///
  189. /// In zh, this message translates to:
  190. /// **'请输入验证码'**
  191. String get smsCodeRequired;
  192. /// 验证码长度验证
  193. ///
  194. /// In zh, this message translates to:
  195. /// **'验证码为4位数字'**
  196. String get smsCodeLength;
  197. /// 验证码格式验证
  198. ///
  199. /// In zh, this message translates to:
  200. /// **'验证码格式不正确'**
  201. String get smsCodeInvalid;
  202. /// 验证码已过期或未获取提示
  203. ///
  204. /// In zh, this message translates to:
  205. /// **'请获取验证码'**
  206. String get smsCodeExpired;
  207. /// 验证码过期提示
  208. ///
  209. /// In zh, this message translates to:
  210. /// **'验证码已过期'**
  211. String get smsCodeHasExpired;
  212. /// 验证码输入错误提示
  213. ///
  214. /// In zh, this message translates to:
  215. /// **'验证码错误'**
  216. String get smsCodeError;
  217. /// 获取验证码按钮
  218. ///
  219. /// In zh, this message translates to:
  220. /// **'获取验证码'**
  221. String get getSmsCode;
  222. /// 验证码发送成功提示
  223. ///
  224. /// In zh, this message translates to:
  225. /// **'验证码已发送'**
  226. String get smsCodeSent;
  227. /// 重新获取验证码按钮文本
  228. ///
  229. /// In zh, this message translates to:
  230. /// **'请重新获取验证码'**
  231. String get resendSmsCode;
  232. /// 验证码倒计时
  233. ///
  234. /// In zh, this message translates to:
  235. /// **'{count}秒'**
  236. String smsCodeCountdown(int count);
  237. /// 输入新密码标题
  238. ///
  239. /// In zh, this message translates to:
  240. /// **'新密码'**
  241. String get newPassword;
  242. /// 修改密码时新密码必填提示
  243. ///
  244. /// In zh, this message translates to:
  245. /// **'请输入新密码'**
  246. String get newPasswordRequired;
  247. /// 密码格式验证
  248. ///
  249. /// In zh, this message translates to:
  250. /// **'密码需8-16位,包含大小写字母和数字'**
  251. String get passwordFormatError;
  252. /// 修改密码时确认密码标题
  253. ///
  254. /// In zh, this message translates to:
  255. /// **'再次确认密码'**
  256. String get confirmPassword;
  257. /// 修改密码时确认密码必填提示
  258. ///
  259. /// In zh, this message translates to:
  260. /// **'请再次确认密码'**
  261. String get confirmPasswordRequired;
  262. /// 修改密码时确认密码不一致提示
  263. ///
  264. /// In zh, this message translates to:
  265. /// **'两次密码不一致'**
  266. String get confirmPasswordError;
  267. /// 确定按钮文本
  268. ///
  269. /// In zh, this message translates to:
  270. /// **'确定'**
  271. String get confirm;
  272. /// 取消按钮文本
  273. ///
  274. /// In zh, this message translates to:
  275. /// **'取消'**
  276. String get cancel;
  277. /// 记住密码选项
  278. ///
  279. /// In zh, this message translates to:
  280. /// **'记住密码'**
  281. String get rememberPassword;
  282. /// 媒体功能测试页面标题
  283. ///
  284. /// In zh, this message translates to:
  285. /// **'媒体功能测试'**
  286. String get mediaTest;
  287. /// 快速测试标题
  288. ///
  289. /// In zh, this message translates to:
  290. /// **'快速测试(自动压缩)'**
  291. String get quickTest;
  292. /// 从相册选择图片按钮
  293. ///
  294. /// In zh, this message translates to:
  295. /// **'从相册选择图片'**
  296. String get pickFromGallery;
  297. /// 使用系统相机拍照按钮
  298. ///
  299. /// In zh, this message translates to:
  300. /// **'使用系统相机拍照'**
  301. String get pickFromCamera;
  302. /// 专业相机测试标题
  303. ///
  304. /// In zh, this message translates to:
  305. /// **'专业相机测试'**
  306. String get professionalCameraTest;
  307. /// 使用专业相机拍照按钮
  308. ///
  309. /// In zh, this message translates to:
  310. /// **'使用专业相机拍照'**
  311. String get useProfessionalCamera;
  312. /// 图片处理测试标题
  313. ///
  314. /// In zh, this message translates to:
  315. /// **'图片处理测试'**
  316. String get imageProcessingTest;
  317. /// 获取图片信息按钮
  318. ///
  319. /// In zh, this message translates to:
  320. /// **'获取图片信息'**
  321. String get getImageInfo;
  322. /// 去除 EXIF 按钮
  323. ///
  324. /// In zh, this message translates to:
  325. /// **'去除 EXIF(医疗脱敏)'**
  326. String get removeExif;
  327. /// 压缩图片按钮
  328. ///
  329. /// In zh, this message translates to:
  330. /// **'压缩图片'**
  331. String get compressImage;
  332. /// 清除所有图片按钮
  333. ///
  334. /// In zh, this message translates to:
  335. /// **'清除所有图片'**
  336. String get clearAllImages;
  337. /// 选择的图片标题
  338. ///
  339. /// In zh, this message translates to:
  340. /// **'选择的图片'**
  341. String get selectedImage;
  342. /// 相册或系统相机标签
  343. ///
  344. /// In zh, this message translates to:
  345. /// **'相册/系统相机'**
  346. String get galleryOrSystemCamera;
  347. /// 专业相机标签
  348. ///
  349. /// In zh, this message translates to:
  350. /// **'专业相机'**
  351. String get professionalCamera;
  352. /// 暂无图片提示
  353. ///
  354. /// In zh, this message translates to:
  355. /// **'暂无图片'**
  356. String get noImage;
  357. /// 图片信息标题
  358. ///
  359. /// In zh, this message translates to:
  360. /// **'图片信息'**
  361. String get imageInfo;
  362. /// 图片宽度标签
  363. ///
  364. /// In zh, this message translates to:
  365. /// **'宽度'**
  366. String get imageWidth;
  367. /// 图片高度标签
  368. ///
  369. /// In zh, this message translates to:
  370. /// **'高度'**
  371. String get imageHeight;
  372. /// 图片大小标签
  373. ///
  374. /// In zh, this message translates to:
  375. /// **'大小'**
  376. String get imageSize;
  377. /// 图片格式标签
  378. ///
  379. /// In zh, this message translates to:
  380. /// **'格式'**
  381. String get imageFormat;
  382. /// 相册选择成功提示
  383. ///
  384. /// In zh, this message translates to:
  385. /// **'相册选择成功'**
  386. String get galleryPickSuccess;
  387. /// 拍照成功提示
  388. ///
  389. /// In zh, this message translates to:
  390. /// **'拍照成功'**
  391. String get cameraPhotoSuccess;
  392. /// 专业相机拍照成功提示
  393. ///
  394. /// In zh, this message translates to:
  395. /// **'专业相机拍照成功'**
  396. String get professionalCameraSuccess;
  397. /// 获取图片信息成功提示
  398. ///
  399. /// In zh, this message translates to:
  400. /// **'获取图片信息成功'**
  401. String get getImageInfoSuccess;
  402. /// EXIF 去除成功提示
  403. ///
  404. /// In zh, this message translates to:
  405. /// **'EXIF 去除成功(医疗脱敏完成)'**
  406. String get removeExifSuccess;
  407. /// 图片压缩成功提示
  408. ///
  409. /// In zh, this message translates to:
  410. /// **'图片压缩成功'**
  411. String get compressImageSuccess;
  412. /// 清除所有图片成功提示
  413. ///
  414. /// In zh, this message translates to:
  415. /// **'已清除所有图片'**
  416. String get clearAllImagesSuccess;
  417. /// 用户取消选择提示
  418. ///
  419. /// In zh, this message translates to:
  420. /// **'用户取消了选择'**
  421. String get userCancelledSelection;
  422. /// 用户取消拍照提示
  423. ///
  424. /// In zh, this message translates to:
  425. /// **'用户取消了拍照'**
  426. String get userCancelledPhoto;
  427. /// 专业相机就绪提示
  428. ///
  429. /// In zh, this message translates to:
  430. /// **'相机已就绪,是否立即拍照?'**
  431. String get cameraReady;
  432. /// 原始大小标签
  433. ///
  434. /// In zh, this message translates to:
  435. /// **'原始大小'**
  436. String get originalSize;
  437. /// 压缩后大小标签
  438. ///
  439. /// In zh, this message translates to:
  440. /// **'压缩后'**
  441. String get compressedSize;
  442. /// 压缩率标签
  443. ///
  444. /// In zh, this message translates to:
  445. /// **'压缩率'**
  446. String get compressionRatio;
  447. /// 像素单位
  448. ///
  449. /// In zh, this message translates to:
  450. /// **'px'**
  451. String get pixels;
  452. /// 千字节单位
  453. ///
  454. /// In zh, this message translates to:
  455. /// **'KB'**
  456. String get kilobytes;
  457. /// 移动网络警告提示
  458. ///
  459. /// In zh, this message translates to:
  460. /// **'当前为移动网络\n部分功能受限'**
  461. String get mobileNetworkWarning;
  462. /// 无网络连接提示
  463. ///
  464. /// In zh, this message translates to:
  465. /// **'当前无网络连接'**
  466. String get noNetworkConnection;
  467. /// 页面未找到标题
  468. ///
  469. /// In zh, this message translates to:
  470. /// **'页面未找到'**
  471. String get pageNotFound;
  472. /// 页面未找到提示(带URI)
  473. ///
  474. /// In zh, this message translates to:
  475. /// **'页面未找到: {uri}'**
  476. String pageNotFoundWithUri(String uri);
  477. /// 返回首页按钮
  478. ///
  479. /// In zh, this message translates to:
  480. /// **'返回首页'**
  481. String get returnHome;
  482. /// 首页标签
  483. ///
  484. /// In zh, this message translates to:
  485. /// **'首页'**
  486. String get home;
  487. /// 医院标签
  488. ///
  489. /// In zh, this message translates to:
  490. /// **'医院'**
  491. String get hospital;
  492. /// 商城标签
  493. ///
  494. /// In zh, this message translates to:
  495. /// **'商城'**
  496. String get mall;
  497. /// 图片加载失败提示
  498. ///
  499. /// In zh, this message translates to:
  500. /// **'图片加载失败'**
  501. String get imageLoadFailed;
  502. /// 拍照按钮
  503. ///
  504. /// In zh, this message translates to:
  505. /// **'拍照'**
  506. String get takePhoto;
  507. /// 重试按钮
  508. ///
  509. /// In zh, this message translates to:
  510. /// **'重试'**
  511. String get retry;
  512. /// 加载失败提示
  513. ///
  514. /// In zh, this message translates to:
  515. /// **'加载失败'**
  516. String get loadFailed;
  517. /// 无网络连接错误提示(检查设置)
  518. ///
  519. /// In zh, this message translates to:
  520. /// **'当前无网络连接,请检查网络设置'**
  521. String get networkErrorCheckSettings;
  522. }
  523. class _AppLocalizationsDelegate
  524. extends LocalizationsDelegate<AppLocalizations> {
  525. const _AppLocalizationsDelegate();
  526. @override
  527. Future<AppLocalizations> load(Locale locale) {
  528. return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
  529. }
  530. @override
  531. bool isSupported(Locale locale) =>
  532. <String>['zh'].contains(locale.languageCode);
  533. @override
  534. bool shouldReload(_AppLocalizationsDelegate old) => false;
  535. }
  536. AppLocalizations lookupAppLocalizations(Locale locale) {
  537. // Lookup logic when only language code is specified.
  538. switch (locale.languageCode) {
  539. case 'zh':
  540. return AppLocalizationsZh();
  541. }
  542. throw FlutterError(
  543. 'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
  544. 'an issue with the localizations generation tool. Please file an issue '
  545. 'on GitHub with a reproducible sample app and the gen-l10n configuration '
  546. 'that was used.',
  547. );
  548. }