Update translations
This commit is contained in:
parent
977b6d9f67
commit
1ce1a94a35
@ -87,6 +87,7 @@ public class MagiskManager extends Application {
|
|||||||
public int suResponseType;
|
public int suResponseType;
|
||||||
public int suNotificationType;
|
public int suNotificationType;
|
||||||
public int suNamespaceMode;
|
public int suNamespaceMode;
|
||||||
|
public String localeConfig;
|
||||||
|
|
||||||
// Global resources
|
// Global resources
|
||||||
public SharedPreferences prefs;
|
public SharedPreferences prefs;
|
||||||
@ -125,11 +126,11 @@ public class MagiskManager extends Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setLocale() {
|
public void setLocale() {
|
||||||
String localeTag = prefs.getString("locale", "");
|
localeConfig = prefs.getString("locale", "");
|
||||||
if (localeTag.isEmpty()) {
|
if (localeConfig.isEmpty()) {
|
||||||
locale = defaultLocale;
|
locale = defaultLocale;
|
||||||
} else {
|
} else {
|
||||||
locale = Locale.forLanguageTag(localeTag);
|
locale = Locale.forLanguageTag(localeConfig);
|
||||||
}
|
}
|
||||||
Resources res = getBaseContext().getResources();
|
Resources res = getBaseContext().getResources();
|
||||||
Configuration config = new Configuration(res.getConfiguration());
|
Configuration config = new Configuration(res.getConfiguration());
|
||||||
@ -192,6 +193,7 @@ public class MagiskManager extends Application {
|
|||||||
.putString("multiuser_mode", String.valueOf(multiuserMode))
|
.putString("multiuser_mode", String.valueOf(multiuserMode))
|
||||||
.putString("mnt_ns", String.valueOf(suNamespaceMode))
|
.putString("mnt_ns", String.valueOf(suNamespaceMode))
|
||||||
.putString("busybox_version", BUSYBOX_VERSION)
|
.putString("busybox_version", BUSYBOX_VERSION)
|
||||||
|
.putString("locale", localeConfig)
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
// Add busybox to PATH
|
// Add busybox to PATH
|
||||||
|
@ -266,21 +266,23 @@ public class Utils {
|
|||||||
HashSet<String> set = new HashSet<>();
|
HashSet<String> set = new HashSet<>();
|
||||||
Locale locale;
|
Locale locale;
|
||||||
|
|
||||||
|
int compareId = R.string.download_file_error;
|
||||||
|
|
||||||
// Add default locale
|
// Add default locale
|
||||||
locales.add(Locale.ENGLISH);
|
locales.add(Locale.ENGLISH);
|
||||||
set.add(getLocaleString(context, Locale.ENGLISH, R.string.download));
|
set.add(getLocaleString(context, Locale.ENGLISH, compareId));
|
||||||
|
|
||||||
// Add some special locales
|
// Add some special locales
|
||||||
locales.add(Locale.TAIWAN);
|
locales.add(Locale.TAIWAN);
|
||||||
set.add(getLocaleString(context, Locale.TAIWAN, R.string.download));
|
set.add(getLocaleString(context, Locale.TAIWAN, compareId));
|
||||||
locale = new Locale("pt", "BR");
|
locale = new Locale("pt", "BR");
|
||||||
locales.add(locale);
|
locales.add(locale);
|
||||||
set.add(getLocaleString(context, locale, R.string.download));
|
set.add(getLocaleString(context, locale, compareId));
|
||||||
|
|
||||||
// Other locales
|
// Other locales
|
||||||
for (String s : context.getAssets().getLocales()) {
|
for (String s : context.getAssets().getLocales()) {
|
||||||
locale = Locale.forLanguageTag(s);
|
locale = Locale.forLanguageTag(s);
|
||||||
if (set.add(getLocaleString(context, locale, R.string.download))) {
|
if (set.add(getLocaleString(context, locale, compareId))) {
|
||||||
locales.add(locale);
|
locales.add(locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,5 +221,10 @@
|
|||||||
<string name="magisk_updates">Magisk 更新</string>
|
<string name="magisk_updates">Magisk 更新</string>
|
||||||
<string name="system_default">(系統預設)</string>
|
<string name="system_default">(系統預設)</string>
|
||||||
<string name="language">語言</string>
|
<string name="language">語言</string>
|
||||||
|
<string name="flashing">正在刷入</string>
|
||||||
|
<string name="hide_manager_toast">正在隱藏 Magisk Manager…</string>
|
||||||
|
<string name="hide_manager_fail_toast">隱藏 Magisk Manager 失敗</string>
|
||||||
|
<string name="settings_hide_manager_title">隱藏 Magisk Manager</string>
|
||||||
|
<string name="settings_hide_manager_summary">暫時隱藏 Magisk Manager。\n這會新增一個新的 app 叫做 Unhide Magisk Manager</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user