Skip to content

Commit

Permalink
remove formats from en-US, add typing to id
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireChicken12 committed Nov 17, 2023
1 parent bfd2858 commit 548a3d9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
5 changes: 0 additions & 5 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@
"label": "Screenshot format",
"title": "The format to save the screenshot in"
},
"format": {
"png": "PNG",
"jpeg": "JPEG",
"webp": "WebP"
},
"saveAs": {
"file": "File",
"clipboard": "Clipboard"
Expand Down
1 change: 0 additions & 1 deletion public/locales/en-US.json.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ interface EnUS {
label: "Enable screenshot button";
title: "Adds a button to the player to take a screenshot of the video";
};
format: { jpeg: "JPEG"; png: "PNG"; webp: "WebP" };
saveAs: { clipboard: "Clipboard"; file: "File" };
selectFormat: { label: "Screenshot format"; title: "The format to save the screenshot in" };
selectSaveAs: { label: "Screenshot save type"; title: "The screenshot save type" };
Expand Down
15 changes: 7 additions & 8 deletions src/components/Settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { configuration, configurationKeys } from "@/src/@types";
import type { configuration, configurationKeys } from "@/src/types";
import type EnUS from "public/locales/en-US.json";
import type { ChangeEvent, Dispatch, SetStateAction } from "react";

import "@/assets/styles/tailwind.css";
import "@/components/Settings/Settings.css";
import { useNotifications } from "@/hooks";
import { youtubePlayerSpeedRate } from "@/src/@types";
import { availableLocales, type i18nInstanceType } from "@/src/i18n";
import { youtubePlayerSpeedRate } from "@/src/types";
import { configurationImportSchema } from "@/src/utils/constants";
import { cn, settingsAreDefault } from "@/src/utils/utilities";
import React, { Suspense, useEffect, useState } from "react";
Expand Down Expand Up @@ -52,7 +52,7 @@ function LanguageOptions({
<SettingTitle title={t("settings.sections.language.title")} />
<Setting
disabled={false}
id="language_select"
id="language"
label={t("settings.sections.language.select.label")}
onChange={setValueOption("language")}
options={languageOptions}
Expand Down Expand Up @@ -163,7 +163,6 @@ export default function Settings({
returnObjects: true
});
const {
format: { jpeg, png, webp },
saveAs: { clipboard, file }
} = t("settings.sections.screenshotButton", {
defaultValue: {},
Expand Down Expand Up @@ -266,9 +265,9 @@ export default function Settings({
].reverse();
const YouTubePlayerSpeedOptions: SelectOption[] = youtubePlayerSpeedRate.map((rate) => ({ label: rate.toString(), value: rate.toString() }));
const ScreenshotFormatOptions: SelectOption[] = [
{ label: png, value: "png" },
{ label: jpeg, value: "jpeg" },
{ label: webp, value: "webp" }
{ label: "PNG", value: "png" },
{ label: "JPEG", value: "jpeg" },
{ label: "WebP", value: "webp" }
];
const ScreenshotSaveAsOptions: SelectOption[] = [
{ label: file, value: "file" },
Expand Down Expand Up @@ -419,7 +418,7 @@ export default function Settings({
/>
<Setting
disabled={settings.enable_scroll_wheel_volume_control.toString() !== "true"}
id="osd_color_select"
id="osd_display_color"
label={t("settings.sections.scrollWheelVolumeControl.osdColor.label")}
onChange={setValueOption("osd_display_color")}
options={colorOptions}
Expand Down
3 changes: 3 additions & 0 deletions src/components/Settings/components/Setting.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { configuration } from "@/src/types";

import type { CheckboxProps } from "../../Inputs/CheckBox/CheckBox";
import type { NumberInputProps } from "../../Inputs/Number/Number";
import type { SelectProps } from "../../Inputs/Select/Select";
Expand All @@ -6,6 +8,7 @@ import type { SliderProps } from "../../Inputs/Slider/Slider";
import { Checkbox, NumberInput, Select, Slider } from "../../Inputs";

type SettingInputProps = {
id: keyof configuration;
title: string;
} & (
| ({ type: "checkbox" } & CheckboxProps)
Expand Down

0 comments on commit 548a3d9

Please sign in to comment.