fixed et2_dialog static methods like confirm did not show translations: injecting an egw object with loaded translations for current app

This commit is contained in:
Ralf Becker
2014-01-23 10:52:44 +00:00
parent 40b33e6a1d
commit f0710fbecb
2 changed files with 74 additions and 13 deletions

View File

@ -88,6 +88,28 @@ egw.extend('lang', egw.MODULE_GLOBAL, function() {
return translation;
},
/**
* Load default langfiles for an application: common, _appname, custom
*
* @param _window
* @param {string} _appname name of application to load translations for
* @param {function} _callback
* @param _context
*/
langRequireApp: function(_window, _appname, _callback, _context)
{
var lang = egw.preference('lang');
var langs = [{app: 'common', lang: lang}];
if (_appname && _appname != 'eGroupWare')
{
langs.push({app: _appname, lang: lang});
}
langs.push({app: 'custom', lang: 'en'});
egw.langRequire(_window, langs, _callback, _context);
},
/**
* Includes the language files for the given applications -- if those
* do not already exist, include them.