language handling for js
This commit is contained in:
parent
c39e94e4e3
commit
4fca1d16bb
5 changed files with 104 additions and 18 deletions
|
@ -77,3 +77,9 @@ if (typeof console === "undefined" || typeof console.log === "undefined") {
|
|||
console.log = function() {};
|
||||
}
|
||||
}
|
||||
|
||||
var wikiLang = "de";
|
||||
/**
|
||||
* anonymous func: get page language
|
||||
*/
|
||||
(function($){ $("html").attr("lang"); if(typeof(l)!= 'undefined' && l.length>=2) wikiLang=l.substr(0,2).toLowerCase(); if(wikiLang!='de'&& wikiLang!='en') wikiLang='de'; })(jQuery);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
var mainMenu = function(){
|
||||
var $menu = $('.nav-main').find('> ul');
|
||||
|
||||
try{
|
||||
if($menu.length > 0){
|
||||
var $toggler = $menu.find('> li.level1 > .li'),
|
||||
|
@ -23,27 +24,12 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
//FIXME: store current nav state with local storage
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/*var $link = $this.find('#plugin__qc__link'),
|
||||
$container = $this.find('#plugin__qc__wrapper');
|
||||
if($container.length < 1){
|
||||
$this.remove();
|
||||
}else{
|
||||
$container.attr('aria-hidden','true');
|
||||
var $icon = $container.find('#plugin__qc__icon');
|
||||
$container.find('#plugin__qc__out').removeAttr('style');
|
||||
$link.on( 'click', function(e){
|
||||
e.preventDefault();
|
||||
$icon.trigger('click');
|
||||
var oldState = ($link.attr('aria-expanded')=== "true" );
|
||||
$container.attr('aria-hidden',oldState);
|
||||
$(this).attr('aria-expanded',!oldState);
|
||||
|
||||
});
|
||||
}*/
|
||||
|
||||
}catch(err){
|
||||
|
||||
|
|
34
lang/de/lang.js
Normal file
34
lang/de/lang.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
|
||||
var $lang = {};
|
||||
|
||||
$lang['direct_prefix'] = 'Direkt';
|
||||
$lang['direct_content_main'] = 'Hauptinhalt dieser Seite';
|
||||
$lang['direct_menu_main'] = 'Hauptmenü';
|
||||
|
||||
$lang['adjunct_start_logo_text'] = 'Logo: ';
|
||||
$lang['adjunct_linked_logo_text'] = '. Link zur Startseite';
|
||||
|
||||
$lang['nav-area-head'] = 'Navigationsmenüs und Suche';
|
||||
$lang['head_magic_matcher'] = 'MagicMatcher';
|
||||
$lang['head_quick_search'] = 'wikiübergreifende Schnellsuche';
|
||||
$lang['head_menu_main'] = 'Hauptmenü';
|
||||
$lang['head_menu_status'] = 'Seitenstatus';
|
||||
$lang['head_breadcrumb'] = 'Standortanzeiger';
|
||||
|
||||
$lang['quality_trigger'] = 'Seitenanalyse ein- bzw. ausblenden';
|
||||
|
||||
$lang['prefix_tasks'] = 'offene Aufgaben: ';
|
||||
$lang['prefix_tasks_user'] = 'Ihre offenen Aufgaben: ';
|
||||
$lang['prefix_tasks_page'] = 'offene Aufgaben auf dieser Seite: ';
|
||||
$lang['tasks_page_none'] = 'keine offenen Aufgaben für diese Seite';
|
||||
|
||||
$lang['discussion'] = 'Diskussion';
|
||||
$lang['back_to_article'] = 'Zurück zum Artikel';
|
||||
$lang['userpage'] = 'Benutzer-Seite';
|
||||
$lang['__existing__'] = 'Schriftfarbe für Links zu vorhandenen Webseiten';
|
||||
$lang['__missing__'] = 'Schriftfarbe für Links zu nicht vorhandenen Webseiten';
|
||||
$lang['__site_width__'] = 'The width of the full site (can be any length unit: %, px, em, ...)';
|
||||
$lang['__sidebar_width__'] = 'The width of the sidebar, if any (can be any length unit: %, px, em, ...)';
|
||||
|
||||
$lang['__button_color__'] = 'Schriftfarbe für Buttons';
|
||||
$lang['__button_background__'] = 'Hintergrundfarbe für Buttons';
|
33
lang/en/lang.js
Normal file
33
lang/en/lang.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
var $lang = {};
|
||||
|
||||
$lang['direct_prefix'] = 'jump to';
|
||||
$lang['direct_content_main'] = 'main content';
|
||||
$lang['direct_menu_main'] = 'main menu';
|
||||
|
||||
$lang['adjunct_start_logo_text'] = 'Logo: ';
|
||||
$lang['adjunct_linked_logo_text'] = '. homepage link';
|
||||
|
||||
$lang['nav-area-head'] = 'menus and quick search';
|
||||
$lang['head_magic_matcher'] = 'MagicMatcher';
|
||||
$lang['head_quick_search'] = 'quick search';
|
||||
$lang['head_menu_main'] = 'main menu';
|
||||
$lang['head_menu_status'] = 'site status';
|
||||
$lang['head_breadcrumb'] = 'location indicator';
|
||||
|
||||
$lang['quality_trigger'] = 'toggle page analysis';
|
||||
|
||||
$lang['prefix_tasks'] = 'open tasks: ';
|
||||
$lang['prefix_tasks_user'] = 'your open tasks: ';
|
||||
$lang['prefix_tasks_page'] = 'open tasks for this page: ';
|
||||
$lang['tasks_page_none'] = 'no open tasks for this page';
|
||||
|
||||
$lang['discussion'] = 'Discussion';
|
||||
$lang['back_to_article'] = 'Back to article';
|
||||
$lang['userpage'] = 'User page';
|
||||
$lang['__existing__'] = 'The color for links to existing pages';
|
||||
$lang['__missing__'] = 'The color for links to non-existing pages';
|
||||
$lang['__site_width__'] = 'The width of the full site (can be any length unit: %, px, em, ...)';
|
||||
$lang['__sidebar_width__'] = 'The width of the sidebar, if any (can be any length unit: %, px, em, ...)';
|
||||
|
||||
$lang['__button_color__'] = 'Color for buttons';
|
||||
$lang['__button_background__'] = 'Backgroundcolor for buttons';
|
29
script.js
29
script.js
|
@ -1,6 +1,33 @@
|
|||
|
||||
/* DOKUWIKI:include js/base/helper.js */
|
||||
|
||||
/* DOKUWIKI:include js/base/spc.js */
|
||||
|
||||
( function( $, spc, lang ) {
|
||||
|
||||
var setLang = function(){
|
||||
try{
|
||||
if(lang==="de"){
|
||||
/* DOKUWIKI:include lang/de/lang.js */
|
||||
} else if(lang==="en"){
|
||||
/* DOKUWIKI:include lang/en/lang.js */
|
||||
} else{
|
||||
/* default */
|
||||
/* DOKUWIKI:include lang/de/lang.js */
|
||||
}
|
||||
}catch(err){
|
||||
}
|
||||
};
|
||||
|
||||
$(function(){
|
||||
setLang();
|
||||
});
|
||||
|
||||
} )( jQuery, spc, wikiLang );
|
||||
|
||||
|
||||
/* DOKUWIKI:include js/plugins/do_tasks.js */
|
||||
/* DOKUWIKI:include js/sidebar-menu.js */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue