Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
df9ce84
feat: initial translation implementation (browser-ui)
iamEvanYT May 8, 2025
b69e9f5
feat: settings topbar translation
iamEvanYT May 8, 2025
5fd1f5d
fix: translation namespaces
iamEvanYT May 8, 2025
0a41d54
add: workflow
iamEvanYT May 8, 2025
38f691e
fix: add crowdin.yml
iamEvanYT May 8, 2025
0f25866
fix: crowdin config
iamEvanYT May 8, 2025
cc10898
fix: crowdin permissions
iamEvanYT May 8, 2025
7e63fb3
New Crowdin translations by GitHub Action (#38)
github-actions[bot] May 8, 2025
ad68dad
chore: remove test branch
iamEvanYT May 8, 2025
b2c99bc
move: locales to shared folder
iamEvanYT May 9, 2025
4450ecc
test: gh action
iamEvanYT May 9, 2025
95dbf44
New Crowdin translations by GitHub Action (#39)
github-actions[bot] May 9, 2025
a9426ba
chore: disable gh action on branch
iamEvanYT May 9, 2025
d4feaa6
enhancement: add locale to posthog analytics
iamEvanYT May 9, 2025
421b3c9
feat: add general and icons
iamEvanYT May 9, 2025
5f3503d
renamed: en -> en-US
iamEvanYT May 9, 2025
5e22645
New Crowdin translations by GitHub Action (#40)
github-actions[bot] May 9, 2025
5df3b26
remove: old languages
iamEvanYT May 9, 2025
1d325b3
chore: disable gh action on branch
iamEvanYT May 9, 2025
dc15ec2
chore: update use variables
iamEvanYT May 9, 2025
b320d3e
feat: external apps section translation
iamEvanYT May 9, 2025
4b5eb87
feat: about section translation
iamEvanYT May 9, 2025
729b274
update settings strings
iamEvanYT May 13, 2025
7b406df
fix: lock file
iamEvanYT May 14, 2025
05eceec
feat: settings
iamEvanYT May 15, 2025
503ad38
feat: about page
iamEvanYT May 15, 2025
752b716
remove: ico-to-png
iamEvanYT Jun 11, 2025
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
38 changes: 38 additions & 0 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Crowdin Action

permissions:
contents: write
pull-requests: write

on:
push:
branches: [main]

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Crowdin Action
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_title: "New Crowdin Translations"
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)"
pull_request_base_branch_name: "main"
env:
# A classic GitHub Personal Access Token with the 'repo' scope selected (the user should have write access to the repository).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# A numeric ID, found at https://crowdin.com/project/<projectName>/tools/api
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}

# Visit https://crowdin.com/settings#api-key to create this token
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
13 changes: 13 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."

"preserve_hierarchy": true

"files":
[{ "source": "src/shared/locales/en-US/*.json", "translation": "src/shared/locales/%locale%/%original_file_name%" }]
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@
"electron-chrome-web-store": "npm:@iamevan/electron-chrome-web-store@0.11.2",
"electron-context-menu": "^4.0.5",
"electron-updater": "^6.6.2",
"i18next": "^25.1.2",
"i18next-resources-to-backend": "^1.2.1",
"knex": "^3.1.0",
"mime-types": "^3.0.1",
"posthog-node": "^4.17.1",
"react-i18next": "^15.5.1",
"sharp": "^0.34.1",
"sharp-ico": "^0.1.5",
"zod": "^3.24.4"
Expand Down
3 changes: 2 additions & 1 deletion src/main/ipc/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import { ipcMain } from "electron";
ipcMain.handle("app:get-info", async () => {
return {
version: app.getVersion(),
packaged: app.isPackaged
packaged: app.isPackaged,
locale: app.getLocale()
};
});

Expand Down
3 changes: 2 additions & 1 deletion src/main/modules/posthog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ function getAppInfoForPosthog() {
return {
version: app.getVersion(),
platform: process.platform,
environment: process.env.NODE_ENV
environment: process.env.NODE_ENV,
locale: app.getLocale()
};
}

Expand Down
4 changes: 3 additions & 1 deletion src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ const appAPI: FlowAppAPI = {
const appInfo: {
version: string;
packaged: boolean;
locale: string;
} = await ipcRenderer.invoke("app:get-info");
const appVersion = appInfo.version;
const updateChannel: "Stable" | "Beta" | "Alpha" | "Development" = appInfo.packaged ? "Stable" : "Development";
Expand All @@ -416,7 +417,8 @@ const appAPI: FlowAppAPI = {
chrome_version: process.versions.chrome,
electron_version: process.versions.electron,
os: os,
update_channel: updateChannel
update_channel: updateChannel,
locale: appInfo.locale
};
},
writeTextToClipboard: (text: string) => {
Expand Down
8 changes: 5 additions & 3 deletions src/renderer/src/components/browser-ui/browser-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { cn } from "@/lib/utils";
import { CogIcon, LayersIcon, PackageXIcon, PinIcon, PinOffIcon, PuzzleIcon } from "lucide-react";
import { MouseEvent, useCallback, useMemo, useRef, useState } from "react";
import { PortalPopover } from "@/components/portal/popover";
import { useBrowserUITranslations } from "@/lib/i18n";

interface BrowserActionListProps {
partition?: string;
Expand Down Expand Up @@ -144,6 +145,7 @@ function BrowserAction({ action, alignment, partition, activeTabId }: BrowserAct
}

export function BrowserActionList({ alignmentX = "left", alignmentY = "bottom" }: BrowserActionListProps) {
const { t: tBrowserUI } = useBrowserUITranslations();
const { isCurrentSpaceLight } = useSpaces();
const { actions, activeTabId, partition } = useBrowserAction();
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -184,19 +186,19 @@ export function BrowserActionList({ alignmentX = "left", alignmentY = "bottom" }
{noActiveTab && (
<SidebarMenuButton disabled>
<LayersIcon />
No Active Tab
{tBrowserUI("No Active Tab")}
</SidebarMenuButton>
)}
{!noActiveTab && noActions && (
<SidebarMenuButton disabled>
<PackageXIcon />
No Extensions Available
{tBrowserUI("No Extensions Available")}
</SidebarMenuButton>
)}
<Separator />
<SidebarMenuButton onClick={openExtensionsPage}>
<CogIcon />
<span className="font-semibold truncate">Manage Extensions</span>
<span className="font-semibold truncate">{tBrowserUI("Manage Extensions")}</span>
</SidebarMenuButton>
</SidebarMenu>
</PortalPopover.Content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { SidebarMenuButton } from "@/components/ui/resizable-sidebar";
import { PlusIcon } from "lucide-react";
import { SIDEBAR_HOVER_COLOR } from "@/components/browser-ui/browser-sidebar";
import { cn } from "@/lib/utils";
import { useBrowserUITranslations } from "@/lib/i18n";

const MotionSidebarMenuButton = motion(SidebarMenuButton);

export function NewTabButton() {
const { t: tBrowserUI } = useBrowserUITranslations();
const [isPressed, setIsPressed] = useState(false);

const handleMouseDown = () => {
Expand All @@ -32,7 +34,7 @@ export function NewTabButton() {
className={cn(SIDEBAR_HOVER_COLOR, "text-black/50 dark:text-muted-foreground")}
>
<PlusIcon className="size-4" strokeWidth={3} />
<span className="font-medium">New Tab</span>
<span className="font-medium">{tBrowserUI("New Tab")}</span>
</MotionSidebarMenuButton>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
import { SidebarGroup, SidebarMenu, useSidebar } from "@/components/ui/resizable-sidebar";
import { Space } from "~/flow/interfaces/sessions/spaces";
import { cn, hex_is_light } from "@/lib/utils";
import { useBrowserUITranslations } from "@/lib/i18n";
import { AnimatePresence, motion } from "motion/react";
import { useCallback, useMemo, useRef } from "react";
import { DropIndicator as BaseDropIndicator } from "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/list-item";
Expand Down Expand Up @@ -38,6 +39,7 @@ export function DropIndicator({ isSpaceLight }: { isSpaceLight: boolean }) {

function SidebarSectionDivider({ hasTabs, handleCloseAllTabs }: { hasTabs: boolean; handleCloseAllTabs: () => void }) {
const { open } = useSidebar();
const { t: tBrowserUI } = useBrowserUITranslations();

if (!hasTabs) return null;

Expand All @@ -62,7 +64,7 @@ function SidebarSectionDivider({ hasTabs, handleCloseAllTabs }: { hasTabs: boole
size="sm"
onClick={handleCloseAllTabs}
>
<span className="text-xs font-semibold">Clear</span>
<span className="text-xs font-semibold">{tBrowserUI("Clear")}</span>
</Button>
)}
</motion.div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { AddressBarCopyLinkButton } from "@/components/browser-ui/sidebar/header
import { PinnedBrowserActions } from "@/components/browser-ui/sidebar/header/address-bar/pinned-browser-actions";
import { useTabs } from "@/components/providers/tabs-provider";
import { SidebarGroup, useSidebar } from "@/components/ui/resizable-sidebar";
import { useBrowserUITranslations } from "@/lib/i18n";
import { simplifyUrl } from "@/lib/url";
import { cn } from "@/lib/utils";
import { SearchIcon } from "lucide-react";
import { useRef } from "react";

function FakeAddressBar({ className }: { className?: string }) {
const { t: tBrowserUI } = useBrowserUITranslations();
const inputRef = useRef<HTMLInputElement>(null);
const { addressUrl, focusedTab } = useTabs();

Expand All @@ -34,7 +36,7 @@ function FakeAddressBar({ className }: { className?: string }) {
const simplifiedUrl = simplifyUrl(addressUrl);
const isPlaceholder = !simplifiedUrl;

const value = isPlaceholder ? "Search or type URL" : simplifiedUrl;
const value = isPlaceholder ? tBrowserUI("Search or type URL") : simplifiedUrl;

return (
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useSettingsTranslations } from "@/lib/i18n";
import { useEffect, useState } from "react";
import { Loader2 } from "lucide-react"; // For loading state

Expand All @@ -18,6 +19,7 @@ function InfoRow({ label, value }: InfoRowProps) {
}

export function BrowserInfoCard() {
const { t: tSettings } = useSettingsTranslations();
const [appInfo, setAppInfo] = useState<Awaited<ReturnType<typeof getAppInfo>> | null>(null);
const [isLoading, setIsLoading] = useState(true);

Expand All @@ -40,28 +42,28 @@ export function BrowserInfoCard() {
// Replaced Card with styled div
<div className="rounded-lg border bg-card text-card-foreground p-6">
<div className="mb-4">
<h3 className="text-xl font-semibold tracking-tight">Browser Information</h3>
<p className="text-sm text-muted-foreground mt-1">Details about your Flow Browser installation.</p>
<h3 className="text-xl font-semibold tracking-tight">{tSettings("sections.about.info.title")}</h3>
<p className="text-sm text-muted-foreground mt-1">{tSettings("sections.about.info.description")}</p>
</div>

{isLoading ? (
<div className="flex items-center justify-center h-32 text-muted-foreground">
<Loader2 className="h-6 w-6 animate-spin mr-2" />
<span>Loading browser details...</span>
<span>{tSettings("sections.about.info.loading")}</span>
</div>
) : appInfo ? (
// Using a 3-column grid for label & value to better control alignment and wrapping
<div className="grid grid-cols-1 md:grid-cols-3 gap-x-4 gap-y-1 border-t pt-4">
<InfoRow label="Browser Name" value="Flow Browser" />
<InfoRow label="Version" value={appInfo.app_version} />
<InfoRow label="Build Number" value={appInfo.build_number} />
<InfoRow label="Engine Version" value={`Chromium ${appInfo.chrome_version}`} />
<InfoRow label="Operating System" value={appInfo.os} />
<InfoRow label="Update Channel" value={appInfo.update_channel} />
<InfoRow label={tSettings("sections.about.info.browser-name")} value="Flow Browser" />
<InfoRow label={tSettings("sections.about.info.version")} value={appInfo.app_version} />
<InfoRow label={tSettings("sections.about.info.build")} value={appInfo.build_number} />
<InfoRow label={tSettings("sections.about.info.engine")} value={`Chromium ${appInfo.chrome_version}`} />
<InfoRow label={tSettings("sections.about.info.os")} value={appInfo.os} />
<InfoRow label={tSettings("sections.about.info.update-channel")} value={appInfo.update_channel} />
</div>
) : (
<div className="flex items-center justify-center h-32 text-destructive">
Could not load browser information.
{tSettings("sections.about.info.loading.failed")}
</div>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { BrowserInfoCard } from "./browser-info-card";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { useSettingsTranslations } from "@/lib/i18n";

export function AboutSettings() {
const { t: tSettings } = useSettingsTranslations();

return (
<div className="space-y-6">
<div>
<h2 className="text-2xl font-semibold text-gray-700 dark:text-gray-200">About</h2>
<p className="text-muted-foreground">Information about your browser</p>
<h2 className="text-2xl font-semibold text-gray-700 dark:text-gray-200">{tSettings("sections.about")}</h2>
<p className="text-muted-foreground">{tSettings("sections.about.description")}</p>
</div>

<BrowserInfoCard />
Expand Down
Loading