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

fix(UI): hide Translate Post button if a translation API endpoint isn't specified #50

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

aaga
Copy link

@aaga aaga commented Oct 3, 2023

I was poking around translation-related things and discovered this old commit from upstream that I think introduced a bug with shouldTranslate behavior.

Figured I'd open a PR to revert that change and hide the translate button, since we don't know have a roadmap for adding translation yet.

@aaga aaga requested a review from a team as a code owner October 3, 2023 17:38
@aaga aaga changed the title Hide the Translate Post button if no translation API endpoint has been defined fix(UI): hide Translate Post button if a translation API endpoint isn't specified Oct 3, 2023
@@ -103,7 +103,7 @@ export function useTranslation(status: mastodon.v1.Status | mastodon.v1.StatusEd
&& supportedTranslationCodes.includes(to as any)
&& supportedTranslationCodes.includes(status.language as any)
&& !userSettings.value.disabledTranslationLanguages.includes(status.language)
const enabled = /*! !useRuntimeConfig().public.translateApi && */ shouldTranslate

Choose a reason for hiding this comment

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

I'm very interested in why this was just a single ! before lol

Copy link
Author

Choose a reason for hiding this comment

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

@jpezninjo oh lol yeah I was wondering that too; but if you look closer the second ! is there right after the /*. How it got there,, i don't know.

Choose a reason for hiding this comment

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

Ah that makes complete sense. Good eye!

@aaga aaga merged commit cf17c92 into main Oct 5, 2023
3 checks passed
@aaga aaga deleted the hide-translate-if-no-api branch October 5, 2023 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants