Add "All" to default languages
This commit is contained in:
@@ -89,12 +89,8 @@ function defaultNativeLang(): readonly string[] {
|
||||
return preferredLanguages;
|
||||
}
|
||||
|
||||
export function extensionDefaultLanguages(): string[] {
|
||||
return [...defaultNativeLang()];
|
||||
}
|
||||
|
||||
export function sourceDefaultLanguages(): string[] {
|
||||
return [...defaultNativeLang()];
|
||||
export function getDefaultLanguages(): string[] {
|
||||
return [...defaultNativeLang(), DefaultLanguage.ALL];
|
||||
}
|
||||
|
||||
export const languageSortComparator = (a: string, b: string) =>
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import Box from '@mui/material/Box';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { sourceDefaultLanguages } from '@/modules/core/utils/Languages.ts';
|
||||
import { getDefaultLanguages } from '@/modules/core/utils/Languages.ts';
|
||||
import { AppbarSearch } from '@/modules/core/components/AppbarSearch.tsx';
|
||||
import { LanguageSelect } from '@/modules/core/components/inputs/LanguageSelect.tsx';
|
||||
import { useDebounce } from '@/modules/core/hooks/useDebounce.ts';
|
||||
@@ -194,7 +194,7 @@ export const SearchAll: React.FC = () => {
|
||||
const [query] = useQueryParam('query', StringParam);
|
||||
const searchString = useDebounce(query, TRIGGER_SEARCH_THRESHOLD);
|
||||
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', sourceDefaultLanguages());
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', getDefaultLanguages());
|
||||
const {
|
||||
settings: { showNsfw },
|
||||
} = useMetadataServerSettings();
|
||||
|
||||
@@ -10,7 +10,7 @@ import { DEFAULT_DEVICE } from '@/modules/device/services/Device.ts';
|
||||
import { DEFAULT_SORT_SETTINGS } from '@/modules/migration/Migration.constants.ts';
|
||||
import { MetadataServerSettings } from '@/modules/settings/Settings.types.ts';
|
||||
import { GridLayout } from '@/modules/core/Core.types.ts';
|
||||
import { extensionDefaultLanguages } from '@/modules/core/utils/Languages.ts';
|
||||
import { getDefaultLanguages } from '@/modules/core/utils/Languages.ts';
|
||||
|
||||
export const SERVER_SETTINGS_METADATA_DEFAULT: MetadataServerSettings = {
|
||||
// downloads
|
||||
@@ -41,7 +41,7 @@ export const SERVER_SETTINGS_METADATA_DEFAULT: MetadataServerSettings = {
|
||||
|
||||
// browse
|
||||
hideLibraryEntries: false,
|
||||
extensionLanguages: extensionDefaultLanguages(),
|
||||
extensionLanguages: getDefaultLanguages(),
|
||||
showNsfw: true,
|
||||
|
||||
// history
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { CustomTooltip } from '@/modules/core/components/CustomTooltip.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { useLocalStorage } from '@/modules/core/hooks/useStorage.tsx';
|
||||
import { sourceDefaultLanguages } from '@/modules/core/utils/Languages.ts';
|
||||
import { getDefaultLanguages } from '@/modules/core/utils/Languages.ts';
|
||||
import { LoadingPlaceholder } from '@/modules/core/components/feedback/LoadingPlaceholder.tsx';
|
||||
import { SourceCard } from '@/modules/source/components/SourceCard.tsx';
|
||||
import { LanguageSelect } from '@/modules/core/components/inputs/LanguageSelect.tsx';
|
||||
@@ -31,7 +31,7 @@ import { useAppAction } from '@/modules/navigation-bar/hooks/useAppAction.ts';
|
||||
export function Sources() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', sourceDefaultLanguages());
|
||||
const [shownLangs, setShownLangs] = useLocalStorage<string[]>('shownSourceLangs', getDefaultLanguages());
|
||||
const {
|
||||
settings: { showNsfw },
|
||||
} = useMetadataServerSettings();
|
||||
|
||||
Reference in New Issue
Block a user