/* jshint sub: true */

lang["fr"] = {
    unknownMember: "Utilisateur inconnu",
    unknownChannel: "Channel inconnu",
    newMessage: "Nouveau message",
    message: "Message",
    netErrorShort: "Reseau",
    onlyVisible: "(visible seulement par vous)",

    starred: "Favoris",
    channels: "Discutions",
    members: "Membres",
    privateMessageRoom: "Discutions privées",

    shareYourLocation: "Partage sa position GPS",

    ok: "Ok",
    dissmiss: "Annuler",

    formatDate: function(ts) {
        if (typeof(ts) !== "string")
            ts = parseFloat(ts);
        var today = new Date(),
            yesterday = new Date(),
            dateObj = new Date(ts);

        today.setHours(0, 0, 0, 0);
        yesterday.setTime(today.getTime());
        yesterday.setDate(yesterday.getDate() -1);

        if (dateObj.getTime() > today.getTime()) {
            // Today time
            return dateObj.toLocaleTimeString();
        }
        if (dateObj.getTime() > yesterday.getTime()) {
            return "hier, " +dateObj.toLocaleTimeString();
        }
        return dateObj.toLocaleString();
    },

    formatDay: function(ts) {
        var today = new Date(),
            yesterday = new Date(),
            dateObj = new Date(ts);

        today.setHours(0, 0, 0, 0);
        yesterday.setTime(today.getTime());
        yesterday.setDate(yesterday.getDate() -1);

        if (dateObj.getTime() > today.getTime()) {
            // Today time
            return "aujourd'hui";
        }
        if (dateObj.getTime() > yesterday.getTime()) {
            return "hier";
        }
        return dateObj.toLocaleDateString();
    },

    chanName: function(serviceName, chanName) {
        return serviceName +'/' +chanName;
    },

    dom: {
        "fileUploadCancel": "Annuler",
        "neterror": "Impossible de se connecter au chat !",

        "ctxMenuSettings": "Configuration",
        "ctxMenuLogout": "Déconnexion",

        "settingTitle": "Configuration",
        "setting-menu-services": "Services",
        "settings-services-title": "Services",
        "setting-menu-display": "Affichage",
        "settings-display-title": "Affichage",
        "setting-menu-privacy": "Vie privée",
        "settings-privacy-title": "Vie privée",
        "settingCommit": "Appliquer",

        "settings-serviceAddButton": "Ajouter un service",
        "settings-serviceListEmpty": "Vous n'avez pas encore ajouté de service. Ajouter un service pour continuer.",
        "settings-serviceAddConfirm": "Suivant",

        "settings-displayEmojiProviderLbl": "Gestionnaire d'emojis",
        "settings-displayDisplayAvatarLbl": "Afficher les avatars",
        "settings-displayColorfulNamesLbl": "Afficher les nomes en couleur",
        "settings-displayScrollAvatarsLbl": "Faire défiler les avatars lors de la lecture",

        "settings-displayAttachmentContentLbl": "Afficher les pieces jointes ?",
        "settings-displayAttachmentContent-never": "Jamais",
        "settings-displayAttachmentContent-always": "Toujours",
        "settings-displayAttachmentContent-notimg": "Si elles ne contiennent pas d'images"
    }
};

lang["fr"].pinCount = function(count) {
    if (count === 0)
        return "Pas de message épinglé";
    return count + (count === 1 ? " message épinglé" : " messages épinglés");
};

lang["fr"].userCount = function(count) {
    if (count === 0)
        return "Pas de chatteur";
    return count + (count === 1 ? " chatteur" : " chatteurs");
};

lang["fr"].edited = function(ts) {
    return "(edit&eacute; " +lang["fr"].formatDate(ts) +")";
};

lang["fr"].topicDetail = function(creator, ts) {
    return "par " +creator.getName() +" le " +lang["fr"].formatDate(ts);
};

