Merge pull request #529 from i1Zeus/arabic-support

feat: add Arabic localization support for editor, launch, settings, s…
This commit is contained in:
Sid
2026-05-05 19:09:12 -07:00
committed by GitHub
13 changed files with 669 additions and 44 deletions
+41 -17
View File
@@ -1045,7 +1045,9 @@ export function SettingsPanel({
{cursorHighlight && onCursorHighlightChange && (
<div className="p-2 rounded-lg bg-white/5 border border-white/5 mt-2 space-y-2">
<div className="flex items-center justify-between">
<div className="text-[10px] font-medium text-slate-300">Cursor highlight</div>
<div className="text-[10px] font-medium text-slate-300">
{t("effects.cursorHighlight.title")}
</div>
<button
type="button"
onClick={() =>
@@ -1060,7 +1062,7 @@ export function SettingsPanel({
: "bg-white/5 border-white/10 text-slate-400"
}`}
>
{cursorHighlight.enabled ? "On" : "Off"}
{cursorHighlight.enabled ? t("effects.on") : t("effects.off")}
</button>
</div>
<div
@@ -1077,13 +1079,15 @@ export function SettingsPanel({
: "bg-white/5 border-white/10 text-slate-300 hover:border-white/20"
}`}
>
{style}
{t(`effects.cursorHighlight.${style}`)}
</button>
))}
</div>
<div className={cursorHighlight.enabled ? "" : "opacity-40 pointer-events-none"}>
<div className="flex items-center justify-between mb-1">
<div className="text-[10px] text-slate-400">Size</div>
<div className="text-[10px] text-slate-400">
{t("effects.cursorHighlight.size")}
</div>
<span className="text-[10px] text-slate-500 font-mono">
{cursorHighlight.sizePx}px
</span>
@@ -1091,7 +1095,10 @@ export function SettingsPanel({
<Slider
value={[cursorHighlight.sizePx]}
onValueChange={(values) =>
onCursorHighlightChange({ ...cursorHighlight, sizePx: values[0] })
onCursorHighlightChange({
...cursorHighlight,
sizePx: values[0],
})
}
min={10}
max={36}
@@ -1103,19 +1110,27 @@ export function SettingsPanel({
<div
className={`flex items-center justify-between ${cursorHighlight.enabled ? "" : "opacity-40 pointer-events-none"}`}
>
<div className="text-[10px] text-slate-400">Only on clicks</div>
<div className="text-[10px] text-slate-400">
{t("effects.cursorHighlight.onlyOnClicks")}
</div>
<button
type="button"
onClick={async () => {
const turningOn = !cursorHighlight.onlyOnClicks;
if (turningOn) {
try {
const result = await window.electronAPI.requestAccessibilityAccess();
if (!result.granted) {
toast.message("Accessibility permission needed", {
description:
"Open System Settings → Privacy & Security → Accessibility, enable Openscreen, then restart the app.",
});
const result =
await window.electronAPI?.requestAccessibilityAccess?.();
if (!result?.granted) {
toast.message(
t("effects.cursorHighlight.accessibilityPermissionTitle"),
{
description: t(
"effects.cursorHighlight.accessibilityPermissionDescription",
),
},
);
return;
}
} catch (err) {
console.warn("Accessibility request failed:", err);
@@ -1132,12 +1147,14 @@ export function SettingsPanel({
: "bg-white/5 border-white/10 text-slate-400"
}`}
>
{cursorHighlight.onlyOnClicks ? "On" : "Off"}
{cursorHighlight.onlyOnClicks ? t("effects.on") : t("effects.off")}
</button>
</div>
)}
<div className={cursorHighlight.enabled ? "" : "opacity-40 pointer-events-none"}>
<div className="text-[10px] text-slate-400 mb-1">Color</div>
<div className="text-[10px] text-slate-400 mb-1">
{t("effects.cursorHighlight.color")}
</div>
<Popover>
<PopoverTrigger asChild>
<Button
@@ -1166,7 +1183,10 @@ export function SettingsPanel({
colorPalette: t("background.colorPalette"),
}}
onUpdateColor={(color) =>
onCursorHighlightChange({ ...cursorHighlight, color })
onCursorHighlightChange({
...cursorHighlight,
color,
})
}
/>
</PopoverContent>
@@ -1174,7 +1194,9 @@ export function SettingsPanel({
</div>
<div className={cursorHighlight.enabled ? "" : "opacity-40 pointer-events-none"}>
<div className="flex items-center justify-between mb-1">
<div className="text-[10px] text-slate-400">Offset X (window recordings)</div>
<div className="text-[10px] text-slate-400">
{t("effects.cursorHighlight.offsetX")}
</div>
<span className="text-[10px] text-slate-500 font-mono">
{(cursorHighlight.offsetXNorm * 100).toFixed(1)}%
</span>
@@ -1195,7 +1217,9 @@ export function SettingsPanel({
</div>
<div className={cursorHighlight.enabled ? "" : "opacity-40 pointer-events-none"}>
<div className="flex items-center justify-between mb-1">
<div className="text-[10px] text-slate-400">Offset Y</div>
<div className="text-[10px] text-slate-400">
{t("effects.cursorHighlight.offsetY")}
</div>
<span className="text-[10px] text-slate-500 font-mono">
{(cursorHighlight.offsetYNorm * 100).toFixed(1)}%
</span>