mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Performing I18N completely on the server, to leverage the existing gettext architecture. Also, the browser does not have access to the Language header. Added the additional po files for a set of required languages conflict with install/static/ipa.js was resolved. Note that the addition of the .po files in this patch is necessary. In order to get Transifex support, we need to update the LINGUAS file with the languages for which we want support. If we don't add the .po files in, they get automatically generated by the rpmbuild process. Our implementation of gettext has a bug in it (It might be F13 thing) where the the Plurals line is not getting correctly transformed, which causes a build failure. However, since the RPM would have the .po files anyway, we should revision control the ones we have, even if they are empty. Fixed the Bug reporting url to the original value. Corrected the Chartype encoding for UK
88 lines
2.4 KiB
JavaScript
88 lines
2.4 KiB
JavaScript
/* Authors:
|
|
* Pavel Zuna <pzuna@redhat.com>
|
|
*
|
|
* Copyright (C) 2010 Red Hat
|
|
* see file 'COPYING' for use and warranty information
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as
|
|
* published by the Free Software Foundation; version 2 only
|
|
*
|
|
* This program 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 General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
|
|
function nav_create(nls, container, tabclass)
|
|
{
|
|
if (!container)
|
|
container = $('#navigation');
|
|
if (!tabclass)
|
|
tabclass = 'tabs';
|
|
|
|
nav_generate_tabs(nls, container, tabclass, 1);
|
|
|
|
var tabs = $('.' + tabclass);
|
|
tabs.tabs({event: 'change'});
|
|
tabs.find('ul.ui-tabs-nav a').click(_nav_tab_on_click);
|
|
}
|
|
|
|
function nav_generate_tabs(nls, container, tabclass, depth)
|
|
{
|
|
container.addClass(tabclass);
|
|
container.addClass('tabs'+depth);
|
|
container.prepend('<ul></ul>');
|
|
|
|
var ul = container.children().first();
|
|
for (var i = 0; i < nls.length; ++i) {
|
|
var n = nls[i];
|
|
|
|
var name = n[1];
|
|
if ((ipa_objs[n[0]]) && (ipa_objs[n[0]].label)){
|
|
name = ipa_objs[n[0]].label;
|
|
}
|
|
|
|
nav_insert_tab_li(ul, n[0], name);
|
|
|
|
nav_insert_tab_div(container, n[0]);
|
|
|
|
var div = ul.parent().children().last();
|
|
if (typeof n[2] == 'function') {
|
|
n[2](div);
|
|
} else if (n[2].length) {
|
|
nav_generate_tabs(n[2], div, tabclass, depth +1 );
|
|
}
|
|
}
|
|
}
|
|
|
|
var _nav_li_tab_template = '<li><a href="#I">N</a></li>';
|
|
|
|
function nav_insert_tab_li(jobj, id, name)
|
|
{
|
|
jobj.append(_nav_li_tab_template.replace('I', id).replace('N', name));
|
|
}
|
|
|
|
var _nav_div_tab_template = '<div id="T"></div>';
|
|
|
|
function nav_insert_tab_div(jobj, id)
|
|
{
|
|
jobj.append(_nav_div_tab_template.replace('T', id));
|
|
}
|
|
|
|
function _nav_tab_on_click(obj)
|
|
{
|
|
var jobj = $(this);
|
|
var state = {};
|
|
var id = jobj.closest('.tabs').attr('id');
|
|
var index = jobj.parent().prevAll().length;
|
|
|
|
state[id] = index;
|
|
$.bbq.pushState(state);
|
|
}
|
|
|