手动添加语言文件:juejin.cn/post/722174…
1. 插件安装
File --> Settings --> Plugins
2. 插件使用
1.配置网络(插件需要外网|代理|加速器)
File --> Settings --> Appearance & Behavior --> System Settings --> HTTP Proxy
2.语言文件及翻译生成
右键 strings.xml 文件,点击Translate to Other Languages
选择你需要翻译的语言即可
等待完成后会自动生成各地区|语言对应的 strings.xml 文件
3. Test
Example Code
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".MainActivity"
tools:viewBindingIgnore="true">
<TextView
android:id="@+id/halloText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="30dp"
android:gravity="center"
android:textSize="30dp"
android:text="@string/test" />
</LinearLayout>
</layout>
默认语言
默认调用的是 res/values/strings.xml 字符文件
简体中文
日语