update shared files

This commit is contained in:
flameshikari
2024-11-11 20:09:21 +05:00
parent 2a40731b78
commit b9e467a923
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -1,6 +1,13 @@
import { locales } from "../utils/date";
type LanguageOption = {
label: string;
value: keyof typeof locales;
};
// Note: Updating the available languages? Make sure to also update the
// locales array in shared/utils/date.ts to enable translation for timestamps.
export const languageOptions = [
export const languageOptions: LanguageOption[] = [
{
label: "Русский (Russian)",
value: "ru_RU",
+1 -1
View File
@@ -191,7 +191,7 @@ const locales = {
* @param language The user language
* @returns The date-fns locale.
*/
export function dateLocale(language: string | null | undefined) {
export function dateLocale(language: keyof typeof locales | undefined | null) {
return language ? locales[language] : undefined;
}