use bone_ui::strings::{Locale, StringKey, StringTable};

pub const APP_TITLE: StringKey = StringKey::new("app.title");

pub const RIBBON_LABEL: StringKey = StringKey::new("shell.ribbon");
pub const RIBBON_TAB_SKETCH: StringKey = StringKey::new("shell.ribbon.tab.sketch");
pub const RIBBON_GROUP_ENTITIES: StringKey = StringKey::new("shell.ribbon.group.entities");
pub const RIBBON_GROUP_RELATIONS: StringKey = StringKey::new("shell.ribbon.group.relations");
pub const RIBBON_GROUP_DIMENSIONS: StringKey = StringKey::new("shell.ribbon.group.dimensions");
pub const RIBBON_GROUP_EXIT: StringKey = StringKey::new("shell.ribbon.group.exit");
pub const TOOL_EXIT_SKETCH: StringKey = StringKey::new("tool.exit_sketch");

pub const TOOL_POINT: StringKey = StringKey::new("tool.point");
pub const TOOL_LINE: StringKey = StringKey::new("tool.line");
pub const TOOL_CENTERPOINT_ARC: StringKey = StringKey::new("tool.centerpoint_arc");
pub const TOOL_TANGENT_ARC: StringKey = StringKey::new("tool.tangent_arc");
pub const TOOL_THREE_POINT_ARC: StringKey = StringKey::new("tool.three_point_arc");
pub const TOOL_CIRCLE: StringKey = StringKey::new("tool.circle");
pub const TOOL_PERIMETER_CIRCLE: StringKey = StringKey::new("tool.perimeter_circle");
pub const TOOL_CORNER_RECTANGLE: StringKey = StringKey::new("tool.corner_rectangle");
pub const TOOL_CENTER_RECTANGLE: StringKey = StringKey::new("tool.center_rectangle");
pub const TOOL_THREE_POINT_CORNER_RECTANGLE: StringKey =
    StringKey::new("tool.three_point_corner_rectangle");
pub const TOOL_THREE_POINT_CENTER_RECTANGLE: StringKey =
    StringKey::new("tool.three_point_center_rectangle");
pub const TOOL_PARALLELOGRAM: StringKey = StringKey::new("tool.parallelogram");

pub const TOOL_COINCIDENT: StringKey = StringKey::new("tool.coincident");
pub const TOOL_HORIZONTAL: StringKey = StringKey::new("tool.horizontal");
pub const TOOL_VERTICAL: StringKey = StringKey::new("tool.vertical");
pub const TOOL_PARALLEL: StringKey = StringKey::new("tool.parallel");
pub const TOOL_PERPENDICULAR: StringKey = StringKey::new("tool.perpendicular");
pub const TOOL_TANGENT: StringKey = StringKey::new("tool.tangent");
pub const TOOL_EQUAL: StringKey = StringKey::new("tool.equal");
pub const TOOL_CONCENTRIC: StringKey = StringKey::new("tool.concentric");
pub const TOOL_FIX: StringKey = StringKey::new("tool.fix");
pub const TOOL_MIDPOINT: StringKey = StringKey::new("tool.midpoint");

pub const REL_HINT_ONE_LINE: StringKey = StringKey::new("rel.hint.one_line");
pub const REL_HINT_TWO_LINES: StringKey = StringKey::new("rel.hint.two_lines");
pub const REL_HINT_COINCIDENT: StringKey = StringKey::new("rel.hint.coincident");
pub const REL_HINT_TWO_CIRCULAR: StringKey = StringKey::new("rel.hint.two_circular");
pub const REL_HINT_TANGENT: StringKey = StringKey::new("rel.hint.tangent");
pub const REL_HINT_EQUAL: StringKey = StringKey::new("rel.hint.equal");
pub const REL_HINT_MIDPOINT: StringKey = StringKey::new("rel.hint.midpoint");
pub const REL_HINT_ENTITY: StringKey = StringKey::new("rel.hint.entity");

