Complete client UI i18n migration
Adds client-side i18n support, language settings, translated UI copy, and locale parity coverage.
This commit is contained in:
@@ -4,6 +4,7 @@ import { useIsFocused } from "@react-navigation/native";
|
||||
import { router } from "expo-router";
|
||||
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
||||
import { ChevronLeft } from "lucide-react-native";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { MenuHeader } from "@/components/headers/menu-header";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { LoadingSpinner } from "@/components/ui/loading-spinner";
|
||||
@@ -23,6 +24,7 @@ export function SessionsScreen({ serverId }: { serverId: string }) {
|
||||
|
||||
function SessionsScreenContent({ serverId }: { serverId: string }) {
|
||||
const { theme } = useUnistyles();
|
||||
const { t } = useTranslation();
|
||||
const { agents, hasMore, isInitialLoad, isLoadingMore, isRevalidating, loadMore, refreshAll } =
|
||||
useAgentHistory({
|
||||
serverId,
|
||||
@@ -56,16 +58,16 @@ function SessionsScreenContent({ serverId }: { serverId: string }) {
|
||||
hasMore ? (
|
||||
<View style={styles.footer}>
|
||||
<Button variant="ghost" onPress={loadMore} disabled={isLoadingMore}>
|
||||
{isLoadingMore ? "Loading..." : "Load more"}
|
||||
{isLoadingMore ? t("common.loading") : t("sessions.actions.loadMore")}
|
||||
</Button>
|
||||
</View>
|
||||
) : null,
|
||||
[hasMore, loadMore, isLoadingMore],
|
||||
[hasMore, loadMore, isLoadingMore, t],
|
||||
);
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<MenuHeader title="Sessions" />
|
||||
<MenuHeader title={t("sessions.title")} />
|
||||
{isInitialLoad ? (
|
||||
<View style={styles.loadingContainer}>
|
||||
<LoadingSpinner size="large" color={theme.colors.foregroundMuted} />
|
||||
@@ -73,9 +75,9 @@ function SessionsScreenContent({ serverId }: { serverId: string }) {
|
||||
) : null}
|
||||
{!isInitialLoad && sortedAgents.length === 0 ? (
|
||||
<View style={styles.emptyContainer}>
|
||||
<Text style={styles.emptyText}>No sessions yet</Text>
|
||||
<Text style={styles.emptyText}>{t("sessions.empty")}</Text>
|
||||
<Button variant="ghost" leftIcon={ChevronLeft} onPress={handleBack}>
|
||||
Back
|
||||
{t("common.actions.back")}
|
||||
</Button>
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user