61875be857
Let GMs manage and show images over the scene from the editor and control panel, with zoom tools, help docs, and full ru/en i18n. Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
2.2 KiB
TypeScript
52 lines
2.2 KiB
TypeScript
/** Отображаемое имя продукта (с пробелом), не путать с `productName` сборки (`TTRPGPlayer`). */
|
|
export const APP_DISPLAY_NAME_EN = 'TTRPG Player';
|
|
export const APP_DISPLAY_NAME_RU = 'НРИ Плеер';
|
|
|
|
/** Системный идентификатор приложения (exe, AppImage, appId). */
|
|
export const APP_PRODUCT_NAME = 'TTRPGPlayer';
|
|
export const APP_BUNDLE_ID = 'com.ttrpgplayer.app';
|
|
|
|
export function appDisplayNameForLocale(localeTag: string): string {
|
|
const tag = localeTag.trim().toLowerCase();
|
|
if (tag.startsWith('ru')) return APP_DISPLAY_NAME_RU;
|
|
return APP_DISPLAY_NAME_EN;
|
|
}
|
|
|
|
/** Префикс заголовка окон: `TTRPG - Редактор`. */
|
|
export const APP_WINDOW_BRAND = 'TTRPG';
|
|
|
|
export type AppWindowKind = 'editor' | 'presentation' | 'control' | 'boot' | 'sceneDescription' | 'materials';
|
|
|
|
const WINDOW_SUFFIX: Record<AppWindowKind, { ru: string; en: string }> = {
|
|
editor: { ru: 'Редактор', en: 'Editor' },
|
|
presentation: { ru: 'Презентация', en: 'Presentation' },
|
|
control: { ru: 'Пульт', en: 'Control' },
|
|
boot: { ru: 'Загрузка', en: 'Loading' },
|
|
sceneDescription: { ru: 'Описание сцены', en: 'Scene description' },
|
|
materials: { ru: 'Материалы', en: 'Materials' },
|
|
};
|
|
|
|
export function windowChromeTitle(kind: AppWindowKind, localeTag: string): string {
|
|
const tag = localeTag.trim().toLowerCase();
|
|
const suffix = tag.startsWith('ru') ? WINDOW_SUFFIX[kind].ru : WINDOW_SUFFIX[kind].en;
|
|
return `${APP_WINDOW_BRAND} - ${suffix}`;
|
|
}
|
|
|
|
/** Подписи фильтров в системных диалогах выбора файла (main process). */
|
|
export function openDialogFilterLabel(
|
|
kind: 'images' | 'imagesAndVideo' | 'audio' | 'videoAndAudio',
|
|
localeTag: string,
|
|
): string {
|
|
const ru = localeTag.trim().toLowerCase().startsWith('ru');
|
|
switch (kind) {
|
|
case 'imagesAndVideo':
|
|
return ru ? 'Изображения и видео' : 'Images and video';
|
|
case 'audio':
|
|
return ru ? 'Аудио' : 'Audio';
|
|
case 'videoAndAudio':
|
|
return ru ? 'Видео и аудио' : 'Video and audio';
|
|
default:
|
|
return ru ? 'Изображения' : 'Images';
|
|
}
|
|
}
|