* Pull updates from evOo instead of the upstream Rakazo repository The in-app server updater, the image-based compose files and the desktop auto-updater still pointed at elie222/rakazo, so updating an evOo install would have pulled Rakazo. They now follow cynarAI/evOo-local, where the publish workflow already pushes the images. The disabled Rakazo production deploy job is gone from CI; evo deploys itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Call the product evOo everywhere people see its name The desktop setup window and menu, account emails, the iOS app name and permission prompts, sign-in headings, messages bots post into connected chat apps, the web fetch user agent, issue templates and the marketing site still said Rakazo, or EvOo. They now say evOo. The marketing site no longer calls evOo an alternative to itself. Internal identifiers (package scopes, env vars, bundle ids, the desktop productName that keys its data folder and keychain entry) stay as they are. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Open conversation actions by holding a row on a phone Pin, move to folder, mark unread, duplicate, archive and delete only opened on right-click, which iOS Safari never fires. Holding a conversation or a folder header now dispatches the same contextmenu event, so the existing menu opens under the finger; Android's own long-press event is not doubled and the lift does not also open the conversation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Give small chrome icons a 44px touch area on phones The browser and computer toggles, the activity bell, the create button and the section plus buttons were 18 to 36 px targets. On touch screens each now gets an invisible 44px hit area without changing how it looks; the create button uses the same plus icon as the rest of the sidebar instead of a text glyph, and the computer toggle gets an accessible name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Add German to the mobile app German speakers saw the phone app in English because the mobile UI only knew English, Simplified Chinese, and Russian. The app now ships a German catalog covering every mobile chrome string, follows a German device language (de, de-DE, de-AT, de-CH, ...), and offers Deutsch in the Account language picker. Strings that also exist in the web German catalog reuse its wording so web and phone say the same thing; the rest follow the same terms and the informal "du". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Use the evOo sign-in strings in the German phone catalog Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Make account deletion work and give settings one section style Deleting an account posted to the auth endpoint without a JSON content type, so the server refused it and the button did nothing. The privacy page now deletes through the auth client and returns to sign-in. It also drops the claims it could not verify, the export button that only showed an alert, and its own padding, and shows where the data and the computer live. Notifications and media settings use the same SettingsSection. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Use status tokens, the shared switch and one German glossary Voice stage dots, the onboarding progress bar and the Voice First button used raw emerald, violet, cyan and rose; they now use foreground, success and destructive like the rest of the app. The routine editor's hand-built switch is the shared Switch. German says Unterhaltung for threads and Space consistently on web and phone. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Expect the evOo setup copy in the desktop e2e specs Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Translate the voice preview label in the German phone catalog Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ * Wait for the main thread URL without waiting for every resource openMainBotThread already navigated with domcontentloaded; its URL check then waited for the full load event, which can exceed 20 s on a busy runner. The composer check that follows covers readiness. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tgvrj34NMnaqvtgvruYQZZ --------- Co-authored-by: Claude <noreply@anthropic.com>
137 lines
4.0 KiB
TypeScript
137 lines
4.0 KiB
TypeScript
import { useSyncExternalStore } from "react";
|
|
import { DE_MESSAGES } from "./locales/de";
|
|
import { RU_MESSAGES } from "./locales/ru";
|
|
import { ZH_MESSAGES } from "./locales/zh";
|
|
import {
|
|
htmlLangForLocale,
|
|
resolveUiLocale,
|
|
UI_LOCALE_STORAGE_KEY,
|
|
type UiLocale,
|
|
} from "./ui-locale";
|
|
|
|
const catalogs: Partial<Record<UiLocale, Record<string, string>>> = {
|
|
de: DE_MESSAGES,
|
|
"zh-CN": ZH_MESSAGES,
|
|
ru: RU_MESSAGES,
|
|
};
|
|
|
|
let activeLocale: UiLocale = "en";
|
|
const listeners = new Set<() => void>();
|
|
|
|
function emit(): void {
|
|
for (const listener of listeners) listener();
|
|
}
|
|
|
|
export function subscribeI18n(listener: () => void): () => void {
|
|
listeners.add(listener);
|
|
return () => {
|
|
listeners.delete(listener);
|
|
};
|
|
}
|
|
|
|
export function getActiveUiLocale(): UiLocale {
|
|
return activeLocale;
|
|
}
|
|
|
|
export function dateLocaleForUi(locale: UiLocale = activeLocale): string {
|
|
return locale === "en" ? "en-US" : htmlLangForLocale(locale);
|
|
}
|
|
|
|
export function t(message: string, values?: Record<string, string | number>): string {
|
|
const template = catalogs[activeLocale]?.[message] ?? message;
|
|
if (!values) return template;
|
|
return template.replace(/\{([A-Za-z0-9_]+)\}/g, (match, key: string) =>
|
|
Object.hasOwn(values, key) ? String(values[key]) : match,
|
|
);
|
|
}
|
|
|
|
export function useI18n(): { locale: UiLocale; t: typeof t } {
|
|
const locale = useSyncExternalStore(subscribeI18n, getActiveUiLocale, getActiveUiLocale);
|
|
return { locale, t };
|
|
}
|
|
|
|
function readDeviceLanguage(): string | null {
|
|
try {
|
|
const IntlRef = globalThis.Intl;
|
|
return IntlRef?.DateTimeFormat().resolvedOptions().locale || null;
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
export function activateUiLocale(locale: UiLocale): UiLocale {
|
|
activeLocale = locale;
|
|
emit();
|
|
return locale;
|
|
}
|
|
|
|
async function applyDirection(locale: UiLocale): Promise<void> {
|
|
try {
|
|
// Direction follows the active UI locale only (en / de / zh-CN / ru → LTR), never the
|
|
// device language. Applying device RTL here would fight this and reload-loop.
|
|
const { applyMobileUiDirection } = await import("./ui-direction");
|
|
applyMobileUiDirection(htmlLangForLocale(locale));
|
|
} catch {
|
|
// Tests and some hosts have no native direction APIs.
|
|
}
|
|
}
|
|
|
|
export async function bootstrapI18n(): Promise<UiLocale> {
|
|
let stored: string | null = null;
|
|
let deviceLanguage: string | null = readDeviceLanguage();
|
|
try {
|
|
const SecureStore = await import("expo-secure-store");
|
|
stored = await SecureStore.getItemAsync(UI_LOCALE_STORAGE_KEY);
|
|
} catch {
|
|
stored = null;
|
|
}
|
|
try {
|
|
const localization = await import("expo-localization");
|
|
const tag = localization.getLocales()[0]?.languageTag;
|
|
if (typeof tag === "string" && tag) deviceLanguage = tag;
|
|
} catch {
|
|
// Keep Intl fallback.
|
|
}
|
|
const envDefault =
|
|
typeof process !== "undefined" && typeof process.env.EXPO_PUBLIC_DEFAULT_UI_LOCALE === "string"
|
|
? process.env.EXPO_PUBLIC_DEFAULT_UI_LOCALE
|
|
: null;
|
|
const locale = resolveUiLocale({ stored, envDefault, deviceLanguage });
|
|
activateUiLocale(locale);
|
|
await applyDirection(locale);
|
|
return locale;
|
|
}
|
|
|
|
export async function persistUiLocale(locale: UiLocale): Promise<void> {
|
|
try {
|
|
const SecureStore = await import("expo-secure-store");
|
|
await SecureStore.setItemAsync(UI_LOCALE_STORAGE_KEY, locale);
|
|
} catch {
|
|
// Ignore SecureStore failures; in-memory locale still applies.
|
|
}
|
|
}
|
|
|
|
/** Serialize SecureStore writes so rapid picker taps apply in order (last wins). */
|
|
let uiLocaleWriteChain: Promise<void> = Promise.resolve();
|
|
|
|
export async function setUiLocale(locale: UiLocale): Promise<UiLocale> {
|
|
const write = uiLocaleWriteChain.then(async () => {
|
|
await persistUiLocale(locale);
|
|
activateUiLocale(locale);
|
|
await applyDirection(locale);
|
|
return locale;
|
|
});
|
|
uiLocaleWriteChain = write.then(
|
|
() => undefined,
|
|
() => undefined,
|
|
);
|
|
return write;
|
|
}
|
|
|
|
/** Test-only: set the in-memory locale without I/O. */
|
|
export function resetI18nForTests(locale: UiLocale = "en"): void {
|
|
activeLocale = locale;
|
|
uiLocaleWriteChain = Promise.resolve();
|
|
emit();
|
|
}
|