Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

feat: Move strings to resources for localization #420

Merged
merged 111 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
b704401
chore(release): 0.110.0-dev.1 [skip ci]
semantic-release-bot May 31, 2023
ac906db
feat(youtube/hide-ads): hide mix playlists
oSumAtrIX May 31, 2023
d792b97
chore(release): 0.110.0-dev.2 [skip ci]
semantic-release-bot May 31, 2023
1fd9c52
renaming keys
LisoUseInAIKyrios Jun 5, 2023
527ab28
sort by actual title name (works when localized too)
LisoUseInAIKyrios Jun 5, 2023
b4c474c
no functional changes: renamed classes
LisoUseInAIKyrios Jun 6, 2023
56b38d3
sorting, comments
LisoUseInAIKyrios Jun 6, 2023
5052b6e
adding clarity
LisoUseInAIKyrios Jun 6, 2023
bcf40d0
logging
LisoUseInAIKyrios Jun 6, 2023
4b98b08
fixing renamed string keys
LisoUseInAIKyrios Jun 7, 2023
5939eda
renamed string keys
LisoUseInAIKyrios Jun 7, 2023
d7c1848
no functional changes: renamed classes
LisoUseInAIKyrios Jun 10, 2023
30903f8
no functional changes: renamed classes
LisoUseInAIKyrios Jun 10, 2023
89a2b8d
tiktok translations
LisoUseInAIKyrios Jun 10, 2023
d4ab94a
Revert "tiktok translations"
LisoUseInAIKyrios Jun 10, 2023
40920a8
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jun 13, 2023
2ef80fb
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jun 15, 2023
35e9cbf
sort groups as well
LisoUseInAIKyrios Jun 15, 2023
bd3bca9
Android preferences are the worse. After trying many different ways …
LisoUseInAIKyrios Jun 15, 2023
b334eca
use a sorted map instead
LisoUseInAIKyrios Jun 15, 2023
7b7ca59
use revanced prefix
LisoUseInAIKyrios Jun 15, 2023
749446e
use revanced prefix
LisoUseInAIKyrios Jun 15, 2023
248f233
Fixing strings not renamed. Android Studio apparently gives up after …
LisoUseInAIKyrios Jun 16, 2023
fdf3323
fixing RTL languages
LisoUseInAIKyrios Jun 16, 2023
181038b
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jun 18, 2023
b4e22bb
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jun 18, 2023
137cce4
comments
LisoUseInAIKyrios Jun 18, 2023
64b996f
fixing prefix that should not be renamed
LisoUseInAIKyrios Jun 20, 2023
3bc09b4
comments
LisoUseInAIKyrios Jun 20, 2023
3534486
Merge branch 'dev' into localization
LisoUseInAIKyrios Jun 22, 2023
cd205a5
Removing dead code. Cannot change quality if no internet connection …
LisoUseInAIKyrios Jun 22, 2023
742ebb8
Adding last untranslated strings.
LisoUseInAIKyrios Jun 22, 2023
89b36f4
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jun 23, 2023
2e74d09
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jun 28, 2023
a79cf45
this should be the last non-localized string
LisoUseInAIKyrios Jun 28, 2023
14980fe
Merge branch 'revanced:main' into localization
LisoUseInAIKyrios Jul 1, 2023
11f0e8e
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 3, 2023
0592bcd
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 5, 2023
0da9a22
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 6, 2023
71691b2
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 8, 2023
47c7356
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 14, 2023
6387689
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 16, 2023
c535d59
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 16, 2023
0e9dcbc
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 16, 2023
a0daa69
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 20, 2023
d31af2f
finishing merge
LisoUseInAIKyrios Jul 20, 2023
f2523ae
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jul 21, 2023
fdbf9e2
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 1, 2023
d261bfa
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 3, 2023
8e66b00
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 6, 2023
7ad6289
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 7, 2023
b8b4635
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 7, 2023
f7376f4
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 7, 2023
07b19cf
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 23, 2023
196c411
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Aug 26, 2023
1f7b7f6
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 7, 2023
e9e3c04
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 8, 2023
6683027
Merge branch 'dev' into localization
LisoUseInAIKyrios Sep 10, 2023
fb05e4f
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 15, 2023
c1f9e92
extract string
LisoUseInAIKyrios Sep 18, 2023
a291730
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 20, 2023
aa577f0
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 23, 2023
126de6d
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 24, 2023
ef22cb0
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 25, 2023
d09a3fd
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Sep 26, 2023
b3691ed
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Oct 2, 2023
281d46d
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Oct 3, 2023
1b42a62
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Oct 14, 2023
d82f418
Since strings are localized,sorting is now done at runtime.
LisoUseInAIKyrios Oct 14, 2023
cdfd8e6
No functional changes: renamed Utils classes.
LisoUseInAIKyrios Oct 14, 2023
855f0fa
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Oct 31, 2023
2814666
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 5, 2023
0eeb3df
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 10, 2023
46da1a5
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 11, 2023
d8bad80
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 13, 2023
40d9dc8
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 17, 2023
8f1d3c4
feat(YouTube):Add `Disable rolling number animations` patch (#519)
LisoUseInAIKyrios Nov 19, 2023
3eb07c1
fix(YouTube - Hide layout components): Check if `bytes` parameter of …
oSumAtrIX Nov 19, 2023
7ae7e8d
chore(release): 0.122.2-dev.1 [skip ci]
semantic-release-bot Nov 19, 2023
6aa55a2
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 20, 2023
006cb03
Sort groups at the end
LisoUseInAIKyrios Nov 20, 2023
e9ea66b
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 23, 2023
4ad4b1d
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 26, 2023
8e4bdec
extract strings
LisoUseInAIKyrios Nov 28, 2023
7301870
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 28, 2023
1f66179
no functional changes: move to shared integrations
LisoUseInAIKyrios Nov 29, 2023
adff712
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Nov 30, 2023
6c9ea78
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Dec 10, 2023
463b12e
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Dec 15, 2023
9f08a77
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Dec 22, 2023
545a20e
fix(YouTube - GmsCore support): Gracefully exit when GmsCore is not r…
oSumAtrIX Dec 30, 2023
b15fcd3
Merge branch 'dev' into fork/localization
oSumAtrIX Dec 31, 2023
354ed0e
refactor: use common class name
LisoUseInAIKyrios Dec 31, 2023
bc8e170
fix build
LisoUseInAIKyrios Dec 31, 2023
a498a2b
merge upstream
LisoUseInAIKyrios Jan 1, 2024
2b7003b
fix: Add menu sorting code overlooked during last merge
LisoUseInAIKyrios Jan 2, 2024
4c086a5
fix typo
LisoUseInAIKyrios Jan 2, 2024
549a271
Merge branch 'dev' into feat/music-check-for-gmscore
oSumAtrIX Jan 6, 2024
962564f
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jan 6, 2024
11926dd
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jan 9, 2024
c8f80e2
Merge branch 'dev' into feat/music-check-for-gmscore
oSumAtrIX Jan 11, 2024
8f3eba7
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jan 17, 2024
07f1eec
Merge remote-tracking branch 'upstream/dev' into localization
LisoUseInAIKyrios Jan 17, 2024
14f4e16
Include language code with announcement parameters if it's also local…
LisoUseInAIKyrios Jan 17, 2024
9297b1b
Merge branch 'dev' into feat/music-check-for-gmscore
oSumAtrIX Jan 18, 2024
c5d3b65
add missing 'revanced_sb_' resource prefix.
LisoUseInAIKyrios Jan 25, 2024
f35c235
use more consistent intent names
LisoUseInAIKyrios Jan 25, 2024
3d1c08e
use descriptive name
LisoUseInAIKyrios Jan 25, 2024
68d38d0
Correctly sort intent preferences
LisoUseInAIKyrios Jan 25, 2024
0e58589
Merge remote-tracking branch 'origin/feat/music-check-for-gmscore' in…
oSumAtrIX Jan 27, 2024
1612392
Merge branch 'dev' into localization
oSumAtrIX Jan 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static void checkAvailability() {
context.getPackageManager().getPackageInfo(MICROG_PACKAGE_NAME, PackageManager.GET_ACTIVITIES);
} catch (PackageManager.NameNotFoundException exception) {
LogHelper.printInfo(() -> "Vanced MicroG was not found", exception);
startIntent(context, VANCED_MICROG_DOWNLOAD_LINK, str("microg_not_installed_warning"));
startIntent(context, VANCED_MICROG_DOWNLOAD_LINK, str("revanced_microg_not_installed_warning"));

// Gracefully exit the app, so it does not crash.
System.exit(0);
Expand All @@ -47,7 +47,7 @@ public static void checkAvailability() {
try (var client = context.getContentResolver().acquireContentProviderClient(VANCED_MICROG_PROVIDER)) {
if (client != null) return;
LogHelper.printInfo(() -> "Vanced MicroG is not running in the background");
startIntent(context, DONT_KILL_MY_APP_LINK, str("microg_not_running_warning"));
startIntent(context, DONT_KILL_MY_APP_LINK, str("revanced_microg_not_running_warning"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public static void sendVote(@NonNull Vote vote) {
// Or shorts was loaded with regular video present, then shorts was closed,
// and then user voted on the now visible original video.
// Cannot send a vote, because the loaded videoId is for the wrong video.
ReVancedUtils.showToastLong(str("revanced_ryd_failure_ryd_enabled_while_playing_video_then_user_voted"));
ReVancedUtils.showToastLong(str("ryd_failure_ryd_enabled_while_playing_video_then_user_voted"));
LisoUseInAIKyrios marked this conversation as resolved.
Show resolved Hide resolved
return;
}

Expand Down Expand Up @@ -484,7 +484,7 @@ private static SpannableString createDislikeSpan(@NonNull Spanned oldSpannable,
// RYD data: https://returnyoutubedislikeapi.com/votes?videoId=UnrU5vxCHxw
//
// Change the "Likes" string to show that likes and dislikes are hidden.
String hiddenMessageString = str("revanced_ryd_video_likes_hidden_by_video_owner");
String hiddenMessageString = str("ryd_video_likes_hidden_by_video_owner");
return newSpanUsingStylingOfAnotherSpan(oldSpannable, hiddenMessageString);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private static boolean checkIfRateLimitWasHit(int httpResponseCode) {
numberOfRateLimitRequestsEncountered++;
LogHelper.printDebug(() -> "API rate limit was hit. Stopping API calls for the next "
+ RATE_LIMIT_BACKOFF_SECONDS + " seconds");
ReVancedUtils.showToastLong(str("revanced_ryd_failure_client_rate_limit_requested"));
ReVancedUtils.showToastLong(str("ryd_failure_client_rate_limit_requested"));
return true;
}
return false;
Expand Down Expand Up @@ -284,16 +284,16 @@ public static RYDVoteData fetchVotes(String videoId) {
LogHelper.printDebug(() -> "Video has no like/dislikes (video is a YouTube Story?): " + videoId);
return null; // do not updated connection statistics
} else {
handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null);
handleConnectionError(str("ryd_failure_connection_status_code", responseCode), null);
}
connection.disconnect(); // something went wrong, might as well disconnect
} catch (SocketTimeoutException ex) { // connection timed out, response timeout, or some other network error
handleConnectionError((str("revanced_ryd_failure_connection_timeout")), ex);
handleConnectionError((str("ryd_failure_connection_timeout")), ex);
} catch (IOException ex) {
handleConnectionError((str("revanced_ryd_failure_generic", ex.getMessage())), ex);
handleConnectionError((str("ryd_failure_generic", ex.getMessage())), ex);
} catch (Exception ex) {
// should never happen
LogHelper.printException(() -> "Failed to fetch votes", ex, str("revanced_ryd_failure_generic", ex.getMessage()));
LogHelper.printException(() -> "Failed to fetch votes", ex, str("ryd_failure_generic", ex.getMessage()));
}

updateStatistics(timeNetworkCallStarted, System.currentTimeMillis(), true, false);
Expand Down Expand Up @@ -331,12 +331,12 @@ public static String registerAsNewUser() {
String solution = solvePuzzle(challenge, difficulty);
return confirmRegistration(userId, solution);
}
handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null);
handleConnectionError(str("ryd_failure_connection_status_code", responseCode), null);
connection.disconnect();
} catch (SocketTimeoutException ex) {
handleConnectionError(str("revanced_ryd_failure_connection_timeout"), ex);
handleConnectionError(str("ryd_failure_connection_timeout"), ex);
} catch (IOException ex) {
handleConnectionError(str("revanced_ryd_failure_generic", "registration failed"), ex);
handleConnectionError(str("ryd_failure_generic", "registration failed"), ex);
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to register user", ex); // should never happen
}
Expand Down Expand Up @@ -378,12 +378,12 @@ private static String confirmRegistration(String userId, String solution) {
final String resultLog = result == null ? "(no response)" : result;
LogHelper.printInfo(() -> "Failed to confirm registration for user: " + userId
+ " solution: " + solution + " responseCode: " + responseCode + " responseString: " + resultLog);
handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null);
handleConnectionError(str("ryd_failure_connection_status_code", responseCode), null);
connection.disconnect(); // something went wrong, might as well disconnect
} catch (SocketTimeoutException ex) {
handleConnectionError(str("revanced_ryd_failure_connection_timeout"), ex);
handleConnectionError(str("ryd_failure_connection_timeout"), ex);
} catch (IOException ex) {
handleConnectionError(str("revanced_ryd_failure_generic", "confirm registration failed"), ex);
handleConnectionError(str("ryd_failure_generic", "confirm registration failed"), ex);
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to confirm registration for user: " + userId
+ "solution: " + solution, ex);
Expand Down Expand Up @@ -427,12 +427,12 @@ public static boolean sendVote(String videoId, String userId, ReturnYouTubeDisli
}
LogHelper.printInfo(() -> "Failed to send vote for video: " + videoId + " vote: " + vote
+ " response code was: " + responseCode);
handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null);
handleConnectionError(str("ryd_failure_connection_status_code", responseCode), null);
connection.disconnect(); // something went wrong, might as well disconnect
} catch (SocketTimeoutException ex) {
handleConnectionError(str("revanced_ryd_failure_connection_timeout"), ex);
handleConnectionError(str("ryd_failure_connection_timeout"), ex);
} catch (IOException ex) {
handleConnectionError(str("revanced_ryd_failure_generic", "send vote failed"), ex);
handleConnectionError(str("ryd_failure_generic", "send vote failed"), ex);
} catch (Exception ex) {
// should never happen
LogHelper.printException(() -> "Failed to send vote for video: " + videoId + " vote: " + vote, ex);
Expand Down Expand Up @@ -475,12 +475,12 @@ private static boolean confirmVote(String videoId, String userId, String solutio
final String resultLog = result == null ? "(no response)" : result;
LogHelper.printInfo(() -> "Failed to confirm vote for video: " + videoId
+ " solution: " + solution + " responseCode: " + responseCode + " responseString: " + resultLog);
handleConnectionError(str("revanced_ryd_failure_connection_status_code", responseCode), null);
handleConnectionError(str("ryd_failure_connection_status_code", responseCode), null);
connection.disconnect(); // something went wrong, might as well disconnect
} catch (SocketTimeoutException ex) {
handleConnectionError(str("revanced_ryd_failure_connection_timeout"), ex);
handleConnectionError(str("ryd_failure_connection_timeout"), ex);
} catch (IOException ex) {
handleConnectionError(str("revanced_ryd_failure_generic", "confirm vote failed"), ex);
handleConnectionError(str("ryd_failure_generic", "confirm vote failed"), ex);
} catch (Exception ex) {
LogHelper.printException(() -> "Failed to confirm vote for video: " + videoId
+ " solution: " + solution, ex); // should never happen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ private void importSettings(String replacementSettings) {
if (replacementSettings.equals(existingSettings)) {
return;
}
ReVancedSettingsFragment.settingImportInProgress = true;
YouTubeSettingsFragment.settingImportInProgress = true;
final boolean rebootNeeded = SettingsEnum.importJSON(replacementSettings);
if (rebootNeeded) {
ReVancedSettingsFragment.showRebootDialog(getContext());
YouTubeSettingsFragment.showRebootDialog(getContext());
}
} catch (Exception ex) {
LogHelper.printException(() -> "importSettings failure", ex);
} finally {
ReVancedSettingsFragment.settingImportInProgress = false;
YouTubeSettingsFragment.settingImportInProgress = false;
}
}

Expand Down
Loading