Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jan 20, 2025
1 parent 3b73947 commit 95f9e93
Show file tree
Hide file tree
Showing 25 changed files with 400 additions and 198 deletions.
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"drizzle-orm": "^0.38.4",
"input-otp": "^1.4.2",
"lucide-react": "^0.473.0",
"motion": "^11.18.1",
"motion": "^12.0.0",
"next": "15.1.5",
"next-international": "^1.3.1",
"next-themes": "^0.4.4",
Expand Down
31 changes: 19 additions & 12 deletions apps/web/src/components/activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ export function Activity() {
},
);

const { isFetching, isFetchingNextPage, fetchNextPage, hasNextPage } =
allTranslationsQuery;
const {
isFetching,
isFetchingNextPage,
fetchNextPage,
hasNextPage,
refetch,
} = allTranslationsQuery;

useEffect(() => {
const observer = new IntersectionObserver(
Expand Down Expand Up @@ -77,20 +82,22 @@ export function Activity() {
</div>
);
}

return (
<div className="flex flex-col gap-4 mt-6">
{pages.map((page) =>
page.map((item) => (
<ActivityCard
key={item.id}
source={item.sourceText}
content={item.translatedText}
updatedAt={item.updatedAt}
commit={item.commit}
targetLanguage={item.targetLanguage}
commitLink={item.commitLink}
sourceProvider={item.sourceProvider}
/>
<div key={item.id}>
<ActivityCard
source={item.sourceText}
content={item.translatedText}
updatedAt={item.updatedAt}
commit={item.commit}
targetLanguage={item.targetLanguage}
commitLink={item.commitLink}
sourceProvider={item.sourceProvider}
/>
</div>
)),
)}

Expand Down
21 changes: 12 additions & 9 deletions apps/web/src/jobs/translate/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ const translationSchema = z.object({
export const translateTask = schemaTask({
id: "translate",
schema: translationSchema,
maxDuration: 300,
maxDuration: 600,
queue: {
concurrencyLimit: 10,
},
run: async (payload, { ctx }) => {
// Validate permissions
// const { type, org, project } = await validateJobPermissions({
// projectId: payload.projectId,
// apiKey: payload.apiKey,
// });
run: async (payload) => {
const { org, project } = await validateJobPermissions({
projectId: payload.projectId,
apiKey: payload.apiKey,
});

if (!org) {
throw new Error("Permission denied");
}

const translations: Record<
string,
Expand Down Expand Up @@ -83,8 +86,8 @@ export const translateTask = schemaTask({
);

await createTranslation({
projectId: payload.projectId,
organizationId: "bhm4edxdzlgse8zik4hxwuvf",
projectId: project.id,
organizationId: org.id,
sourceFormat: payload.sourceFormat,
branch: payload.branch,
commit: payload.commit,
Expand Down
16 changes: 13 additions & 3 deletions apps/web/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,18 @@ export default {
monthly: "شهري",
selectPeriod: "اختر الفترة"
},
translate: {
chunkSize: "حجم القطعة",
model: "نموذج"
welcome: {
title: "مرحبًا بك في لانجوين",
description: "أتمتم عملية التوطين الخاصة بك مع لانجوين"
},
button: {
update: "ترجمات جديدة"
},
update: {
button: "ترجمات جديدة"
},
hero2: {
title: "التوطين التلقائي لتطبيقاتك",
description: "تسهيل عملية التوطين الخاصة بك باستخدام واجهة سطر الأوامر والخط المدعوم بالذكاء الاصطناعي، والتي تم تصميمها لتلقين الترجمات للمطورين."
}
} as const;
16 changes: 13 additions & 3 deletions apps/web/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,18 @@ export default {
monthly: "Monatlich",
selectPeriod: "Zeitraum auswählen"
},
translate: {
chunkSize: "Chunk-Größe",
model: "Modell"
welcome: {
title: "Willkommen bei Languine",
description: "Automatisieren Sie Ihren Lokalisierungsprozess mit Languine"
},
button: {
update: "Neue Übersetzungen"
},
update: {
button: "Neue Übersetzungen"
},
hero2: {
title: "Automatisierte Lokalisierung für Ihre Anwendungen",
description: "Optimieren Sie Ihren Lokalisierungsprozess mit einer KI-gestützten CLI und einem Pipeline-System, das speziell für Entwickler entwickelt wurde, um Übersetzungen zu automatisieren."
}
} as const;
4 changes: 0 additions & 4 deletions apps/web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,4 @@ export default {
monthly: "Monthly",
selectPeriod: "Select period",
},
translate: {
chunkSize: "Chunk size",
model: "Model",
},
} as const;
16 changes: 13 additions & 3 deletions apps/web/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,18 @@ export default {
monthly: "Mensual",
selectPeriod: "Seleccionar período"
},
translate: {
chunkSize: "Tamaño del fragmento",
model: "Modelo"
welcome: {
title: "Bienvenido a Languine",
description: "Automatiza tu proceso de localización con Languine"
},
button: {
update: "Nuevas traducciones"
},
update: {
button: "Nuevas traducciones"
},
hero2: {
title: "Localización automatizada para tus aplicaciones",
description: "Optimiza tu proceso de localización con una CLI y un pipeline impulsados por IA, diseñados para automatizar las traducciones para desarrolladores."
}
} as const;
16 changes: 13 additions & 3 deletions apps/web/src/locales/fi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,18 @@ export default {
monthly: "Kuukausittain",
selectPeriod: "Valitse ajanjakso"
},
translate: {
chunkSize: "Palasen koko",
model: "Malli"
welcome: {
title: "Tervetuloa Languineen",
description: "Automatisoi lokalisointiprosessisi Languinen avulla"
},
button: {
update: "Uudet käännökset"
},
update: {
button: "Uudet käännökset"
},
hero2: {
title: "Automatisoi sovellustesi lokalisointi",
description: "Yksinkertaista lokalisointiprosessisi tekoälyä hyödyntävällä CLI:llä ja putkistolla, jotka on suunniteltu automatisoimaan käännökset kehittäjille."
}
} as const;
16 changes: 13 additions & 3 deletions apps/web/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,18 @@ export default {
monthly: "Mensuel",
selectPeriod: "Sélectionnez la période"
},
translate: {
chunkSize: "Taille du segment",
model: "Modèle"
welcome: {
title: "Bienvenue sur Languine",
description: "Automatisez votre processus de localisation avec Languine"
},
button: {
update: "Nouvelles traductions"
},
update: {
button: "Nouvelles traductions"
},
hero2: {
title: "Localisation automatisée pour vos applications",
description: "Optimisez votre processus de localisation avec une CLI et un pipeline alimentés par l'IA, conçus pour automatiser les traductions pour les développeurs."
}
} as const;
Loading

0 comments on commit 95f9e93

Please sign in to comment.