<commit_before>
import translator_module = require('../scripts/translator');

declare var PolymerExpressions: any;
PolymerExpressions.prototype.$$ = translator_module.i18n_t;

Polymer({
  logs: '',
  loadingLogs: true,
  created: function() {
    // Default language to English.
    var language = window.location.href.split('lang=')[1] || 'en';
    translator_module.i18n_setLng(language.substring(0, 2));
  },
  openLogs: function() {
    // opens the logsPanel, which contains the logs
    this.$.logsPanel.open();
  },
  close: function() {
    // closes the logsPanel
    this.$.logsPanel.close();
  },
  ready: function() {
    // TODO: Move this update out of "ready", to fix #2541.
    ui_context.core.getLogs().then((logs:string) => {
      this.loadingLogs = false;
      // Add browser info to logs.
      this.logs = 'Browser Info: ' + navigator.userAgent + '\n\n' + logs;
    });
  }<commit_msg>Update logs when when logs.html is called Fixes #2541<commit_after>
import translator_module = require('../scripts/translator');

declare var PolymerExpressions: any;
PolymerExpressions.prototype.$$ = translator_module.i18n_t;

Polymer({
  logs: '',
  loadingLogs: true,
  created: function() {
    // Default language to English.
    var language = window.location.href.split('lang=')[1] || 'en';
    translator_module.i18n_setLng(language.substring(0, 2));
  },
  openLogs: function() {
    // Reset logs and display loading bar
    this.logs = '';
    this.loadingLogs = true;
    ui_context.core.getLogs().then((logs:string) => {
      this.loadingLogs = false;
      // Add browser info to logs.
      this.logs = 'Browser Info: ' + navigator.userAgent + '\n\n' + logs;
    });
    // opens the logsPanel, which contains the logs
    this.$.logsPanel.open();
  },
  close: function() {
    // closes the logsPanel
    this.$.logsPanel.close();
  },
{'fraction_non_alphanumeric': 0.15206878022568512, 'fraction_numerical': 0.011821601289629231, 'mean_word_length': 3.2414578587699316, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2861877', 'n_tokens_mistral': 615, 'n_tokens_neox': 591, 'n_words': 141}