diff --git a/app/(auth)/(tabs)/(home)/index.tsx b/app/(auth)/(tabs)/(home)/index.tsx index b11e12f4..41e358fc 100644 --- a/app/(auth)/(tabs)/(home)/index.tsx +++ b/app/(auth)/(tabs)/(home)/index.tsx @@ -215,7 +215,7 @@ export default function index() { const latestMediaViews = collections.map((c) => { const includeItemTypes: BaseItemKind[] = c.CollectionType === "tvshows" ? ["Series"] : ["Movie"]; - const title = t("recentlyAdded" + c.Name); + const title = t("home.recentlyAddedIn", {libraryName: c.Name}); const queryKey = [ "home", "recentlyAddedIn" + c.CollectionType, diff --git a/app/login.tsx b/app/login.tsx index 1e0b2813..1ef2dd4a 100644 --- a/app/login.tsx +++ b/app/login.tsx @@ -22,12 +22,13 @@ import { import { z } from "zod"; +const { t, i18n } = useTranslation(); + const CredentialsSchema = z.object({ - username: z.string().min(1, "Username is required"), + username: z.string().min(1, t("login.username_required")), }); const Login: React.FC = () => { - const { t, i18n } = useTranslation(); const { setServer, login, removeServer, initiateQuickConnect } = useJellyfin(); const [api] = useAtom(apiAtom); @@ -186,7 +187,7 @@ const Login: React.FC = () => { ]); } } catch (error) { - Alert.alert("Error", "Failed to initiate Quick Connect"); + Alert.alert(t("login.error_title"), "Failed to initiate Quick Connect"); } }; @@ -201,7 +202,7 @@ const Login: React.FC = () => { - {t("login.login_button")} + {t("login.login_title")} <> {serverName ? ( <> diff --git a/translations/en.json b/translations/en.json index bb8e1797..0c3aaf32 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2,16 +2,12 @@ "login": { "username_required": "Username is required", "error_title": "Error", - "url_error_message": "URL needs to start with http or https.", - "login": "Log in", - "login_subtitle": "Log in to any user account", + "login_title": "Log in", "username_placeholder": "Username", "password_placeholder": "Password", "login_button": "Log in" }, "server": { - "server_label": "Server: {{serverURL}}", - "change_server": "Change server", "enter_url_to_jellyfin_server": "Enter the URL to your Jellyfin server", "server_url_placeholder": "Server URL", "server_url_hint": "Make sure to include http or https", @@ -26,11 +22,9 @@ "errorMessage": "Something went wrong.\nPlease log out and in again.", "continueWatching": "Continue Watching", "nextUp": "Next Up", - "recentlyAddedMovies": "Recently Added in Movies", - "recentlyAddedSeries": "Recently Added in Series", + "recentlyAddedIn": "Recently Added in {{libraryName}}", "suggestedMovies": "Suggested Movies", "suggestedEpisodes": "Suggested Episodes" - }, "tabs": { "home": "Home", diff --git a/translations/sv.json b/translations/sv.json index 45a61554..ef3e5462 100644 --- a/translations/sv.json +++ b/translations/sv.json @@ -2,16 +2,12 @@ "login": { "username_required": "Användarnamn krävs", "error_title": "Fel", - "url_error_message": "URL måste börja med http eller https.", "login_title": "Logga in", - "login_subtitle": "Logga in på ett användarkonto", "username_placeholder": "Användarnamn", "password_placeholder": "Lösenord", "login_button": "Logga in" }, "server": { - "server_label": "Server: {{serverURL}}", - "change_server": "Byt server", "server_url_placeholder": "Server URL", "server_url_hint": "Server URL kräver http eller https", "connect_button": "Anslut" @@ -25,9 +21,7 @@ "errorMessage": "Något gick fel.\nLogga ut och in igen.", "continueWatching": "Fortsätt titta", "nextUp": "Nästa upp", - "recentlyAddedMovies": "Nyligen tillagt i Filmer", - "recentlyAddedTVShows": "Nyligen tillagt i TV-Serier", - "suggestions": "Förslag" + "recentlyAddedIn": "Nyligen tillagt i {{libraryName}}" }, "tabs": { "home": "Hem", diff --git a/utils/atoms/settings.ts b/utils/atoms/settings.ts index a430578c..74d133b5 100644 --- a/utils/atoms/settings.ts +++ b/utils/atoms/settings.ts @@ -99,7 +99,7 @@ const loadSettings = (): Settings => { usePopularPlugin: false, deviceProfile: "Expo", mediaListCollectionIds: [], - preferedLanguage: getLocales()[0] || "en", + preferedLanguage: getLocales()[0].languageCode || "en", searchEngine: "Jellyfin", marlinServerUrl: "", openInVLC: false,