/*
 * This file is part of Report Portal.
 *
 * Report Portal is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Report Portal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Report Portal.  If not, see <http://www.gnu.org/licenses/>.
 */
define(function (require) {
    'use strict';

    var $ = require('jquery');
    var langEn = require('localizations/en-EU');
    var langRu = require('localizations/ru-RU');
    var SingletonAppStorage = require('storage/SingletonAppStorage');

    var appStorage = new SingletonAppStorage();
    var lang = appStorage.get('appLanguage') || 'en';
    var langRuSafe = $.extend(true, {}, langEn, langRu);
    var Localization = {};
    switch (lang) {
    case 'ru':
        Localization = langRuSafe;
        break;
    default:
        Localization = langEn;
    }
    return Localization;
});

@@ -767,17 +767,17 @@
     var 
-$
+_
  = requi
@@ -784,14 +784,18 @@
 re('
-jquery
+underscore
 ');%0A
@@ -1090,27 +1090,18 @@
 e = 
-$.
 extend
-(true, %7B%7D, 
+Loc(
 lang
@@ -1140,16 +1140,683 @@
 n = %7B%7D;%0A
+%0A    function extendLoc(baseLoc, newLoc) %7B%0A        var result = _.cloneDeep(baseLoc);%0A        var consoleString = '';%0A        _.each(result, function (section, sectionKey) %7B%0A            _.each(section, function (item, itemKey) %7B%0A                if (newLoc%5BsectionKey%5D && newLoc%5BsectionKey%5D%5BitemKey%5D) %7B%0A                    result%5BsectionKey%5D%5BitemKey%5D = newLoc%5BsectionKey%5D%5BitemKey%5D;%0A                %7D else %7B%0A                    consoleString += sectionKey + ' -%3E ' + itemKey + '%5Cn';%0A                %7D%0A            %7D);%0A        %7D);%0A        if ('DEBUG_STATE') %7B%0A            console.log('Undefined localization: %5Cn' + consoleString);%0A        %7D%0A        return result;%0A    %7D%0A%0A
     swit

add search lost localization