|
Struts example source code file (common.js)
The Struts common.js source code/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo.provide("dojo.i18n.common"); dojo.i18n.getLocalization = function (packageName, bundleName, locale) { dojo.hostenv.preloadLocalizations(); locale = dojo.hostenv.normalizeLocale(locale); var elements = locale.split("-"); var module = [packageName, "nls", bundleName].join("."); var bundle = dojo.hostenv.findModule(module, true); var localization; for (var i = elements.length; i > 0; i--) { var loc = elements.slice(0, i).join("_"); if (bundle[loc]) { localization = bundle[loc]; break; } } if (!localization) { localization = bundle.ROOT; } if (localization) { var clazz = function () { }; clazz.prototype = localization; return new clazz(); } dojo.raise("Bundle not found: " + bundleName + " in " + packageName + " , locale=" + locale); }; dojo.i18n.isLTR = function (locale) { var lang = dojo.hostenv.normalizeLocale(locale).split("-")[0]; var RTL = {ar:true, fa:true, he:true, ur:true, yi:true}; return !RTL[lang]; }; Other Struts examples (source code examples)Here is a short list of links related to this Struts common.js source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.