Skip to content

Commit

Permalink
Use anti translated title in submission box
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Dec 15, 2024
1 parent cc355bb commit 437907f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/submission/SubmissionComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { LicenseComponent } from "../license/LicenseComponent";
import { ToggleOptionComponent } from "../popup/ToggleOptionComponent";
import { FormattedText } from "../popup/FormattedTextComponent";
import { isAutoWarningShown } from "./autoWarning";
import { getAntiTranslatedTitle } from "../titles/titleAntiTranslateData";

export interface SubmissionComponentProps {
videoID: VideoID;
Expand Down Expand Up @@ -79,7 +80,10 @@ export const SubmissionComponent = (props: SubmissionComponentProps) => {
const [titles, setTitles] = React.useState<RenderedTitleSubmission[]>([]);
React.useEffect(() => {
(async () => {
const originalTitle = await formatTitleInternal(getCurrentPageTitle() || chrome.i18n.getMessage("OriginalTitle"), false, TitleFormatting.SentenceCase, true);
const unformattedOriginalTitle = await getAntiTranslatedTitle(props.videoID)
?? getCurrentPageTitle()
?? chrome.i18n.getMessage("OriginalTitle");
const originalTitle = await formatTitleInternal(unformattedOriginalTitle, false, TitleFormatting.SentenceCase, true);
setOriginalTitle(originalTitle);

const newTitles = [{
Expand Down

0 comments on commit 437907f

Please sign in to comment.