当前位置:网站首页>Flutter简单实现多语言国际化
Flutter简单实现多语言国际化
2022-06-28 15:14:00 【明似水】
前言
最近做国外项目,那么国际化当然不可以避免啦,下面介绍一下国际化如何简单实现。
一、引入插件
flutter_localizations:
sdk: flutter

二、加入intl工具

点击initialize for the project后生成如下目录:
也可以点击Add Locale添加其他语言。
三、在main文件里配置

localizationsDelegates: const [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [...S.delegate.supportedLocales],
locale: const Locale('zh', 'TW'),
这样就简单加入了国际化配置。
四、使用
选中你要国际化的文字,按住option + 回车键,会弹窗如下:
选中Extract to ARB file
然后在String key写上你的命名,然后OK就自动生成对应的key。如图所示:
END.
边栏推荐
- Smart supplier management system for chemical manufacturing industry deeply explores the field of supplier management and improves supply chain collaboration
- 张同学还没学会当主播
- 当下不做元宇宙,就像20年前没买房!
- R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine a ggplot2 visualization result and a data table to form a final result graph
- New offline retail stores take off against the trend, and consumption enthusiasm under the dark cloud of inflation
- spacy教程(持续更新ing...)
- GCC efficient graph revolution for joint node representationlearning and clustering
- Do not use short circuit logic to write STL sorter multi condition comparison
- Innovation and upgrading of supply chain system driven management mode in petrochemical industry and strengthening internal management of enterprises
- Successful cases of rights protection of open source projects: successful rights protection of SPuG open source operation and maintenance platform
猜你喜欢

【算法篇】刷了两道大厂面试题,含泪 ”重学数组“

动力电池,是这样被“瓜分”的

厨卫电器行业S2B2C系统网站解决方案:打造S2B2C平台全渠道商业系统

2022年最新PyCharm激活破解码永久_详细安装教程(适用多版本)
DBMS in Oracle_ output. put_ Line output problem solving process

S2b2c system website solution for kitchen and bathroom electrical appliance industry: create s2b2c platform Omni channel commercial system

After QQ was stolen, a large number of users "died"

张同学还没学会当主播

go-zero 微服务实战系列(七、请求量这么高该如何优化)

High "green premium" of environmental protection products? How far is the low-carbon lifestyle from people
随机推荐
笔试面试算法经典–最长回文子串
兼顾企业抗疫和发展的5个解决方案,来自IBM
MIPS汇编语言学习-01-两数求和以及环境配置、如何运行
Leetcode 48. Rotate image (yes, resolved)
[C language] implementation of binary tree and three Traversals
Oracle11g database uses expdp to back up data every week and upload it to the backup server
What are the benefits of this PMP certificate?
R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine the two ggplot2 visualization results to form a single visualization result graph
How can the digital intelligent supply chain management platform of the smart Park optimize process management and drive the development of the park to increase speed and quality?
MIPS汇编语言学习-03-循环
当下不做元宇宙,就像20年前没买房!
R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果纵向堆叠起来(stacking)形成组合图、一个可视化结果堆叠在另外一个可视化结果上
雷科防务:4D毫米波雷达产品预计可以在年底量产供货
Send2vec tutorial
智能化转型被加速,企业需要新的工具箱
Could you tell me whether the batch addition of Oracle such as insert all was not blocked?
Oracle11g数据库使用expdp每周进行数据备份并上传到备份服务器
The latest pycharm activation cracking code in 2022 is permanent_ Detailed installation tutorial (applicable to multiple versions)
ORACLE中dbms_output.put_line输出问题的解决过程
R语言ggplot2可视化:使用patchwork包将两个ggplot2可视化结果横向构成新的结果可视化组合图(使用|符号)