pub const TOOL_SMART_DIMENSION: StringKey = StringKey::new("tool.smart_dimension");
pub const TOOL_RADIUS: StringKey = StringKey::new("tool.radius");
pub const TOOL_DIAMETER: StringKey = StringKey::new("tool.diameter");

pub const DIM_HINT_GENERIC: StringKey = StringKey::new("dim.hint.generic");
pub const DIM_PLACEHOLDER_LENGTH: StringKey = StringKey::new("dim.placeholder.length");
pub const DIM_PLACEHOLDER_ANGLE: StringKey = StringKey::new("dim.placeholder.angle");
pub const DIM_CONFLICT_TITLE: StringKey = StringKey::new("dim.conflict.title");
pub const DIM_CONFLICT_MESSAGE: StringKey = StringKey::new("dim.conflict.message");
pub const DIM_CONFLICT_MAKE_DRIVEN: StringKey = StringKey::new("dim.conflict.make_driven");
pub const DIM_CONFLICT_CANCEL: StringKey = StringKey::new("dim.conflict.cancel");

pub const FEATURE_TREE_LABEL: StringKey = StringKey::new("shell.feature_tree");
pub const FEATURE_ORIGIN: StringKey = StringKey::new("feature.origin");
pub const FEATURE_PLANE_XY: StringKey = StringKey::new("feature.plane.xy");
pub const FEATURE_PLANE_YZ: StringKey = StringKey::new("feature.plane.yz");
pub const FEATURE_PLANE_ZX: StringKey = StringKey::new("feature.plane.zx");
pub const FEATURE_SKETCH_DEFAULT: StringKey = StringKey::new("feature.sketch.default");

pub const PROPERTY_PANE_LABEL: StringKey = StringKey::new("shell.property_pane");

pub const STATUS_BAR_LABEL: StringKey = StringKey::new("shell.status_bar");
pub const STATUS_READY: StringKey = StringKey::new("status.ready");
pub const STATUS_SKETCH_ACTIVE: StringKey = StringKey::new("status.sketch_active");

pub const MENU_BAR_LABEL: StringKey = StringKey::new("shell.menu_bar");
pub const MENU_FILE: StringKey = StringKey::new("menu.file");
pub const MENU_EDIT: StringKey = StringKey::new("menu.edit");
pub const MENU_VIEW: StringKey = StringKey::new("menu.view");
pub const MENU_INSERT: StringKey = StringKey::new("menu.insert");
pub const MENU_TOOLS: StringKey = StringKey::new("menu.tools");
pub const MENU_WINDOW: StringKey = StringKey::new("menu.window");
pub const MENU_HELP: StringKey = StringKey::new("menu.help");
pub const MENU_FILE_NEW: StringKey = StringKey::new("menu.file.new");
pub const MENU_FILE_OPEN: StringKey = StringKey::new("menu.file.open");
pub const MENU_FILE_SAVE: StringKey = StringKey::new("menu.file.save");
pub const MENU_FILE_QUIT: StringKey = StringKey::new("menu.file.quit");
pub const MENU_EDIT_UNDO: StringKey = StringKey::new("menu.edit.undo");
pub const MENU_EDIT_REDO: StringKey = StringKey::new("menu.edit.redo");
pub const MENU_VIEW_ZOOM_FIT: StringKey = StringKey::new("menu.view.zoom_fit");
pub const MENU_PLACEHOLDER_COMING_SOON: StringKey = StringKey::new("menu.placeholder.coming_soon");
pub const SHORTCUT_QUIT: StringKey = StringKey::new("shortcut.quit");
pub const SHORTCUT_UNDO: StringKey = StringKey::new("shortcut.undo");
pub const SHORTCUT_REDO: StringKey = StringKey::new("shortcut.redo");
pub const SHORTCUT_ZOOM_FIT: StringKey = StringKey::new("shortcut.zoom_fit");

