"""Interface strings (menus, buttons, labels) in English and French.
Page content itself lives in the database and is edited in Admin > Page Content."""

LANGS = ("en", "fr")

STRINGS = {
    # navigation
    "nav.home": ("Home", "Accueil"),
    "nav.about": ("About Us", "À propos"),
    "nav.who": ("Who We Are", "Qui sommes-nous"),
    "nav.president": ("Message from the President", "Mot du Président"),
    "nav.board": ("Current Executive Board", "Bureau exécutif actuel"),
    "nav.past_board": ("Past Executive Boards", "Anciens bureaux exécutifs"),
    "nav.events": ("Events", "Événements"),
    "nav.gallery": ("Photo Gallery", "Galerie photos"),
    "nav.all_albums": ("All albums", "Tous les albums"),
    "nav.contact": ("Contact Us", "Contactez-nous"),
    "nav.join": ("Join BCT", "Adhérer à la BCT"),
    "nav.join_long": ("Identification Form", "Formulaire d'identification"),
    "nav.donate": ("Donate", "Faire un don"),
    "nav.menu": ("Menu", "Menu"),
    "nav.skip": ("Skip to content", "Aller au contenu"),
    # home
    "home.welcome_kicker": ("Welcome", "Bienvenue"),
    "home.read_message": ("Read the full message", "Lire le message complet"),
    "home.mission": ("Our Mission", "Notre mission"),
    "home.vision": ("Our Vision", "Notre vision"),
    "home.objectives": ("Our Objectives", "Nos objectifs"),
    "home.learn_more": ("Learn more about us", "En savoir plus sur nous"),
    "home.next_event": ("Next Event", "Prochain événement"),
    "home.all_events": ("See all events", "Voir tous les événements"),
    "home.gallery_kicker": ("Moments together", "Moments partagés"),
    "home.gallery_title": ("Photo Gallery", "Galerie photos"),
    "home.view_gallery": ("View the full gallery", "Voir toute la galerie"),
    "home.cta_title": ("Be part of the BCT family", "Rejoignez la famille BCT"),
    "home.cta_text": ("Register as a member with our identification form, or support our projects in Bandjoun and Texas with a tax-deductible gift.",
                      "Inscrivez-vous comme membre grâce à notre formulaire d'identification, ou soutenez nos projets à Bandjoun et au Texas par un don déductible des impôts."),
    "home.prev": ("Previous slide", "Diapositive précédente"),
    "home.next": ("Next slide", "Diapositive suivante"),
    "home.goto": ("Go to slide", "Aller à la diapositive"),
    "home.pause": ("Pause slideshow", "Mettre en pause"),
    "home.play": ("Play slideshow", "Lecture"),
    # about
    "about.core_values": ("Our Core Values", "Nos valeurs fondamentales"),
    "about.board_cta": ("Meet our Executive Board", "Découvrez notre bureau exécutif"),
    # board
    "board.title": ("Current Executive Board", "Bureau exécutif actuel"),
    "board.past_title": ("Past Executive Boards", "Anciens bureaux exécutifs"),
    "board.current_cta": ("Meet the current Executive Board", "Découvrir le bureau exécutif actuel"),
    "board.past_cta": ("See past Executive Boards", "Voir les anciens bureaux exécutifs"),
    "board.term": ("Term", "Mandat"),
    # president
    "president.sincerely": ("Sincerely,", "Cordialement,"),
    # events
    "events.title": ("Events", "Événements"),
    "events.past_tag": ("Past event", "Événement passé"),
    "events.upcoming": ("Upcoming Events", "Événements à venir"),
    "events.past": ("Past Events", "Événements passés"),
    "events.empty": ("No events yet. Please check back soon.", "Aucun événement pour le moment. Revenez bientôt."),
    "events.none": ("No upcoming events at the moment. Please check back soon.",
                    "Aucun événement à venir pour le moment. Revenez bientôt."),
    "events.date": ("Date", "Date"),
    "events.time": ("Time", "Heure"),
    "events.location": ("Location", "Lieu"),
    "events.more": ("More information", "Plus d'informations"),
    "events.details_soon": ("More details coming soon.", "Plus de détails bientôt."),
    "events.view_flyer": ("View flyer", "Voir l'affiche"),
    # gallery
    "gallery.title": ("Photo Gallery", "Galerie photos"),
    "gallery.intro": ("Relive our celebrations, community service and gatherings.",
                      "Revivez nos célébrations, nos actions communautaires et nos rencontres."),
    "gallery.photos": ("photos", "photos"),
    "gallery.videos": ("videos", "vidéos"),
    "gallery.photo": ("photo", "photo"),
    "gallery.video": ("video", "vidéo"),
    "gallery.back": ("Back to all albums", "Retour aux albums"),
    "gallery.close": ("Close", "Fermer"),
    "gallery.empty": ("No photos in this album yet.", "Aucune photo dans cet album pour l'instant."),
    # contact
    "contact.title": ("Contact Us", "Contactez-nous"),
    "contact.name": ("Full name", "Nom complet"),
    "contact.email": ("Email address", "Adresse e-mail"),
    "contact.phone": ("Phone (optional)", "Téléphone (facultatif)"),
    "contact.city": ("City (optional)", "Ville (facultatif)"),
    "contact.subject": ("Subject", "Objet"),
    "contact.message": ("Message", "Message"),
    "contact.send": ("Send message", "Envoyer le message"),
    "contact.thanks": ("Thank you! Your message has been received. We will get back to you soon.",
                       "Merci ! Votre message a bien été reçu. Nous vous répondrons très bientôt."),
    "contact.error": ("Please fill in your name, a valid email address and a message.",
                      "Veuillez indiquer votre nom, une adresse e-mail valide et un message."),
    "contact.slow": ("Too many messages were sent from your connection. Please try again later.",
                     "Trop de messages ont été envoyés depuis votre connexion. Veuillez réessayer plus tard."),
    "contact.email_us": ("Email us", "Écrivez-nous"),
    "contact.join_title": ("Become a member", "Devenir membre"),
    "contact.join_text": ("Complete the BCT identification form to register with the association.",
                          "Remplissez le formulaire d'identification de la BCT pour vous enregistrer auprès de l'association."),
    "contact.subjects": (["General question", "Membership", "Events", "Donations", "Volunteering", "Other"],
                         ["Question générale", "Adhésion", "Événements", "Dons", "Bénévolat", "Autre"]),
    # donate
    "donate.title": ("Support the BCT", "Soutenir la BCT"),
    "donate.zelle_title": ("Give with Zelle", "Donner avec Zelle"),
    "donate.step1": ("Open your bank app and choose Zelle.", "Ouvrez votre application bancaire et choisissez Zelle."),
    "donate.step2": ("Send your gift to:", "Envoyez votre don à :"),
    "donate.step3": ("Add the memo below with your full name so we can send your receipt.",
                     "Ajoutez la mention ci-dessous avec votre nom complet afin que nous puissions vous envoyer votre reçu."),
    "donate.recipient": ("Recipient", "Bénéficiaire"),
    "donate.memo": ("Memo", "Mention"),
    "donate.memo_value": ("BCT Donation – Your full name", "Don BCT – Votre nom complet"),
    "donate.copy": ("Copy", "Copier"),
    "donate.copied": ("Copied!", "Copié !"),
    "donate.scan": ("Or scan with your banking app", "Ou scannez avec votre application bancaire"),
    "donate.tax_title": ("Tax-deductible giving", "Dons déductibles des impôts"),
    "donate.ein": ("EIN (Tax ID)", "EIN (numéro fiscal)"),
    "donate.ein_request": ("Available upon request", "Disponible sur demande"),
    "donate.questions": ("Questions about donations or receipts?", "Des questions sur les dons ou les reçus ?"),
    # footer
    "footer.quick": ("Quick links", "Liens rapides"),
    "footer.contact": ("Contact", "Contact"),
    "footer.get_involved": ("Get involved", "S'impliquer"),
    "footer.nonprofit": ("A 501(c)(3) nonprofit organization", "Organisation à but non lucratif 501(c)(3)"),
    "footer.rights": ("All rights reserved.", "Tous droits réservés."),
    "footer.admin": ("Admin", "Admin"),
    "footer.powered": ("Website Powered by", "Site web propulsé par"),
    "footer.member_of": (", a member of ", ", membre de "),
    # misc
    "lang.switch": ("Français", "English"),
    "err.404": ("Page not found", "Page introuvable"),
    "err.404_text": ("The page you are looking for does not exist or has moved.",
                     "La page que vous recherchez n'existe pas ou a été déplacée."),
    "err.home": ("Back to home", "Retour à l'accueil"),
}

MONTHS = {
    "en": ["January", "February", "March", "April", "May", "June", "July", "August",
           "September", "October", "November", "December"],
    "fr": ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août",
           "septembre", "octobre", "novembre", "décembre"],
}
MONTHS_SHORT = {
    "en": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
    "fr": ["janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."],
}
WEEKDAYS = {
    "en": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
    "fr": ["lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi", "dimanche"],
}


def translate(key, lang):
    pair = STRINGS.get(key)
    if not pair:
        return key
    return pair[1] if lang == "fr" else pair[0]


def format_date(d, lang, with_weekday=True):
    if not d:
        return ""
    wd = WEEKDAYS[lang][d.weekday()]
    if lang == "fr":
        s = f"{d.day if d.day != 1 else '1er'} {MONTHS['fr'][d.month - 1]} {d.year}"
        return f"{wd.capitalize()} {s}" if with_weekday else s
    s = f"{MONTHS['en'][d.month - 1]} {d.day}, {d.year}"
    return f"{wd}, {s}" if with_weekday else s
