Skip to content

Commit dbfef8f

Browse files
author
n3kosempai
committed
[release] solved location issues
1 parent b9ffa73 commit dbfef8f

5 files changed

Lines changed: 86 additions & 44 deletions

File tree

src/i18n/locales/en.json

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,20 @@
4646
"category": "Category",
4747
"size": "Size",
4848
"noScreenshots": "No screenshots available",
49-
"errorLoading": "Error loading app details"
49+
"errorLoading": "Error loading app details",
50+
"noIcon": "No icon",
51+
"installed": "Installed",
52+
"installationInProgress": "Installation in progress",
53+
"installationCompleted": "Installation completed successfully!",
54+
"installationError": "Installation error",
55+
"getLog": "Get log",
56+
"accept": "Accept",
57+
"aboutThisApp": "About this app",
58+
"installationCompletedSuccess": "✓ Installation completed successfully.",
59+
"installationFailed": "✗ Installation failed with code: {{code}}",
60+
"preparingInstallation": "Preparing custom installation...",
61+
"downloadingReference": "Downloading flatpak reference...",
62+
"errorInvokingCommand": "✗ Error invoking command: {{error}}"
5063
},
5164
"myApps": {
5265
"title": "My Apps",
@@ -57,13 +70,31 @@
5770
"updateAll": "Update All",
5871
"checkingUpdates": "Checking for updates...",
5972
"updateAvailable": "Update available",
60-
"upToDate": "Up to date"
73+
"upToDate": "Up to date",
74+
"appInstalled": "{{count}} app installed",
75+
"appsInstalled": "{{count}} apps installed",
76+
"updating": "Updating {{appId}}",
77+
"closeButton": "Close",
78+
"updateCompletedSuccess": "✓ Update completed successfully.",
79+
"reloadingUpdateList": "Reloading update list...",
80+
"listUpdated": "✓ List updated.",
81+
"updateFailed": "✗ Update failed with code: {{code}}",
82+
"preparingUpdate": "Preparing update for {{appId}}...",
83+
"errorInvokingCommand": "✗ Error invoking command: {{error}}",
84+
"noAppsInstalledMessage": "You don't have any apps installed",
85+
"installAppsMessage": "Install apps from the store to see them here"
6186
},
6287
"categoryApps": {
6388
"title": "{{category}}",
6489
"loading": "Loading apps...",
6590
"error": "Error loading apps",
66-
"noApps": "No apps found in this category"
91+
"noApps": "No apps found in this category",
92+
"errorLoadingApps": "Error loading apps: {{error}}"
93+
},
94+
"searchResults": {
95+
"searching": "Searching...",
96+
"resultsFor": "Results for \"{{query}}\"",
97+
"noResultsFor": "No results found for \"{{query}}\""
6798
},
6899
"welcome": {
69100
"slide1": {

src/pages/appDetails/AppDetails.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { listen } from "@tauri-apps/api/event";
66
import { save } from "@tauri-apps/plugin-dialog";
77
import { writeTextFile } from "@tauri-apps/plugin-fs";
88
import { useEffect, useMemo, useState } from "react";
9+
import { useTranslation } from "react-i18next";
910
import { v4 as uuidv4 } from "uuid";
1011
import { CachedImage } from "../../components/CachedImage";
1112
import { Terminal } from "../../components/Terminal";
@@ -19,6 +20,7 @@ interface AppDetailsProps {
1920
}
2021

2122
export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
23+
const { t } = useTranslation();
2224
const { screenshots, isLoading: isLoadingScreenshots } =
2325
useAppScreenshots(app);
2426
const { isAppInstalled, setInstalledApp } = useInstalledAppsStore();
@@ -39,6 +41,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
3941
const isInstalled = isAppInstalled(app.id);
4042

4143
// Escuchar eventos de instalación
44+
// biome-ignore lint/correctness/useExhaustiveDependencies: Event listeners should only be set up once on mount
4245
useEffect(() => {
4346
const unlistenOutput = listen<string>("install-output", (event) => {
4447
setInstallOutput((prev) => [...prev, event.payload]);
@@ -54,7 +57,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
5457
setInstallOutput((prev) => [
5558
...prev,
5659
"",
57-
"✓ Instalación completada exitosamente.",
60+
t("appDetails.installationCompletedSuccess"),
5861
]);
5962
setInstallStatus("success");
6063
// Mark app as installed in the store
@@ -63,7 +66,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
6366
setInstallOutput((prev) => [
6467
...prev,
6568
"",
66-
`✗ Instalación falló con código: ${event.payload}`,
69+
t("appDetails.installationFailed", { code: event.payload }),
6770
]);
6871
setInstallStatus("error");
6972
}
@@ -74,7 +77,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
7477
unlistenError.then((fn) => fn());
7578
unlistenCompleted.then((fn) => fn());
7679
};
77-
}, [app.id, setInstalledApp]);
80+
}, []);
7881