pub const PROPERTY_PANE_NO_SELECTION: StringKey = StringKey::new("property.no_selection");
pub const PROPERTY_ROW_KIND: StringKey = StringKey::new("property.row.kind");
pub const PROPERTY_ROW_X: StringKey = StringKey::new("property.row.x");
pub const PROPERTY_ROW_Y: StringKey = StringKey::new("property.row.y");
pub const PROPERTY_ROW_FROM: StringKey = StringKey::new("property.row.from");
pub const PROPERTY_ROW_TO: StringKey = StringKey::new("property.row.to");
pub const PROPERTY_ROW_CENTER: StringKey = StringKey::new("property.row.center");
pub const PROPERTY_ROW_START: StringKey = StringKey::new("property.row.start");
pub const PROPERTY_ROW_END: StringKey = StringKey::new("property.row.end");
pub const PROPERTY_ROW_RADIUS: StringKey = StringKey::new("property.row.radius");
pub const PROPERTY_ROW_CONSTRUCTION: StringKey = StringKey::new("property.row.construction");
pub const PROPERTY_KIND_POINT: StringKey = StringKey::new("property.kind.point");
pub const PROPERTY_KIND_LINE: StringKey = StringKey::new("property.kind.line");
pub const PROPERTY_KIND_ARC: StringKey = StringKey::new("property.kind.arc");
pub const PROPERTY_KIND_CIRCLE: StringKey = StringKey::new("property.kind.circle");
pub const PROPERTY_VALUE_YES: StringKey = StringKey::new("property.value.yes");
pub const PROPERTY_VALUE_NO: StringKey = StringKey::new("property.value.no");

#[must_use]
pub fn make_strings(locale: Locale) -> StringTable {
    let mut table = StringTable::for_locale(locale);
    let entries: &[(StringKey, &str)] = match locale {
        Locale::EnUs => EN_US,
        Locale::ArXb => AR_XB,
    };
    entries.iter().for_each(|(key, value)| {
        table.insert(*key, (*value).to_owned());
    });
    table
}

