TRANSLATIONS = {
    "en_US": {
        "admin_title": "Robyn Admin",
        "login": "Login",
        "logout": "Logout",
        "welcome": "Welcome",
        "home": "Home",
        "search": "Search",
        "reset": "Reset",
        "submit": "Submit",
        "cancel": "Cancel",
        "save": "Save",
        "back": "Back",
        "add": "Add",
        "edit": "Edit",
        "delete": "Delete",
        "batch_delete": "Batch Delete",
        "export": "Export",
        "yes": "Yes",
        "no": "No",
        "normal": "Normal",
        "disabled": "Disabled",
        "all": "All",
        "status": "Status",
        "active": "Active",
        "inactive": "Inactive",
        "is_superuser": "Administrator",
        "username": "Username",
        "email": "Email",
        "password": "Password",
        "created_at": "Created At",
        "updated_at": "Updated At",
        "last_login": "Last Login",
        "confirm_delete": "Are you sure you want to delete?",
        "operation_success": "Operation Success",
        "operation_failed": "Operation Failed",
        "please_select": "Please Select",
        "loading": "Loading...",
        "no_data": "No Data",
        "operation": "Operations",
        "selected_items": "{count} items selected",
        "clear_selection": "Clear Selection",
        "please_select_items": "Please select items to delete",
        "confirm_batch_delete": "Are you sure to delete {count} selected items?",
        "deleting": "Deleting...",
        "export_selected": "Exported {count} selected items",
        "export_current": "Exported all items in current page",
        "switch_language_failed": "Failed to switch language",
        "load_failed": "Failed to load data, please refresh the page",
        "delete_failed": "Delete failed, please try again",
        "delete_success": "Delete successful",
        "delete_partial": "Partially deleted",
        "refresh": "Refresh",
        "toggle_view": "Toggle View",
        "columns": "Columns",
        "search_placeholder": "Search...",
        "no_records_found": "No matching records found",
        "pagination_info": "Showing {from} to {to} of {total} entries",
        "row_delete": "Delete",
        "import": "Import",
        "start_date": "Start Date",
        "end_date": "End Date",
        "date_separator": "to",
        "min_value": "Min",
        "max_value": "Max",
        "number_separator": "to",
        "filter_placeholder": "Enter {field}",
        "select_placeholder": "Select {field}",
        "list": "List",
        "system_management": "System Management",
        "user_management": "User Management",
        "role_management": "Role Management",
        "user_role_management": "User Role Management",
        "import_data": "Import Data",
        "select_file": "Select File",
        "supported_formats": "Supported formats: Excel (.xlsx, .xls), CSV (.csv)",
        "required_fields": "Required fields",
        "import_button": "Import",
        "choose_file": "Choose File",
        "no_file_chosen": "No file chosen",
        "please_select_file": "Please select a file",
    }
}


def get_text(key: str, lang: str | None = None) -> str:
    default_lang = "en_US"
    current_lang = lang or default_lang
    return TRANSLATIONS.get(current_lang, TRANSLATIONS[default_lang]).get(
        key, key
    )