7982
// Función para limpiar HTML de la descripción
8083
const stripHtml = (html: string) => {
@@ -103,8 +106,8 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
103106
setIsInstalling(true);
104107
setInstallStatus("installing");
105108
setInstallOutput([
106-
"Preparando instalación personalizada...",
107-
"Descargando referencia de flatpak...",
109+
t("appDetails.preparingInstallation"),
110+
t("appDetails.downloadingReference"),
108111
"",
109112
]);
110113

@@ -118,7 +121,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
118121
setInstallOutput((prev) => [
119122
...prev,
120123
"",
121-
`✗ Error al invocar comando: ${error}`,
124+
t("appDetails.errorInvokingCommand", { error }),
122125
]);
123126
}
124127
};
@@ -199,7 +202,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
199202
/>
200203
) : (
201204
<Typography variant="caption" color="text.secondary">
202-
Sin icono
205+
{t("appDetails.noIcon")}
203206
</Typography>
204207
)}
205208
</Box>
@@ -254,10 +257,10 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
254257
}}
255258
>
256259
{isInstalled || installStatus === "success"
257-
? "Installed"
260+
? t("appDetails.installed")
258261
: installStatus === "installing"
259-
? "Installing..."
260-
: "Instalar"}
262+
? t("appDetails.installing")
263+
: t("appDetails.install")}
261264
</Button>
262265
</Box>
263266

