<commit_before>Webos.Translation = function WTranslation(data) {
	Webos.Model.call(this, data);
};
Webos.Translation.prototype = {
	get: function(original, variables) {
		var translation = this._get(original);
		
		if (!translation) {
			translation = original;
		}
		
		if (typeof variables == 'object') {
			for (var index in variables) {
				translation = translation.replace('${'+index+'}', variables[index]);
			}
		}
		
		return translation;
	}
};
Webos.inherit(Webos.Translation, Webos.Model); //Héritage de Webos.Model

Webos.Translation._language = null;
Webos.Translation.language = function() {
	return Webos.Translation._language;
};
Webos.Translation.load = function(callback, path, locale) {
	callback = Webos.Callback.toCallback(callback);
	locale = String(locale);
	
	var loadTranslationFn = function() {
		locale = ((locale && /[a-z]{2}_[A-Z]{2}/.test(locale)) ? locale : (Webos.Translation.language()) ? Webos.Translation.language() : Webos.Locale._defaultLocale);
		var file = Webos.File.get('/usr/share/locale/' + locale + '/' + path + '.ini');
		
		if (locale == Webos.Translation._defaultLanguage) {
			callback.success(new Webos.Translation());
			return;
		}
		
		file.contents([function(contents) {
			var lines = contents.split('\n');
			var data = {};
			
			for (var i = 0; i < lines.length; i++) {
				if (lines[i].charAt(0) == ';') {
					continue;
				}
				
				var words = lines[i].split('=');
				
				if (words.length < 2) {
					continue;<commit_msg>Resolution d'un bug avec la langue par defaut en_EN.<commit_after>Webos.Translation = function WTranslation(data) {
	Webos.Model.call(this, data);
};
Webos.Translation.prototype = {
	get: function(original, variables) {
		var translation = this._get(original);
		
		if (!translation) {
			translation = original;
		}
		
		if (typeof variables == 'object') {
			for (var index in variables) {
				translation = translation.replace('${'+index+'}', variables[index]);
			}
		}
		
		return translation;
	}
};
Webos.inherit(Webos.Translation, Webos.Model); //Héritage de Webos.Model

Webos.Translation._language = null;
Webos.Translation.language = function() {
	return Webos.Translation._language;
};
Webos.Translation.load = function(callback, path, locale) {
	callback = Webos.Callback.toCallback(callback);
	locale = String(locale);
	
	var loadTranslationFn = function() {
		locale = ((locale && /[a-z]{2}_[A-Z]{2}/.test(locale)) ? locale : (Webos.Translation.language()) ? Webos.Translation.language() : Webos.Locale._defaultLocale);
		var file = Webos.File.get('/usr/share/locale/' + locale + '/' + path + '.ini');
		
		if (locale == Webos.Locale._defaultLocale) {
			callback.success(new Webos.Translation());
			return;
		}
		
		file.contents([function(contents) {
			var lines = contents.split('\n');
			var data = {};
			
			for (var i = 0; i < lines.length; i++) {
				if (lines[i].charAt(0) == ';') {
					continue;
				}
				
				var words = lines[i].split('=');
				
				if (words.length < 2) {
					continue;
{'fraction_non_alphanumeric': 0.16910785619174434, 'fraction_numerical': 0.003328894806924101, 'mean_word_length': 3.651702786377709, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4787309', 'n_tokens_mistral': 1108, 'n_tokens_neox': 948, 'n_words': 195}