<commit_before>import QtQuick 2.0
import Sailfish.Silica 1.0
import QtQuick.LocalStorage 2.0
import "../JS/dbmanager.js" as DBmanager
import "../JS/preferences.js" as Preferences

Page {
    id: monthsPage

    property var months

    ListModel {id: monthsModel}

    function makeMeACoolMonth(temp) {
        var month = temp.substring(0,2);
        var monthStr = ""

        switch(parseInt(month)) {
            case 1:
                monthStr = "January"
                break;
            case 2:
                monthStr = "February"
                break;
            case 3:
                monthStr = "March"
                break;
            case 4:
                monthStr = "April"
                break;
            case 5:
                monthStr = "May"
                break;
            case 6:
                monthStr = "June"
                break;
            case 7:
                monthStr = "July"
                break;
            case 8:
                monthStr = "August"
                break;
            case 9:
                monthStr = "September"
                break;
            case 10:
                monthStr = "October"
                break;
            case 11:
                monthStr = "November"
                break;
            case 12:
                monthStr = "December"
                break;
        }
        return monthStr + " " + temp.substring(2);
    }

    Component.onCompleted: {
        months = DBmanager.getAllMonths()
        for(var i = 0; i < months.length; i++)
            monthsModel.append({"month" : months[i]})
    }

    SilicaListView {
        id: listView
        model: monthsModel
        anchors.fill: parent

        header: PageHeader {
            title: "History"
        }

        delegate: BackgroundItem {
            id: delegate
            height: 160

            ProgressBar {
                id: percentIndicator
                width: parent.width<commit_msg>also translate month names in history view<commit_after>import QtQuick 2.0
import Sailfish.Silica 1.0
import QtQuick.LocalStorage 2.0
import "../JS/dbmanager.js" as DBmanager
import "../JS/preferences.js" as Preferences

Page {
    id: monthsPage

    property var months

    ListModel {id: monthsModel}

    function makeMeACoolMonth(date) {
        // note: constructor takes months values (0-11)!!
        var d = new Date(parseInt(date.substring(2,6)),
                         parseInt(date.substring(0,2)-1))

        return Qt.formatDate(d, "MMMM yyyy")
    }

    Component.onCompleted: {
        months = DBmanager.getAllMonths()
        for(var i = 0; i < months.length; i++)
            monthsModel.append({"month" : months[i]})
    }

    SilicaListView {
        id: listView
        model: monthsModel
        anchors.fill: parent

        header: PageHeader {
            title: "History"
        }

        delegate: BackgroundItem {
            id: delegate
            height: 160

            ProgressBar {
                id: percentIndicator
                width: parent.width
{'fraction_non_alphanumeric': 0.08738180632539941, 'fraction_numerical': 0.014998369742419302, 'mean_word_length': 1.3137254901960784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5797818', 'n_tokens_mistral': 882, 'n_tokens_neox': 796, 'n_words': 211}