@@ -266,7 +269,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
266269
{installStatus === "installing" ? (
267270
<>
268271
<Typography variant="h6" gutterBottom textAlign="center">
269-
Instalación en progreso
272+
{t("appDetails.installationInProgress")}
270273
</Typography>
271274
<Terminal output={installOutput} isRunning={isInstalling} />
272275
</>
@@ -298,8 +301,8 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
298301
{/* Mensaje */}
299302
<Typography variant="h5" textAlign="center">
300303
{installStatus === "success"
301-
? "¡Instalación completada exitosamente!"
302-
: "Error en la instalación"}
304+
? t("appDetails.installationCompleted")
305+
: t("appDetails.installationError")}
303306
</Typography>
304307

305308
{/* Botones */}
@@ -309,17 +312,17 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
309312
onClick={handleDownloadLog}
310313
sx={{ px: 3 }}
311314
>
312-
Obtener log
315+
{t("appDetails.getLog")}
313316
</Button>
314317
<Button variant="contained" onClick={handleAccept} sx={{ px: 3 }}>
315-
Aceptar
318+
{t("appDetails.accept")}
316319
</Button>
317320
</Box>
318321
</Box>
319322
) : (
320323
<>
321324
<Typography variant="h6" gutterBottom textAlign="center">
322-
Capturas de pantalla
325+
{t("appDetails.screenshots")}
323326
</Typography>
324327
{isLoadingScreenshots ? (
325328
<Box
@@ -481,7 +484,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
481484
color: "text.secondary",
482485
}}
483486
>
484-
<Typography>No hay capturas de pantalla disponibles</Typography>
487+
<Typography>{t("appDetails.noScreenshots")}</Typography>
485488
</Box>
486489
)}
487490
</>
@@ -492,7 +495,7 @@ export const AppDetails = ({ app, onBack }: AppDetailsProps) => {
492495
{app.description && (
493496
<Box sx={{ mt: 4 }}>
494497
<Typography variant="h6" gutterBottom>
495-
Acerca de esta aplicación
498+
{t("appDetails.aboutThisApp")}
496499
</Typography>
497500
<Typography variant="body1" color="text.secondary">
498501
{stripHtml(app.description)}

src/pages/categoryApps/CategoryApps.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Skeleton,
88
Typography,
99
} from "@mui/material";
10+
import { useTranslation } from "react-i18next";
1011
import { v4 as uuidv4 } from "uuid";
1112
import { CachedImage } from "../../components/CachedImage";
1213
import { useCategoryApps } from "../../hooks/useCategoryApps";
@@ -23,6 +24,7 @@ export const CategoryApps = ({
2324
onBack,
2425
onAppSelect,
2526
}: CategoryAppsProps) => {
27+
const { t } = useTranslation();
2628
const { data, isLoading, error } = useCategoryApps(categoryId);
2729

2830
const handleAppClick = (categoryApp: CategoryApp) => {
@@ -53,7 +55,7 @@ export const CategoryApps = ({
5355

5456
{error && (
5557
<Typography color="error">
56-
Error al cargar las aplicaciones: {error.message}
58+
{t("categoryApps.errorLoadingApps", { error: error.message })}
5759
</Typography>
5860
)}
5961

@@ -167,7 +169,7 @@ export const CategoryApps = ({
167169
/>
168170
) : (
169171
<Typography variant="caption" color="text.secondary">
170-
No icon
172+
{t("home.noIcon")}
171173
</Typography>
172174
)}
173175
</Box>
@@ -217,7 +219,7 @@ export const CategoryApps = ({
217219
{!isLoading && data?.hits.length === 0 && (
218220
<Box sx={{ textAlign: "center", py: 8 }}>
219221
<Typography variant="h6" color="text.secondary">
220-
No se encontraron aplicaciones en esta categoría
222+
{t("categoryApps.noApps")}
221223
</Typography>
222224
</Box>
223225
)}

src/pages/myApps/MyApps.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import { invoke } from "@tauri-apps/api/core";
1414
import { listen } from "@tauri-apps/api/event";
1515
import { useCallback, useEffect, useState } from "react";
16+
import { useTranslation } from "react-i18next";
1617
import { CachedImage } from "../../components/CachedImage";
1718
import { ReleaseNotesModal } from "../../components/ReleaseNotesModal";
1819
import { Terminal } from "../../components/Terminal";
@@ -24,6 +25,7 @@ interface MyAppsProps {
2425
}
2526

2627
export const MyApps = ({ onBack }: MyAppsProps) => {
28+
const { t } = useTranslation();
2729
const {
2830
getInstalledAppsInfo,
2931
hasUpdate,
@@ -48,6 +50,7 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
4850
}, [setAvailableUpdates]);
4951

5052
// Listen to update events
53+
// biome-ignore lint/correctness/useExhaustiveDependencies: Event listeners should only be set up once on mount
5154
useEffect(() => {
5255
const unlistenOutput = listen<string>("install-output", (event) => {
5356
setUpdateOutput((prev) => [...prev, event.payload]);
@@ -65,17 +68,17 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
6568
setUpdateOutput((prev) => [
6669
...prev,
6770
"",
68-
"✓ Actualización completada exitosamente.",
69-
"Recargando lista de actualizaciones...",
71+
t("myApps.updateCompletedSuccess"),
72+
t("myApps.reloadingUpdateList"),
7073
]);
7174
// Reload available updates after successful update
7275
await reloadAvailableUpdates();
73-
setUpdateOutput((prev) => [...prev, "✓ Lista actualizada."]);
76+
setUpdateOutput((prev) => [...prev, t("myApps.listUpdated")]);
7477
} else {
7578
setUpdateOutput((prev) => [
7679
...prev,
7780
"",
78-
`✗ Actualización falló con código: ${event.payload}`,
81+
t("myApps.updateFailed", { code: event.payload }),
7982
]);
8083
}
8184
},
@@ -86,7 +89,7 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
8689
unlistenError.then((fn) => fn());
8790
unlistenCompleted.then((fn) => fn());
8891
};
89-
}, [reloadAvailableUpdates]);
92+
}, []);
9093

9194
const handleCloseModal = () => {
9295
setSelectedAppForNotes(null);
@@ -95,7 +98,7 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
9598
const handleUpdate = async (appId: string) => {
9699
setUpdatingApp(appId);
97100
setIsUpdating(true);
98-
setUpdateOutput([`Preparando actualización de ${appId}...`, ""]);
101+
setUpdateOutput([t("myApps.preparingUpdate", { appId }), ""]);
99102

100103
try {
101104
await invoke("update_flatpak", { appId });
@@ -104,7 +107,7 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
104107
setUpdateOutput((prev) => [
105108
...prev,
106109
"",
107-
`✗ Error al invocar comando: ${error}`,
110+
t("myApps.errorInvokingCommand", { error }),
108111
]);
109112
}
110113
};
@@ -131,16 +134,15 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
131134
<ArrowBack />
132135
</IconButton>
133136
<Typography variant="h4" fontWeight="bold">
134-
My Apps
137+
{t("myApps.title")}
135138
</Typography>
136139
</Box>
137140

138141
{/* Installed apps count */}
139142
<Typography variant="body1" color="text.secondary" sx={{ mb: 4 }}>
140-
{installedApps.length}{" "}
141143
{installedApps.length === 1
142-
? "aplicación instalada"
143-
: "aplicaciones instaladas"}
144+
? t("myApps.appInstalled", { count: installedApps.length })
145+
: t("myApps.appsInstalled", { count: installedApps.length })}
144146
</Typography>
145147

146148
{/* Apps grid */}
@@ -298,8 +300,8 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
298300
}}
299301
>
300302
{isUpdating && updatingApp === app.appId
301-
? "Updating..."
302-
: "Update"}
303+
? t("appDetails.updating")
304+
: t("appDetails.update")}
303305
</Button>
304306
</Box>
305307
)}
@@ -316,10 +318,10 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
316318
}}
317319
>
318320
<Typography variant="h6" color="text.secondary">
319-
No tienes aplicaciones instaladas
321+
{t("myApps.noAppsInstalledMessage")}
320322
</Typography>
321323
<Typography variant="body2" color="text.secondary" sx={{ mt: 1 }}>
322-
Instala aplicaciones desde la tienda para verlas aquí
324+
{t("myApps.installAppsMessage")}
323325
</Typography>
324326
</Box>
325327
)}
@@ -345,13 +347,13 @@ export const MyApps = ({ onBack }: MyAppsProps) => {
345347
>
346348
<DialogContent>
347349
<Typography variant="h6" gutterBottom>
348-
Actualizando {updatingApp}
350+
{t("myApps.updating", { appId: updatingApp })}
349351
</Typography>
350352
<Terminal output={updateOutput} isRunning={isUpdating} />
351353
{!isUpdating && (
352354
<Box sx={{ display: "flex", justifyContent: "flex-end", mt: 2 }}>
353355
<Button variant="contained" onClick={handleCloseUpdateDialog}>
354-
Cerrar
356+
{t("myApps.closeButton")}
355357
</Button>
356358
</Box>
357359
)}

0 commit comments

Comments
 (0)