fixes + more translations

This commit is contained in:
gdlbo
2022-06-08 14:02:45 +03:00
parent f09cae1684
commit c5bf617f65
9 changed files with 41 additions and 26 deletions
@@ -2,6 +2,7 @@ package ru.vtosters.lite.foaf;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Proxy.getApiCom;
import static ru.vtosters.lite.utils.Proxy.proxy;
@@ -79,7 +80,7 @@ public class FoafBase {
matcher2.find();
String normalHumanDate = getNormalHumanDate(matcher.group(1));
getNormalHumanDate(matcher2.group(1));
AlertDialog.a a2 = new VkAlertDialog.a(context).a(R.string.addinf);
AlertDialog.a a2 = new VkAlertDialog.a(context).a(getIdentifier("addinf", "string"));
a2.b(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).b(17039370, null).b().show();
} catch (Exception e) {
e.printStackTrace();
@@ -2,6 +2,7 @@ package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getApplicationName;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Preferences.VERSIONNAME;
import static ru.vtosters.lite.utils.Preferences.oldabout;
@@ -21,25 +22,25 @@ public class About {
list.add(new Items1());
if (!oldabout()) {
list.add(new Items(21, com.vtosters.lite.R.string.opencommit));
list.add(new Items(8, com.vtosters.lite.R.string.tgchannel));
list.add(new Items(9, com.vtosters.lite.R.string.tgchat));
list.add(new Items(16, com.vtosters.lite.R.string.vtfaq));
list.add(new Items(19, com.vtosters.lite.R.string.vtsite));
list.add(new Items(20, com.vtosters.lite.R.string.donate));
list.add(new Items(17, com.vtosters.lite.R.string.vkgroup));
list.add(new Items(18, com.vtosters.lite.R.string.sett_debug));
list.add(new Items(21, getIdentifier("opencommit", "string")));
list.add(new Items(8, getIdentifier("tgchannel", "string")));
list.add(new Items(9, getIdentifier("tgchat", "string")));
list.add(new Items(16, getIdentifier("vtfaq", "string")));
list.add(new Items(19, getIdentifier("vtsite", "string")));
list.add(new Items(20, getIdentifier("donate", "string")));
list.add(new Items(17, getIdentifier("vkgroup", "string")));
list.add(new Items(18, getIdentifier("sett_debug", "string")));
return;
}
list.add(new Items(0, com.vtosters.lite.R.string.about_app_feedback));
list.add(new Items(1, com.vtosters.lite.R.string.about_app_estimate));
list.add(new Items(2, com.vtosters.lite.R.string.about_app_privacy));
list.add(new Items(5, com.vtosters.lite.R.string.about_app_cookie));
list.add(new Items(3, com.vtosters.lite.R.string.about_app_terms_to_use));
list.add(new Items(4, com.vtosters.lite.R.string.about_app_license));
list.add(new Items(6, com.vtosters.lite.R.string.about_app_data_protect));
list.add(new Items(8, com.vtosters.lite.R.string.sett_debug));
list.add(new Items(0, getIdentifier("about_app_feedback", "string")));
list.add(new Items(1, getIdentifier("about_app_estimate", "string")));
list.add(new Items(2, getIdentifier("about_app_privacy", "string")));
list.add(new Items(5, getIdentifier("about_app_cookie", "string")));
list.add(new Items(3, getIdentifier("about_app_terms_to_use", "string")));
list.add(new Items(4, getIdentifier("about_app_license", "string")));
list.add(new Items(6, getIdentifier("about_app_data_protect", "string")));
list.add(new Items(8, getIdentifier("sett_debug", "string")));
}
public static String getBuildNumber() {
return getBuild(getContext(), "version.properties");
@@ -75,7 +75,7 @@ public class DeletedMessagesHandler {
}
private static String getPreifxUndelete() {
return getPrefsValue("undeletemsg_prefix") + " ";
return getPrefsValue("undeletemsg_prefix_value") + " ";
}
public static void updateDialog(MsgDeleteLpTask msgDeleteLpTask) {
@@ -18,6 +18,7 @@ import android.net.NetworkInfo;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull;
@@ -129,7 +130,13 @@ public class Globals {
}
public static int getIdentifier(String name, String type) {
return getResources().getIdentifier(name, type, getContext().getPackageName());
try {
return getResources().getIdentifier(name, type, getContext().getPackageName());
} catch (Exception e) {
Log.d("VTLite", "Not found " + name + "as type " + type);
e.printStackTrace();
}
return 0;
} // Get res id
public static String getString(String resourcename) {
@@ -174,7 +181,7 @@ public class Globals {
}
} catch (Exception ignored) {}
if (!hasMusicChannel) {
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(com.vtosters.lite.R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(getIdentifier("audio_message_play_error", "string")), NotificationManager.IMPORTANCE_LOW));
}
}
} catch (Exception ignored) {}
+4 -1
View File
@@ -4205,6 +4205,7 @@
<string name="shitpostingsummary">Фильтр очистки постов с РФ и действиями связанными на Украине</string>
<string name="showstories">Показывать истории</string>
<string name="showstoriessum">Блок истории в верхней части ленты</string>
<string name="donaterecomm">Отключить рекомендации о донате</string>
<string name="showvtfire">Показывать специальные верификации</string>
<string name="showvtverify">Показывать верификации</string>
<string name="sprefsctype">Тип подключения</string>
@@ -4267,11 +4268,13 @@
<string name="feed_recommendations_authors_summary">Рекомендации постов популярных авторов контента</string>
<string name="feed_recommendations_friends_reacted_summary">Рекомендации лайкнутых постов ваших друзей</string>
<string name="feed_other_update">Обновление новостей</string>
<string name="feed_other_update">Автоматическое обновление новостей</string>
<string name="feed_other_update_dialog_title">Выберите тип обновления</string>
<string name="feed_other_sort_comments">Сортировка комментариев</string>
<string name="feed_other_sort_comments_summary">Сортировать комментарии по новизне</string>
<string name="feed_other_cache_summary">Оставлять список загруженных постов в ленте</string>
<string name="officialnewssett">Встроенные настройки новостей</string>
<string name="officialnewssett_summary">Официальные настройки новостей встроенные в клиент</string>
<string name="appearance_theme_info">Полезная информация</string>
<string name="appearance_theme_info_summary">Для применений изменений тем необходимо переключить тему</string>
+4 -1
View File
@@ -4330,6 +4330,7 @@ You need to restart the application to apply proxy settings"</string>
<string name="shitpostingsummary">Filter for cleaning posts with the Russian Federation and actions related in Ukraine</string>
<string name="showstories">Show stories</string>
<string name="showstoriessum">The story section at the top of the feed</string>
<string name="donaterecomm">Disable recommendations about donation</string>
<string name="showvtfire">Show special verifications</string>
<string name="showvtverify">Show verifications</string>
<string name="sprefsctype">Connection type</string>
@@ -4391,11 +4392,13 @@ May look like a fake leaving the online"</string>
<string name="feed_recommendations_authors_summary">Recommend popular authors\' posts friends</string>
<string name="feed_recommendations_friends_reacted_summary">Recommend posts that your friends like</string>
<string name="feed_other_update">Update news</string>
<string name="feed_other_update">Audo update news</string>
<string name="feed_other_update_dialog_title">Choose update type</string>
<string name="feed_other_sort_comments">Sort comments</string>
<string name="feed_other_sort_comments_summary">Sort comments by newest</string>
<string name="feed_other_cache_summary">Keep cached posts in feed</string>
<string name="officialnewssett">Built-in news settings</string>
<string name="officialnewssett_summary">Official news settings built-in into the client</string>
<string name="appearance_theme_info">Useful information</string>
<string name="appearance_theme_info_summary">To apply theme changes you should toggle the theme</string>
+1 -1
View File
@@ -6,7 +6,7 @@
android:dialogTitle="@string/activity_undel_dial"
android:entries="@array/undel_value"
android:entryValues="@array/undel"
android:key="undeletemsg_prefix"
android:key="undeletemsg_prefix_value"
android:title="@string/activity_undel_tag" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="true"
+2 -2
View File
@@ -85,8 +85,8 @@
<PreferenceCategory android:title="@string/vtlfeedwork">
<Preference
android:key="officialnewssett"
android:summary="Официальные настройки новостей встроенные в клиент"
android:title="Встроенные настройки новостей" />
android:summary="@string/officialnewssett_summary"
android:title="@string/officialnewssett" />
<com.vtosters.lite.ui.SummaryListPreference
android:defaultValue="default"
android:dialogTitle="@string/feed_other_update_dialog_title"
+1 -1
View File
@@ -71,6 +71,6 @@
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="donaterecomm"
android:title="Отключить рекомендации о донате" />
android:title="@string/donaterecomm" />
</PreferenceCategory>
</PreferenceScreen>