Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #73 - Use AMD paths mappings #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

6 changes: 3 additions & 3 deletions Intl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define([ "./impl/Record", "./impl/calendars", "./impl/common", "./locales!",
"requirejs-text/text!./cldr/supplemental/currencyData.json",
"requirejs-text/text!./cldr/supplemental/timeData.json",
"requirejs-text/text!./cldr/supplemental/numberingSystems.json" ],
"text!cldr/supplemental/currencyData.json",
"text!cldr/supplemental/timeData.json",
"text!cldr/supplemental/numberingSystems.json" ],
function (Record, calendars, common, preloads,
currencyDataJson, timeDataJson, numberingSystemsJson) {
/**
Expand Down
4 changes: 2 additions & 2 deletions impl/calendarFunctions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([ "./Record", "requirejs-text/text!../cldr/supplemental/calendarData.json"],
define([ "./Record", "text!cldr/supplemental/calendarData.json"],
function (Record, calendarDataJson) {
/**
* Utility functions that are common across multiple
Expand Down Expand Up @@ -73,4 +73,4 @@ define([ "./Record", "requirejs-text/text!../cldr/supplemental/calendarData.json
}
};
return calendarFunctions;
});
});
2 changes: 1 addition & 1 deletion impl/calendars.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define([ "./Record",
"requirejs-text/text!../cldr/config/calendarDependencies.json",
"text!cldr/config/calendarDependencies.json",
"../calendars/gregorianCalendar"],
/**
* Functions and data related to implementation of calendars.
Expand Down
14 changes: 7 additions & 7 deletions impl/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Commonly used routines throughout ECMA-402 package. Also referred to in the standard as "Abstract Operations"
*/
define(["./List", "./Record",
"requirejs-text/text!../cldr/config/availableLocales.json",
"requirejs-text/text!../cldr/supplemental/aliases.json",
"requirejs-text/text!../cldr/supplemental/localeAliases.json",
"requirejs-text/text!../cldr/supplemental/parentLocales.json",
"requirejs-text/text!../cldr/supplemental/likelySubtags.json",
"requirejs-text/text!../cldr/supplemental/calendarPreferenceData.json",
"text!cldr/config/availableLocales.json",
"text!cldr/supplemental/aliases.json",
"text!cldr/supplemental/localeAliases.json",
"text!cldr/supplemental/parentLocales.json",
"text!cldr/supplemental/likelySubtags.json",
"text!cldr/supplemental/calendarPreferenceData.json",
],
function (List, Record, availableLocalesJson, aliasesJson, localeAliasesJson,
parentLocalesJson, likelySubtagsJson, calendarPreferenceDataJson) {
Expand Down Expand Up @@ -724,4 +724,4 @@ define(["./List", "./Record",

common.availableLocalesList = common.CanonicalizeLocaleList(JSON.parse(availableLocalesJson).availableLocales);
return common;
});
});
4 changes: 2 additions & 2 deletions impl/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ define([
"./common",
"require",
"module",
"requirejs-text/text" // just so builder knows we will be using that module
"text" // just so builder knows we will be using that module
], function (calendars, common, require, module) {
return {
id: module.id,
Expand Down Expand Up @@ -38,7 +38,7 @@ define([
dependencies = jsonElements = [config._layerMid + "_" + locale];
} else {
dependencies = jsonElements.map(function (element) {
return "requirejs-text/text!../cldr/" + locale + "/" + element + ".json";
return "text!cldr/" + locale + "/" + element + ".json";
});
}

Expand Down
11 changes: 8 additions & 3 deletions samples/intl_sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>IBM ECMA-402 Demo</title>

<script src="../../requirejs/require.js"></script>
<script src="../bower_components/requirejs/require.js"></script>
<script>
require.config({
baseUrl: "../..",
baseUrl: "..",
config: {
"ecma402/locales": /^(ar-(TN|SA|EG)|en|es|he|hi|ja|th|de|zh-Hant|zh-TW)$/
},
paths: {
"ecma402": ".",
"requirejs-dplugins": "bower_components/requirejs-dplugins",
"text": "bower_components/requirejs-text/text"
}
});

Expand Down Expand Up @@ -86,4 +91,4 @@ <h3>Click a button to change the locale being formatted.</h3>
<button onclick='formatit("zh-TW-u-ca-roc")'>T-Chinese w/ ROC calendar</button>
<button onclick='formatit("fr")'>French (not preloaded)</button>
</body>
</html>
</html>
8 changes: 6 additions & 2 deletions tests/intern.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ define({
// loader
useLoader: {
"host-node": "requirejs",
"host-browser": "../../../requirejs/require.js"
"host-browser": "../../bower_components/requirejs/require.js"
},

// Configuration options for the module loader; any AMD configuration options supported by the specified AMD loader
// can be used here
loader: {
baseUrl: "..",
config : {
"ecma402/locales" : /^(ar|de(-CH)?|el|en(-(GB|NZ))?|es|fr|he|hi|id|ja|pt.*|sl|sr(-Latn)?|th|zh.*)$/
},
paths: {
"ecma402": ".",
"requirejs-dplugins": "bower_components/requirejs-dplugins",
"text": "bower_components/requirejs-text/text"
}
},

Expand Down