Migrate to the vue-i18n composition API#9375
Merged
Merged
Conversation
efb4f5ff-1298-471a-8973-3d47447115dc
approved these changes
Jul 5, 2026
PikachuEXE
approved these changes
Jul 6, 2026
ChunkyProgrammer
approved these changes
Jul 6, 2026
PikachuEXE
added a commit
to PikachuEXE/FreeTube
that referenced
this pull request
Jul 6, 2026
* development: (24 commits) Add dependabot groups for actions/cache and github/codeql-action (FreeTubeApp#9373) Handle compact published dates e.g. 1w ago in LockupViews (FreeTubeApp#9374) Migrate to the vue-i18n composition API (FreeTubeApp#9375) Bump electron from 42.4.1 to 42.5.2 (FreeTubeApp#9362) Bump eslint-plugin-unicorn from 69.0.0 to 70.0.0 in the eslint group (FreeTubeApp#9367) Bump actions/cache/restore from 6.0.0 to 6.1.0 (FreeTubeApp#9366) Bump actions/cache/save from 6.0.0 to 6.1.0 (FreeTubeApp#9365) Bump js-yaml from 5.2.0 to 5.2.1 (FreeTubeApp#9369) Fix lazy rendering on channel home pages (FreeTubeApp#9336) Fix publish time parsing (FreeTubeApp#9310) Fix online playlist parsing & revert workaround with youtubei.js update (FreeTubeApp#9325) Fix parsing view counts in shorts-only playlists (FreeTubeApp#9333) Build static runtime AppImages with electron-builder (FreeTubeApp#9339) use new matrix icon (FreeTubeApp#9359) Translated using Weblate (Polish) Bump the webpack group across 1 directory with 2 updates (FreeTubeApp#9347) Bump the stylelint group across 1 directory with 3 updates (FreeTubeApp#9345) Bump vue from 3.5.38 to 3.5.39 (FreeTubeApp#9353) Bump js-yaml from 4.2.0 to 5.2.0 (FreeTubeApp#9348) Bump globals from 17.6.0 to 17.7.0 (FreeTubeApp#9350) ... # Conflicts: # src/renderer/components/GeneralSettings/GeneralSettings.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Type
Description
vue-i18n has been logging a warning to the console for a while now saying that the legacy API is deprecated and will be removed in vue-i18n v12 and that we should migrate to the vue-i18n composition API. As we've been migrating components to the composition API one by one, we were using the legacy API plus a custom useI18n composable polyfill, with a custom ESLint rule to enforce the usage of the polyfill.
This pull request migrates to the vue-i18n composition API, removing the custom polyfill and ESLint rule. In most places it was just a case of swapping the useI18n import to
vue-i18n. Thelocaleandmessagesproperties on the global instance changed from reactive properties to aWriteableComputedRefand aComputedRefrespectively so I had to add.valuefor those. In the two remaining components using the Vue options API,Watchandft-list-video, I added thesetuplifecyle hook which callsuseI18nand returns the translation function and locale (I did try to return the translation function as$tinstead oftbut Vue logged a warning about dollar and underscore prefixed properties being reserved for app level injected properties).I was originally going to wait until all components had been migrated to the Vue composition API but as there are open pull requests that touch the
ft-list-videoandWatchcomponents, I decided not to wait (I also wanted to cross this item off my todo list :P ). The changes in this pull request shouldn't cause any conflicts, at least from my quick skimming over the lines that the other open pull requests touch.Running
pnpm run pack:rendererbefore and after the change showed thedist/renderer.jsfile being 4114 bytes smaller.Testing
Try changing the locale and make sure the display strings change to match the chosen locale.
Desktop