const EN_US: &[(StringKey, &str)] = &[
    (APP_TITLE, "Bone"),
    (RIBBON_LABEL, "Ribbon"),
    (RIBBON_TAB_SKETCH, "Sketch"),
    (RIBBON_GROUP_ENTITIES, "Entities"),
    (RIBBON_GROUP_RELATIONS, "Relations"),
    (RIBBON_GROUP_DIMENSIONS, "Dimensions"),
    (RIBBON_GROUP_EXIT, "Exit"),
    (TOOL_EXIT_SKETCH, "Exit Sketch"),
    (TOOL_POINT, "Point"),
    (TOOL_LINE, "Line"),
    (TOOL_CENTERPOINT_ARC, "Centerpoint Arc"),
    (TOOL_TANGENT_ARC, "Tangent Arc"),
    (TOOL_THREE_POINT_ARC, "3 Point Arc"),
    (TOOL_CIRCLE, "Circle"),
    (TOOL_PERIMETER_CIRCLE, "Perimeter Circle"),
    (TOOL_CORNER_RECTANGLE, "Corner Rectangle"),
    (TOOL_CENTER_RECTANGLE, "Center Rectangle"),
    (
        TOOL_THREE_POINT_CORNER_RECTANGLE,
        "3 Point Corner Rectangle",
    ),
    (
        TOOL_THREE_POINT_CENTER_RECTANGLE,
        "3 Point Center Rectangle",
    ),
    (TOOL_PARALLELOGRAM, "Parallelogram"),
    (TOOL_COINCIDENT, "Coincident"),
    (TOOL_HORIZONTAL, "Horizontal"),
    (TOOL_VERTICAL, "Vertical"),
    (TOOL_PARALLEL, "Parallel"),
    (TOOL_PERPENDICULAR, "Perpendicular"),
    (TOOL_TANGENT, "Tangent"),
    (TOOL_EQUAL, "Equal"),
    (TOOL_CONCENTRIC, "Concentric"),
    (TOOL_FIX, "Fix"),
    (TOOL_MIDPOINT, "Midpoint"),
    (REL_HINT_ONE_LINE, "Select a line"),
    (REL_HINT_TWO_LINES, "Select two lines"),
    (REL_HINT_COINCIDENT, "Select a point and another entity"),
    (REL_HINT_TWO_CIRCULAR, "Select two arcs or circles"),
    (REL_HINT_TANGENT, "Select a line and a curve, or two curves"),
    (REL_HINT_EQUAL, "Select two lines or two curves"),
    (REL_HINT_MIDPOINT, "Select a point and a line"),
    (REL_HINT_ENTITY, "Select an entity"),
    (TOOL_SMART_DIMENSION, "Smart Dimension"),
    (TOOL_RADIUS, "Radius"),
    (TOOL_DIAMETER, "Diameter"),
    (
        DIM_HINT_GENERIC,
        "Select a line, two points, an arc, a circle, or two lines",
    ),
    (DIM_PLACEHOLDER_LENGTH, "value (mm)"),
    (DIM_PLACEHOLDER_ANGLE, "value (deg)"),
    (DIM_CONFLICT_TITLE, "Make Dimension Driven?"),
    (
        DIM_CONFLICT_MESSAGE,
        "Adding this dimension will over-define the sketch.",
    ),
    (DIM_CONFLICT_MAKE_DRIVEN, "Make driven"),
    (DIM_CONFLICT_CANCEL, "Cancel"),
    (FEATURE_TREE_LABEL, "Feature Tree"),
    (FEATURE_ORIGIN, "Origin"),
    (FEATURE_PLANE_XY, "Front Plane"),
    (FEATURE_PLANE_YZ, "Right Plane"),
    (FEATURE_PLANE_ZX, "Top Plane"),
    (FEATURE_SKETCH_DEFAULT, "Sketch"),
    (PROPERTY_PANE_LABEL, "Property Pane"),
    (STATUS_BAR_LABEL, "Status Bar"),
    (STATUS_READY, "Ready"),
    (STATUS_SKETCH_ACTIVE, "Editing Sketch"),
    (MENU_BAR_LABEL, "Menu Bar"),
    (MENU_FILE, "File"),
    (MENU_EDIT, "Edit"),
    (MENU_VIEW, "View"),
    (MENU_INSERT, "Insert"),
    (MENU_TOOLS, "Tools"),
    (MENU_WINDOW, "Window"),
    (MENU_HELP, "Help"),
    (MENU_FILE_NEW, "New"),
    (MENU_FILE_OPEN, "Open"),
    (MENU_FILE_SAVE, "Save"),
    (MENU_FILE_QUIT, "Quit"),
    (MENU_EDIT_UNDO, "Undo"),
    (MENU_EDIT_REDO, "Redo"),
    (MENU_VIEW_ZOOM_FIT, "Zoom to Fit"),
    (MENU_PLACEHOLDER_COMING_SOON, "Coming Soon"),
    (SHORTCUT_QUIT, "Ctrl+Q"),
    (SHORTCUT_UNDO, "Ctrl+Z"),
    (SHORTCUT_REDO, "Ctrl+Y"),
    (SHORTCUT_ZOOM_FIT, "F"),
    (PROPERTY_PANE_NO_SELECTION, "Nothing selected"),
    (PROPERTY_ROW_KIND, "Type"),
    (PROPERTY_ROW_X, "X"),
    (PROPERTY_ROW_Y, "Y"),
    (PROPERTY_ROW_FROM, "From"),
    (PROPERTY_ROW_TO, "To"),
    (PROPERTY_ROW_CENTER, "Center"),
    (PROPERTY_ROW_START, "Start"),
    (PROPERTY_ROW_END, "End"),
    (PROPERTY_ROW_RADIUS, "Radius"),
    (PROPERTY_ROW_CONSTRUCTION, "Construction"),
    (PROPERTY_KIND_POINT, "Point"),
    (PROPERTY_KIND_LINE, "Line"),
    (PROPERTY_KIND_ARC, "Arc"),
    (PROPERTY_KIND_CIRCLE, "Circle"),
    (PROPERTY_VALUE_YES, "Yes"),
    (PROPERTY_VALUE_NO, "No"),
];

