csaf-crud 1.4.15

CSAF 2.0 / 2.1 advisory CRUD server with HATEOAS JSON API and HTML UI (TLS 1.3, HTTP/1.1 + HTTP/2 + HTTP/3)
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2026 Pierre Gronau, ndaal in Cologne

//! Translated `<option>` display text for CSAF vocabulary selects.

use crate::i18n::Entry;

/// Translated `<option>` display text for CSAF vocabulary selects.
///
/// Every `value="..."` attribute stays the literal CSAF/OASIS enum keyword
/// (`csaf_security_advisory`, `draft`, `known_affected`, `vendor`, ...);
/// only the visible text between the tags is looked up here, mirroring
/// `routes::home::action_badge`'s class-vs-label split. The English column
/// is left byte-identical to the pre-i18n source text.
pub(super) fn tr(key: &str) -> Option<Entry> {
    Some(match key {
        "csaf.opt_category_security_advisory" => (
            "Security Advisory",
            "Sicherheitshinweis",
            "Avis de sécurité",
            "Aviso de seguridad",
            "Avviso di sicurezza",
        ),
        "csaf.opt_category_vex" => ("VEX", "VEX", "VEX", "VEX", "VEX"),
        "csaf.opt_category_informational_advisory" => (
            "Informational Advisory",
            "Informationshinweis",
            "Avis d'information",
            "Aviso informativo",
            "Avviso informativo",
        ),
        "csaf.opt_status_draft" => ("draft", "Entwurf", "brouillon", "borrador", "bozza"),
        "csaf.opt_status_interim" => (
            "interim",
            "Zwischenversion",
            "intermédiaire",
            "provisional",
            "interinale",
        ),
        "csaf.opt_status_final" => ("final", "final", "final", "final", "finale"),
        "csaf.opt_product_status_known_affected" => (
            "known_affected",
            "bekannt betroffen",
            "connu comme affecté",
            "afectado conocido",
            "noto come interessato",
        ),
        "csaf.opt_product_status_known_not_affected" => (
            "known_not_affected",
            "bekannt nicht betroffen",
            "connu comme non affecté",
            "no afectado conocido",
            "noto come non interessato",
        ),
        "csaf.opt_product_status_fixed" => ("fixed", "behoben", "corrigé", "corregido", "risolto"),
        "csaf.opt_product_status_under_investigation" => (
            "under_investigation",
            "wird untersucht",
            "en cours d'examen",
            "bajo investigación",
            "in fase di analisi",
        ),
        "csaf.opt_publisher_category_vendor" => (
            "vendor",
            "Hersteller",
            "fournisseur",
            "proveedor",
            "fornitore",
        ),
        "csaf.opt_publisher_category_discoverer" => (
            "discoverer",
            "Entdecker",
            "découvreur",
            "descubridor",
            "scopritore",
        ),
        "csaf.opt_publisher_category_coordinator" => (
            "coordinator",
            "Koordinator",
            "coordinateur",
            "coordinador",
            "coordinatore",
        ),
        "csaf.opt_publisher_category_user" => {
            ("user", "Anwender", "utilisateur", "usuario", "utente")
        },
        "csaf.opt_publisher_category_translator" => (
            "translator",
            "Übersetzer",
            "traducteur",
            "traductor",
            "traduttore",
        ),
        "csaf.opt_publisher_category_other" => ("other", "Sonstige", "autre", "otro", "altro"),
        _ => return None,
    })
}