Skip to content

Commit

Permalink
Add initial language selection helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
perry-mitchell committed Apr 9, 2024
1 parent 94b25e5 commit dcee374
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions source/background/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { naiveClone } from "../../shared/library/clone.js";
const DEFAULTS: Configuration = {
entryIcons: true,
inputButtonDefault: InputButtonType.LargeButton,
language: null,
saveNewLogins: true,
theme: "light",
useSystemTheme: true
Expand Down
16 changes: 15 additions & 1 deletion source/popup/components/pages/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,21 @@ export function SettingsPage() {
)}
{config && (
<Fragment>
<SettingSection title={t("config.section.application")}>
{/* <Select
activeItem={activeInputButtonItem}
fill
filterable={false}
items={inputButtonItems}
onItemSelect={handleInputButtonItemSelect}
itemRenderer={renderInputButtonTypeItem}
>
<Button
text={t(`config.input-button-type.${config.inputButtonDefault}`)}
rightIcon="double-caret-vertical"
/>
</Select> */}
</SettingSection>
<SettingSection title={t("config.section.theme")}>
<Switch
checked={config.useSystemTheme}
Expand Down Expand Up @@ -154,7 +169,6 @@ export function SettingsPage() {
<Button
text={t(`config.input-button-type.${config.inputButtonDefault}`)}
rightIcon="double-caret-vertical"
// placeholder="Select a film"
/>
</Select>
</SettingSection>
Expand Down
12 changes: 12 additions & 0 deletions source/popup/hooks/languages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useMemo } from "react";
import { TRANSLATIONS } from "../../shared/i18n/trans.js";

export interface LanguageOption {
key: string | null;
name: string;
}

export function useLanguageOptions(): Array<LanguageOption> {
const languages = useMemo(() => [], []);
return languages;
}
1 change: 1 addition & 0 deletions source/shared/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"section": {
"advanced": "Advanced Settings",
"application": "Application",
"forms": "Forms",
"logins": "Logins",
"privacy": "Privacy",
Expand Down
2 changes: 1 addition & 1 deletion source/shared/library/version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Do not edit this file - it is generated automatically at build time

export const BUILD_DATE = "2024-04-07";
export const BUILD_DATE = "2024-04-08";
export const VERSION = "3.1.0";
1 change: 1 addition & 0 deletions source/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export type ChildElements = ChildElement | Array<ChildElement>;
export interface Configuration {
entryIcons: boolean;
inputButtonDefault: InputButtonType;
language: string | null;
saveNewLogins: boolean;
theme: "light" | "dark";
useSystemTheme: boolean;
Expand Down

0 comments on commit dcee374

Please sign in to comment.