<commit_before>import React, { Component } from "react";
import DocumentInfo from "../../view/settings/DocumentInfo";

class DocumentInfoController extends Component {
    constructor(props) {
        super(props);
        this.docProps = this.getDocProps();
        this.getModified = this.getModified();
        this.getModifiedBy = this.getModifiedBy();
        this.getCreators = this.getCreators();
    }

    getDocProps() {
        const api = Common.EditorApi.get();
        return api.asc_getCoreProps();
    }

    getAppProps() {
        const api = Common.EditorApi.get();
        const appProps = api.asc_getAppProps();

        if (appProps) {
            let appName =
                (appProps.asc_getApplication() || "") +
                (appProps.asc_getAppVersion() ? " " : "") +
                (appProps.asc_getAppVersion() || "");
            return appName;
        }
    }

    getModified() {
        let valueModified = this.docProps.asc_getModified();

        if (valueModified) {
            return (
                valueModified.toLocaleString('en', {
                    year: "numeric",
                    month: "2-digit",
                    day: "2-digit",
                }) +
                " " +
                valueModified.toLocaleTimeString('en', { timeStyle: "short" })
            );
        }
    }

    getModifiedBy() {
        let valueModifiedBy = this.docProps.asc_getLastModifiedBy();

        if (valueModifiedBy) {
            return Common.Utils.UserInfoParser.getParsedName(valueModifiedBy);
        }
    }

    getCreators() {
        return this.docProps.asc_getCreator();
    }

    componentDidMount() {
        const api = Common.EditorApi.get();
        api.startGetDocInfo();
    }

    render() {
        return (
            <DocumentInfo
                getAppProps={this.getAppProps}
                getModified={this.getModified}
                getModifiedBy={this.getModifiedBy}
                getCreators={this.getCreators} 
            />
        );
    }
}


export default DocumentInfoController;<commit_msg>[DE mobile] Doc info: add lang variable into getModified<commit_after>import React, { Component } from "react";
import { observer, inject } from "mobx-react";
import DocumentInfo from "../../view/settings/DocumentInfo";

class DocumentInfoController extends Component {
    constructor(props) {
        super(props);
        this.docProps = this.getDocProps();
        this.getModified = this.getModified();
        this.getModifiedBy = this.getModifiedBy();
        this.getCreators = this.getCreators();
    }

    getDocProps() {
        const api = Common.EditorApi.get();
        return api.asc_getCoreProps();
    }

    getAppProps() {
        const api = Common.EditorApi.get();
        const appProps = api.asc_getAppProps();

        if (appProps) {
            let appName =
                (appProps.asc_getApplication() || "") +
                (appProps.asc_getAppVersion() ? " " : "") +
                (appProps.asc_getAppVersion() || "");
            return appName;
        }
    }

    getModified() {
        let valueModified = this.docProps.asc_getModified();
        const _lang = this.props.storeAppOptions.lang;

        if (valueModified) {
            return (
                valueModified.toLocaleString(_lang, {
                    year: "numeric",
                    month: "2-digit",
                    day: "2-digit",
                }) +
                " " +
                valueModified.toLocaleTimeString(_lang, { timeStyle: "short" })
            );
        }
    }

    getModifiedBy() {
        let valueModifiedBy = this.docProps.asc_getLastModifiedBy();

        if (valueModifiedBy) {
            return Common.Utils.UserInfoParser.getParsedName(valueModifiedBy);
        }
    }

    getCreators() {
        return this.docProps.asc_getCreator();
    }

    componentDidMount() {
        const api = Common.EditorApi.get();
        api.startGetDocInfo();
    }

    render() {
        return (
            <DocumentInfo
                getAppProps={this.getAppProps}
                getModified={this.getModified}
                getModifiedBy={this.getModifiedBy}
                getCreators={this.getCreators} 
            />
        );
    }
}


export default inject("storeAppOptions")(observer(DocumentInfoController));
{'fraction_non_alphanumeric': 0.11633776961909133, 'fraction_numerical': 0.0009178522257916476, 'mean_word_length': 1.7799744897959184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1694251', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1155, 'n_words': 191}