/* jshint sub: true */

lang["en"] = {
    unknownMember: "Unknown member",
    unknownChannel: "Unknown channel",
    newMessage: "New message",
    message: "Message",
    netErrorShort: "Network",
    onlyVisible: "(only visible to you)",

    starred: "Starred",
    channels: "Channels",
    privateMessageRoom: "Direct messages",

    shareYourLocation: "Share your GPS location",

    ok: "Ok",
    dissmiss: "Cancel",

    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 "yesterday, " +dateObj.toLocaleTimeString();
        }
        return dateObj.toLocaleString();
    },

    dom: {
        "fileUploadCancel": "Cancel",
        "neterror": "Cannot connect to chat !"
    }
};

lang["en"].edited = function(ts) {
    return "(edited " +lang["en"].formatDate(ts) +")";
};


