import type { AppLocale } from "../locale";
import { DEFAULT_LOCALE } from "../locale";

export type EditorDividerPropertiesPanelMessages = {
  alignLabel: string;
  alignAria: string;
  alignOptionLeft: string;
  alignOptionCenter: string;
  alignOptionRight: string;

  thicknessLabel: string;
  thicknessAria: string;
  thicknessOptionThin: string;
  thicknessOptionMedium: string;

  styleSectionTitle: string;

  lengthModeLabel: string;
  lengthModeAria: string;
  lengthModeOptionAuto: string;
  lengthModeOptionFull: string;
  lengthModeOptionFixed: string;

  fixedLengthLabel: string;
  fixedLengthUnitLabel: string;
  fixedLengthPresetShort: string;
  fixedLengthPresetNormal: string;
  fixedLengthPresetLong: string;

  colorLabel: string;
  colorPickerAria: string;
  colorHexAria: string;

  marginLabel: string;
  marginUnitLabel: string;
  marginPresetSmall: string;
  marginPresetNormal: string;
  marginPresetLarge: string;
};

const EDITOR_DIVIDER_PROPERTIES_PANEL_MESSAGES: Record<AppLocale, EditorDividerPropertiesPanelMessages> = {
  en: {
    alignLabel: "Alignment",
    alignAria: "Divider alignment",
    alignOptionLeft: "Left",
    alignOptionCenter: "Center",
    alignOptionRight: "Right",

    thicknessLabel: "Thickness",
    thicknessAria: "Divider thickness",
    thicknessOptionThin: "Thin",
    thicknessOptionMedium: "Normal",

    styleSectionTitle: "Divider style",

    lengthModeLabel: "Length mode",
    lengthModeAria: "Divider length mode",
    lengthModeOptionAuto: "Fit content",
    lengthModeOptionFull: "Full width",
    lengthModeOptionFixed: "Fixed length",

    fixedLengthLabel: "Fixed length",
    fixedLengthUnitLabel: "(px)",
    fixedLengthPresetShort: "Short",
    fixedLengthPresetNormal: "Normal",
    fixedLengthPresetLong: "Long",

    colorLabel: "Line color",
    colorPickerAria: "Divider color picker",
    colorHexAria: "Divider color HEX",

    marginLabel: "Vertical margin",
    marginUnitLabel: "(px)",
    marginPresetSmall: "Small",
    marginPresetNormal: "Normal",
    marginPresetLarge: "Large",
  },

  ko: {
    alignLabel: "정렬",
    alignAria: "구분선 정렬",
    alignOptionLeft: "왼쪽",
    alignOptionCenter: "가운데",
    alignOptionRight: "오른쪽",

    thicknessLabel: "두께",
    thicknessAria: "구분선 두께",
    thicknessOptionThin: "얇게",
    thicknessOptionMedium: "보통",

    styleSectionTitle: "구분선 스타일",

    lengthModeLabel: "길이 모드",
    lengthModeAria: "구분선 길이 모드",
    lengthModeOptionAuto: "내용에 맞춤",
    lengthModeOptionFull: "전체 폭",
    lengthModeOptionFixed: "고정 길이",

    fixedLengthLabel: "고정 길이",
    fixedLengthUnitLabel: "(px)",
    fixedLengthPresetShort: "짧게",
    fixedLengthPresetNormal: "보통",
    fixedLengthPresetLong: "길게",

    colorLabel: "선 색상",
    colorPickerAria: "구분선 색상 피커",
    colorHexAria: "구분선 색상 HEX",

    marginLabel: "위/아래 여백",
    marginUnitLabel: "(px)",
    marginPresetSmall: "작게",
    marginPresetNormal: "보통",
    marginPresetLarge: "크게",
  },
};

export function getEditorDividerPropertiesPanelMessages(
  locale: AppLocale | null | undefined,
): EditorDividerPropertiesPanelMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_DIVIDER_PROPERTIES_PANEL_MESSAGES[key] ?? EDITOR_DIVIDER_PROPERTIES_PANEL_MESSAGES[DEFAULT_LOCALE];
}
