Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up many unused strings #5891

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Oct 17, 2024

Clean up many unused strings

Pull Request Type

  • Cleanup

Description

This pull request removes many of the unused strings in FreeTube's locale files, I left in ones that I thought we might use in the future such as app menu translations and Prompt to Skip for Sponsor Block. The removed strings can be divided into two groups, strings that no longer exist in the en-US file but hadn't been removed from other locale files and the second group are strings that did exist in en-US but are no longer used for one reason or another.

The unused strings were found by adding '@intlify/vue-i18n/no-unused-keys': ['error', { src: './src/renderer', }] to the rules object in the YAML section of the ESLint config and then manually checked (many thanks to VS Code's find in files functionality).

The size of the dist/static/locales folder after running yarn pack:renderer:

  • Current development branch commit (976727a): 627 KB
  • In 0.21.3: 606 KB
  • With this pull request: 587 KB

The removed strings:

Unused
  • User Playlists.Playlist Message -> We have support for multiple playlists now
  • User Playlists.Your saved videos are empty. ... -> We replaced the saved videos list with proper playlists support.
  • Toggle Theatre Mode -> Replaced by Video.Player.Theatre Mode and Video.Player.Exit Theatre Mode
  • Playlist.Videos -> Replaced by Global.Counts.Video Count
  • Playlist.Views -> Replaced by Global.Counts.View Count
  • Playlist.Views -> Replaced by Global.Counts.View Count
  • Settings.Data Settings.Check for Legacy Subscriptions -> The subscriptions import automatically detects the type based on the file extension and contents
  • Settings.Expand All Settings Sections -> Associated setting was removed in Settings menu & UX improvements #5029
  • Subscriptions have not yet been implemented -> FreeTube has had subscriptions for a long time now
  • Hashtags have not yet been implemented, try again later -> FreeTube has supported hashtags for a few releases now
  • Channels.Unsubscribe -> Replaced by Channel.Unsubscribe
  • Channels.Unsubscribed -> Replaced by Channel.Channel has been removed from your subscriptions
  • Settings.Subscription Settings.Manage Subscriptions -> The code using it was removed in Fix blank space in the subscription settings #2372 but even before then it was unused because the code using it has a v-if="false" on it, so it was never displayed.
Unused and not in en-US
  • About.Check out our Firefox extension! -> FreeTube doesn't have its own browser extension anymore
  • About.This software is FOSS and released under the GNU Affero General Public License v3.0.. -> Replaced by About.Licensed under the and About.AGPLv3
  • About.Thank you very much to the People and Projects that make FreeTube possible! -> Replaced by About.FreeTube is made possible by and About.these people and projects
  • About.Looking for help? Check out our Wiki page. -> Replaced by About.Help, About.FreeTube Wiki, About.FAQ and About.Discussions
  • About.Want to chat? Join our Element / Matrix Server . Please check the rules before joining. -> Replaced by About.Chat on Matrix, About.Please read the, About.room rules
  • About.If you enjoy using FreeTube, consider donating via Liberapay or through our Bitcoin address. -> Replaced by About.Donate
  • About.Found a bug? Want to suggest a feature? Want to help out? Check out our GitHub page. Pull requests are welcome.
  • About.Latest FreeTube News
  • About.View License
  • About.Translate via Weblate -> Replaced by About.Translate
  • About.Channel Rules -> Replaced by About.Please read the and About.room rules
  • About.Licensed under the AGPLv3 -> Replaced by About.Licensed under the and About.AGPLv3
  • About.License -> Replaced by About.Licensed under the and About.AGPLv3
  • About.Wiki -> Replaced by About.FreeTube Wiki
  • About.Useful Links
  • About.Release Notes -> Replaced by About.Downloads / Changelog
  • About.Report an Issue -> Replaced by About.Report a problem
  • About.Source Code -> Replaced by About.Source code
  • About.Contact
  • Channel.Subscriber -> Replaced by Global.Counts.Subscriber Count
  • Channel.Subscribers -> Replaced by Global.Counts.Subscriber Count
  • User Playlists.SinglePlaylistView.Toast.Quick bookmark disabled -> Unused since Always have quick bookmark set #5058
  • User Playlists.Disable Quick Bookmark -> Unused since Always have quick bookmark set #5058
  • User Playlists.Are you sure you want to remove all watched videos from this playlist? This cannot be undone -> Replaced by User Playlists.Are you sure you want to remove {playlistItemCount} watched videos from this playlist? This cannot be undone
  • Settings.Advanced Settings.* -> The entire section is not in en-US anymore
  • Settings.Subscription Settings.Import Subscriptions -> Subscription importing was moved to the data settings which has its own string
  • Settings.Subscription Settings.How do I import my subscriptions? -> Subscription importing was moved to the data settings which has its own string
  • Settings.Subscription Settings.Export Subscriptions -> Subscription exporting was moved to the data settings which has its own string
  • Settings.Subscription Settings.Subscriptions Export Format.* -> The entire section is not in en-US anymore
  • Settings.Data Settings.Import FreeTube
  • Settings.Data Settings.Import YouTube
  • Settings.Data Settings.Import NewPipe
  • Settings.Player Settings.Remember History -> Was moved to the privacy settings which has its own string
  • Settings.General Settings.Invidious Instance (Default is https://invidious.snopyta.org)
  • Settings.General Settings.External Player
  • Settings.General Settings.External Player Executable
  • Settings.Distraction Free Settings.Blur Thumbnails -> Replaced by Settings.General Settings.Thumbnail Preference.Blur
  • Profile.{count} selected

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 976727a

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 17, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) October 17, 2024 21:58
@kommunarr
Copy link
Collaborator

kommunarr commented Oct 20, 2024

LGTM, will approve if/when you give the green light. Two q's:

  1. What's the recommended hygiene for this going forward — if you deprecate a label in a PR, remove all instances of it in locale files as well? Fine by me, although it would increase the number of re-approvals needed due to merge conflicts
  2. If yes to 1, are we going to be enforcing @intlify/vue-i18n/no-unused-keys to make this easier for authors but with ignores entries for the "useful in future" labels?

@absidue
Copy link
Member Author

absidue commented Oct 21, 2024

  1. Ideally if you remove the last usage of a string you would clean it up too, that's what I've tried to do in my pull requests.
  2. I'm not sure on the one hand that definitely seems like the right approach but unfortunately due to the way weblate works, when someone creates a new locale, weblate creates a new file with all possible strings and sets them to empty strings (you can see it with Breton which was added in the last 24 hours). So I would be concerned that pull requests would start get flagged because of changes on the development branch, so if we do add it we probably want to set it to a warning, so that it doesn't block unrelated pull requests from getting merged but you still get warned about it while committing and in the editor.

@kommunarr
Copy link
Collaborator

That is reasonable. They do have an experiment enableFix option that should hopefully make the removal of unused keys automatic. If it works well, we may be able to set it as a warning and not need to devote any bandwidth to it ever again.

Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this should be fine to be included in v0.22.0

@FreeTubeBot FreeTubeBot merged commit 4d944b3 into FreeTubeApp:development Oct 21, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 21, 2024
@absidue absidue deleted the string-cleanup branch October 21, 2024 17:47
Soham456 pushed a commit to Soham456/FreeTube that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants