FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Clean up many unused strings

Open absidue opened this issue 1 year ago • 1 comments

Clean up many unused strings

Pull Request Type

  • [x] 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 (976727aadd04c2aed1a840ba73da4db199f7293f): 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 #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 #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 #5058
  • User Playlists.Disable Quick Bookmark -> Unused since #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: 976727aadd04c2aed1a840ba73da4db199f7293f

absidue avatar Oct 17 '24 21:10 absidue

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?

kommunarr avatar Oct 20 '24 17:10 kommunarr

  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.

absidue avatar Oct 21 '24 15:10 absidue

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.

kommunarr avatar Oct 21 '24 16:10 kommunarr