Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/languine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Website

on:
push:
branches:
- '**'
paths:
- apps/app/**

jobs:
translate:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Languine Action
uses: languine-ai/languine@v.1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
api-key: ${{ secrets.LANGUINE_API_KEY }}
project-id: ${{ secrets.LANGUINE_PROJECT_ID }}
19 changes: 19 additions & 0 deletions apps/app/languine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"projectId": "prj_T04K9GpppyBHE1kqa2QPV",
"locale": {
"source": "en",
"targets": [
"es",
"pt",
"fr",
"no"
]
},
"files": {
"ts": {
"include": [
"src/locales/[locale].ts"
]
}
}
}
771 changes: 771 additions & 0 deletions apps/app/languine.lock

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions apps/app/src/components/locale-switch.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { useChangeLocale, useCurrentLocale } from "@/locales/client";
import { useI18n } from "@/locales/client";
import { useChangeLocale, useCurrentLocale, useI18n } from "@/locales/client";
import { languages } from "@/locales/client";
import {
Select,
SelectContent,
Expand All @@ -12,10 +12,6 @@ import {
} from "@bubba/ui/select";
import { Globe } from "lucide-react";

const languages = {
en: "English",
} as const;

export const LocaleSwitch = () => {
const t = useI18n();
const locale = useCurrentLocale();
Expand Down
16 changes: 13 additions & 3 deletions apps/app/src/locales/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

import { createI18nClient } from "next-international/client";

export const languages = ["en"];

export const {
useI18n,
useScopedI18n,
I18nProviderClient,
useCurrentLocale,
useChangeLocale,
useI18n,
} = createI18nClient({
en: () => import("./en"),
es: () => import("./es"),
fr: () => import("./fr"),
no: () => import("./no"),
pt: () => import("./pt"),
});

export const languages = {
en: "English",
es: "Español",
fr: "Français",
no: "Norsk",
pt: "Português",
} as const;
2 changes: 1 addition & 1 deletion apps/app/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
},
languages: {
en: "English",
no: "Norsk",
es: "Spanish",
},
common: {
actions: {
Expand Down
Loading