const AR_XB: &[(StringKey, &str)] = &[
    (APP_TITLE, "[!! Bône !!]"),
    (RIBBON_LABEL, "[!! ʁibbon !!]"),
    (RIBBON_TAB_SKETCH, "[!! Skêtch !!]"),
    (RIBBON_GROUP_ENTITIES, "[!! Entîtîes !!]"),
    (RIBBON_GROUP_RELATIONS, "[!! Relâtions !!]"),
    (RIBBON_GROUP_DIMENSIONS, "[!! Dîmensions !!]"),
    (RIBBON_GROUP_EXIT, "[!! Êxit !!]"),
    (TOOL_EXIT_SKETCH, "[!! Êxit Skêtch !!]"),
    (TOOL_POINT, "[!! Pôint !!]"),
    (TOOL_LINE, "[!! Lîne !!]"),
    (TOOL_CENTERPOINT_ARC, "[!! Cêntrepoint Arc !!]"),
    (TOOL_TANGENT_ARC, "[!! Tângent Arc !!]"),
    (TOOL_THREE_POINT_ARC, "[!! 3 Pôint Arc !!]"),
    (TOOL_CIRCLE, "[!! Cîrcle !!]"),
    (TOOL_PERIMETER_CIRCLE, "[!! Perîmeter Cîrcle !!]"),
    (TOOL_CORNER_RECTANGLE, "[!! Côrner Rectàngle !!]"),
    (TOOL_CENTER_RECTANGLE, "[!! Cênter Rectàngle !!]"),
    (
        TOOL_THREE_POINT_CORNER_RECTANGLE,
        "[!! 3 Pôint Côrner Rectàngle !!]",
    ),
    (
        TOOL_THREE_POINT_CENTER_RECTANGLE,
        "[!! 3 Pôint Cênter Rectàngle !!]",
    ),
    (TOOL_PARALLELOGRAM, "[!! Parâllelôgram !!]"),
    (TOOL_COINCIDENT, "[!! Coincîdent !!]"),
    (TOOL_HORIZONTAL, "[!! Horîzontal !!]"),
    (TOOL_VERTICAL, "[!! Vêrtical !!]"),
    (TOOL_PARALLEL, "[!! Parâllel !!]"),
    (TOOL_PERPENDICULAR, "[!! Perpendîcular !!]"),
    (TOOL_TANGENT, "[!! Tângent !!]"),
    (TOOL_EQUAL, "[!! Équal !!]"),
    (TOOL_CONCENTRIC, "[!! Concêntric !!]"),
    (TOOL_FIX, "[!! Fîx !!]"),
    (TOOL_MIDPOINT, "[!! Mîdpoint !!]"),
    (REL_HINT_ONE_LINE, "[!! Sêlect a lîne !!]"),
    (REL_HINT_TWO_LINES, "[!! Sêlect twô lînes !!]"),
    (
        REL_HINT_COINCIDENT,
        "[!! Sêlect a pôint ând anôther êntity !!]",
    ),
    (REL_HINT_TWO_CIRCULAR, "[!! Sêlect twô ârcs ôr cîrcles !!]"),
    (
        REL_HINT_TANGENT,
        "[!! Sêlect a lîne ând a cûrve, ôr twô cûrves !!]",
    ),
    (REL_HINT_EQUAL, "[!! Sêlect twô lînes ôr twô cûrves !!]"),
    (REL_HINT_MIDPOINT, "[!! Sêlect a pôint ând a lîne !!]"),
    (REL_HINT_ENTITY, "[!! Sêlect an êntity !!]"),
    (TOOL_SMART_DIMENSION, "[!! Smârt Dimensiôn !!]"),
    (TOOL_RADIUS, "[!! Râdius !!]"),
    (TOOL_DIAMETER, "[!! Dîameter !!]"),
    (
        DIM_HINT_GENERIC,
        "[!! Sêlect a lîne, twô pôints, an ârc, a cîrcle, ôr twô lînes !!]",
    ),
    (DIM_PLACEHOLDER_LENGTH, "[!! valûe (mm) !!]"),
    (DIM_PLACEHOLDER_ANGLE, "[!! valûe (dêg) !!]"),
    (DIM_CONFLICT_TITLE, "[!! Mâke Dîmension Drîven? !!]"),
    (
        DIM_CONFLICT_MESSAGE,
        "[!! Âdding this dîmension will over-defîne the skêtch. !!]",
    ),
    (DIM_CONFLICT_MAKE_DRIVEN, "[!! Mâke drîven !!]"),
    (DIM_CONFLICT_CANCEL, "[!! Cancêl !!]"),
    (FEATURE_TREE_LABEL, "[!! Featûre Tree !!]"),
    (FEATURE_ORIGIN, "[!! Orîgin !!]"),
    (FEATURE_PLANE_XY, "[!! Front Plàne !!]"),
    (FEATURE_PLANE_YZ, "[!! Rîght Plàne !!]"),
    (FEATURE_PLANE_ZX, "[!! Tôp Plàne !!]"),
    (FEATURE_SKETCH_DEFAULT, "[!! Skêtch !!]"),
    (PROPERTY_PANE_LABEL, "[!! Propérty Pâne !!]"),
    (STATUS_BAR_LABEL, "[!! Statûs Bar !!]"),
    (STATUS_READY, "[!! Réady !!]"),
    (STATUS_SKETCH_ACTIVE, "[!! Edîting Skêtch !!]"),
    (MENU_BAR_LABEL, "[!! Mênu Bâr !!]"),
    (MENU_FILE, "[!! Fîle !!]"),
    (MENU_EDIT, "[!! Édit !!]"),
    (MENU_VIEW, "[!! Vîew !!]"),
    (MENU_INSERT, "[!! Insêrt !!]"),
    (MENU_TOOLS, "[!! Tôols !!]"),
    (MENU_WINDOW, "[!! Wîndow !!]"),
    (MENU_HELP, "[!! Hêlp !!]"),
    (MENU_FILE_NEW, "[!! Néw !!]"),
    (MENU_FILE_OPEN, "[!! Ôpen !!]"),
    (MENU_FILE_SAVE, "[!! Sâve !!]"),
    (MENU_FILE_QUIT, "[!! Quît !!]"),
    (MENU_EDIT_UNDO, "[!! Undô !!]"),
    (MENU_EDIT_REDO, "[!! Redô !!]"),
    (MENU_VIEW_ZOOM_FIT, "[!! Zôom to Fît !!]"),
    (MENU_PLACEHOLDER_COMING_SOON, "[!! Côming Sôon !!]"),
    (SHORTCUT_QUIT, "Ctrl+Q"),
    (SHORTCUT_UNDO, "Ctrl+Z"),
    (SHORTCUT_REDO, "Ctrl+Y"),
    (SHORTCUT_ZOOM_FIT, "F"),
    (PROPERTY_PANE_NO_SELECTION, "[!! Nôthing sêlected !!]"),
    (PROPERTY_ROW_KIND, "[!! Týpe !!]"),
    (PROPERTY_ROW_X, "X"),
    (PROPERTY_ROW_Y, "Y"),
    (PROPERTY_ROW_FROM, "[!! Frôm !!]"),
    (PROPERTY_ROW_TO, "[!! Tô !!]"),
    (PROPERTY_ROW_CENTER, "[!! Cênter !!]"),
    (PROPERTY_ROW_START, "[!! Stârt !!]"),
    (PROPERTY_ROW_END, "[!! Énd !!]"),
    (PROPERTY_ROW_RADIUS, "[!! Râdius !!]"),
    (PROPERTY_ROW_CONSTRUCTION, "[!! Constrûction !!]"),
    (PROPERTY_KIND_POINT, "[!! Pôint !!]"),
    (PROPERTY_KIND_LINE, "[!! Lîne !!]"),
    (PROPERTY_KIND_ARC, "[!! Ârc !!]"),
    (PROPERTY_KIND_CIRCLE, "[!! Cîrcle !!]"),
    (PROPERTY_VALUE_YES, "[!! Yés !!]"),
    (PROPERTY_VALUE_NO, "[!! Nô !!]"),
];
