Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 210611 Details for
Bug 369869
Strings that cannot be localized in TextView
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
global.js with i18n support
global.js (text/plain), 4.39 KB, created by
Silenio Quarti
on 2012-02-06 14:28:36 EST
(
hide
)
Description:
global.js with i18n support
Filename:
MIME Type:
Creator:
Silenio Quarti
Created:
2012-02-06 14:28:36 EST
Size:
4.39 KB
patch
obsolete
>/******************************************************************************* > * @license > * Copyright (c) 2010, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials are made > * available under the terms of the Eclipse Public License v1.0 > * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution > * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). > * > * Contributors: > * Felipe Heidrich (IBM Corporation) - initial API and implementation > * Silenio Quarti (IBM Corporation) - initial API and implementation > * Mihai Sucan (Mozilla Foundation) - fix for Bug#364214 > */ > >/*global window */ > >/** > * Evaluates the definition function and mixes in the returned module with > * the module specified by <code>moduleName</code>. > * <p> > * This function is intented to by used when RequireJS is not available. > * </p> > * > * @param {String} name The mixin module name. > * @param {String[]} deps The array of dependency names. > * @param {Function} callback The definition function. > */ >if (!window.define) { > window.define = function(name, deps, callback) { > var module = this; > var split = (name || "").split("/"), i, j; > for (i = 0; i < split.length - 1; i++) { > module = module[split[i]] = (typeof module[split[i]] === "object" ? module[split[i]] : {}); > } > if (!(deps instanceof Array)) { > callback = deps; > deps = []; > } > var depModules = [], depModule; > for (j = 0; j < deps.length; j++) { > depModule = this; > var dep = deps[j]; > var index = dep.indexOf("!"); > if (index !== -1) { > var plugin = window.require(dep.substring(0, index) + "/load"); > dep = dep.substring(index + 1); > plugin.load(dep, window.require, function(value) { depModule = value; } ); > } else { > split = dep.split("/"); > for (i = 0; i < split.length - 1; i++) { > depModule = depModule[split[i]] = (depModule[split[i]] || {}); > } > } > depModules.push(depModule); > } > var newModule = callback instanceof Function ? callback.apply(this, depModules) : callback; > for (var p in newModule) { > if (newModule.hasOwnProperty(p)) { > module[p] = newModule[p]; > } > } > }; >} > >/** > * Require/get the defined modules. > * <p> > * This function is intented to by used when RequireJS is not available. > * </p> > * > * @param {String[]|String} deps The array of dependency names. This can also be > * a string, a single dependency name. > * @param {Function} [callback] Optional, the callback function to execute when > * multiple dependencies are required. The callback arguments will have > * references to each module in the same order as the deps array. > * @returns {Object|undefined} If the deps parameter is a string, then this > * function returns the required module definition, otherwise undefined is > * returned. > */ >if (!window.require) { > window.require = function(deps, callback) { > var depsArr = typeof deps === "string" ? [deps] : deps; > var depModules = [], depModule, split, i, j; > for (j = 0; j < depsArr.length; j++) { > depModule = this; > var dep = depsArr[j]; > var index = dep.indexOf("!"); > if (index !== -1) { > var plugin = window.require(dep.substring(0, index) + "/load"); > dep = dep.substring(index + 1); > plugin.load(dep, window.require, function(value) { depModule = value; } ); > } else { > split = dep.split("/"); > for (i = 0; i < split.length - 1; i++) { > depModule = depModule[split[i]] = (depModule[split[i]] || {}); > } > } > depModules.push(depModule); > } > if (callback) { > callback.apply(this, depModules); > } > return typeof deps === "string" ? depModules[0] : undefined; > }; >} > >if (!window.i18n) { > window.define("i18n/load", function() { > function mixin(obj, mix) { > for (var p in mix) { > if (mix.hasOwnProperty(p)) { > obj[p] = mix[p]; > } > } > } > function load(name, req, onLoad, config) { > var main = req(name); > var result = {}, index = name.lastIndexOf("/"); > var prefix = name.substring(0, index); > var sufix = name.substring(index); > if (main.root) { > mixin(result, main.root); > } > var locale = (window.locale || window.navigator.language || window.navigator.userLanguage).toLowerCase(); > var split = locale.split("-"), part = ""; > for (var i = 0; i < split.length; i++) { > if (part) { part += "-"; } > part += split[i]; > var module = req(prefix + "/" + part + sufix); > if (module) { > mixin(result, module); > } > } > onLoad(result); > } > return {load: load}; > }); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 369869
: 210611