/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License.
*/
/* Languages and their ids which NetBeans is available*/ var LANGUAGES = new Array(); var BUILD_INFO = new Array();
var PLATFORM_IDS = new Array(); var PLATFORM_LONG_NAMES = new Array(); var PLATFORM_SHORT_NAMES = new Array();
var BUNDLE_IDS = new Array(); var BUNDLE_LONG_NAMES = new Array(); var BUNDLE_SHORT_NAMES = new Array();
var FILES = new Array();
PLATFORM_IDS [0] = "windows";
PLATFORM_IDS [1] = "linux";
PLATFORM_IDS [2] = "macosx";
PLATFORM_IDS [3] = "zip"; /* // Commented since NBI installers are not used for now PLATFORM_IDS [4] = "macosx-x86"; PLATFORM_IDS [5] = "macosx-ppc";
*/
function getNameById(id,ids,names) { for(var i = 0 ; i < ids.length; i++) { if(ids[i] == id) { return names[i];
}
} return"";
}
function getPlatformShortName(id) { return getNameById(id, PLATFORM_IDS, PLATFORM_SHORT_NAMES);
} function getPlatformLongName(id) { return getNameById(id, PLATFORM_IDS, PLATFORM_LONG_NAMES);
}
function getLanguageName(id) { var ids = new Array(); var names = new Array(); for(var i=0;i<LANGUAGES.length;i++) {
ids.push(LANGUAGES[i].id);
names.push(LANGUAGES[i].name);
} return getNameById(id, ids, names);
}
function getBundleShortName(id) { return getNameById(id, BUNDLE_IDS, BUNDLE_SHORT_NAMES);
} function getBundleLongName(id) { return getNameById(id, BUNDLE_IDS, BUNDLE_LONG_NAMES);
}
function get_overridden_language() { var url = "" + window.location; var idx = url.indexOf(PAGELANG_SEP); var langcode = DEFAULT_LANGUAGE; if(idx != -1) {
langcode = url.substring(idx + PAGELANG_SEP.length, url.length);
} return langcode;
}
function get_language_id() { return get_language(0);
}
function get_language_suffix() { return get_language(1);
}
function get_language_location() { var lang_suffix = get_language_suffix(); for(var i = 0; i < LANGUAGES.length; i++) { if(lang_suffix == LANGUAGES[i].suffix) { return LANGUAGES[i].location;
}
}
}
function is_suitable_location(lang_id, location) { for(var i = 0; i < LANGUAGES.length; i++) { if(lang_id == LANGUAGES[i].id) { return LANGUAGES[i].location == location;
}
} returnfalse;
}
function get_language(option) { var variants = LANGUAGES; var resultLanguage = ""; if(variants) { var lang = (option == 0 ) ? variants[0].id : variants[0].suffix; var override = get_overridden_language();
if (override != DEFAULT_LANGUAGE) lang = override; elseif(navigator.userLanguage) lang = navigator.userLanguage; elseif(navigator.language) lang = navigator.language;
lang = lang.replace("-", "_"); for(var i=0; i < variants.length; i++ ) { var value = (option == 0 ) ? variants[i].id : variants[i].suffix; if(value && lang.toLowerCase().indexOf(value.toLowerCase())!=-1) { if(value.length > resultLanguage.length) {
resultLanguage = value;
}
}
}
}
//no language (for id) selected - fallback to en if it is available if (resultLanguage == "" && option == 0) { for(var i=0; i < variants.length; i++ ) { if(variants[i].id == "en") { return"en";
}
}
}
return resultLanguage;
}
function load_js(script_filename) {
document.write('');
}
function load_page_js_locale(name,ext) {
load_js_locale(name, ext);
}
function useAnotherLocation() { var loc = get_language_location(); return loc != getPageArtifactsLocation(false);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.