<commit_before>

// Localization component
var Localization = {
	template: '<div/>',
	data: function() {
		return {
			l10n: null,
			eventReceived: false
		}
	},
	mounted: function() {
		var vm = this;
		if (vm.l10n == null) {
			require(["sugar-web/env", "webL10n"], function (env, webL10n) {
				env.getEnvironment(function(err, environment) {
					vm.l10n = webL10n;
					var defaultLanguage = (typeof chrome != 'undefined' && chrome.app && chrome.app.runtime) ? chrome.i18n.getUILanguage() : navigator.language;
					var language = environment.user ? environment.user.language : defaultLanguage;
					webL10n.language.code = language;
					window.addEventListener("localized", function() {
						if (!vm.eventReceived) {
							vm.$emit("localized");
							vm.eventReceived = true;
						}
					});
				});
			});
		}
	},
	methods: {
		get: function(str) {
			return this.l10n.get(str);
		}
	}
}
<commit_msg>Fix localization issue, now get dictionary into l10n component<commit_after>

// Localization component
var Localization = {
	template: '<div/>',
	data: function() {
		return {
			l10n: null,
			dictionary: null,
			eventReceived: false
		}
	},
	mounted: function() {
		var vm = this;
		if (vm.l10n == null) {
			require(["sugar-web/env", "webL10n"], function (env, webL10n) {
				env.getEnvironment(function(err, environment) {
					vm.l10n = webL10n;
					var defaultLanguage = (typeof chrome != 'undefined' && chrome.app && chrome.app.runtime) ? chrome.i18n.getUILanguage() : navigator.language;
					var language = environment.user ? environment.user.language : defaultLanguage;
					webL10n.language.code = language;
					window.addEventListener("localized", function() {
						if (!vm.eventReceived) {
							vm.dictionary = vm.l10n.dictionary;
							vm.$emit("localized");
							vm.eventReceived = true;
						}
					});
				});
			});
		}
	},
	methods: {
		get: function(str) {
			if (!this.dictionary) {
				return str;
			}
			var item = this.dictionary[str];
			if (!item || !item.textContent) {
				return str;
			}
			return item.textContent;
		}
	}
}

{'fraction_non_alphanumeric': 0.1513695338779433, 'fraction_numerical': 0.01826045170591062, 'mean_word_length': 3.0348837209302326, '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': '4503056', 'n_tokens_mistral': 889, 'n_tokens_neox': 691, 'n_words': 142}