Permalink
Browse files

four spaces to two spaces

  • Loading branch information...
1 parent 0a6efc9 commit afbb0efdf3a1dd7d813a51e40092d90fbc69eac7 @jasonmit committed Aug 30, 2015
Showing with 1,555 additions and 1,553 deletions.
  1. +5 −5 .editorconfig
  2. +27 −27 addon/adapters/-intl-adapter.js
  3. +51 −51 addon/formatters/-base.js
  4. +27 −27 addon/formatters/format-date.js
  5. +15 −15 addon/formatters/format-html-message.js
  6. +10 −10 addon/formatters/format-message.js
  7. +15 −15 addon/formatters/format-number.js
  8. +16 −16 addon/formatters/format-relative.js
  9. +1 −1 addon/formatters/format-time.js
  10. +67 −67 addon/helpers/-base-legacy.js
  11. +4 −4 addon/helpers/-base.js
  12. +5 −5 addon/helpers/format-date.js
  13. +6 −6 addon/helpers/format-message.js
  14. +3 −3 addon/helpers/format-relative.js
  15. +43 −43 addon/helpers/intl-get-legacy.js
  16. +4 −4 addon/helpers/intl-get.js
  17. +3 −3 addon/models/locale.js
  18. +32 −32 addon/models/translation.js
  19. +113 −113 addon/services/intl.js
  20. +2 −2 addon/utils/add-locale-data.js
  21. +8 −8 addon/utils/array-to-hash.js
  22. +4 −4 addon/utils/register-helper.js
  23. +17 −17 addon/utils/streams.js
  24. +15 −15 app/initializers/ember-intl-legacy.js
  25. +3 −3 app/initializers/ember-intl.js
  26. +14 −14 app/instance-initializers/ember-intl.js
  27. +8 −8 blueprints/ember-intl/index.js
  28. +15 −15 blueprints/translation/index.js
  29. +11 −11 ember-cli-build.js
  30. +127 −127 index.js
  31. +35 −35 lib/broccoli/cldr-writer.js
  32. +3 −3 lib/broccoli/lowercase-tree.js
  33. +5 −5 lib/broccoli/merge-trees.js
  34. +84 −84 lib/broccoli/translation-preprocessor.js
  35. +1 −1 lib/utils/assign.js
  36. +4 −4 lib/utils/index.js
  37. +3 −3 lib/utils/is-modern.js
  38. +7 −7 lib/utils/make-array.js
  39. +10 −10 lib/utils/unique-by-string.js
  40. +29 −29 tests/acceptance/smoke-test.js
  41. +3 −3 tests/dummy/app/app.js
  42. +6 −6 tests/dummy/app/controllers/application.js
  43. +24 −24 tests/dummy/app/controllers/index.js
  44. +8 −8 tests/dummy/app/controllers/smoke.js
  45. +17 −17 tests/dummy/app/formats.js
  46. +2 −2 tests/dummy/app/router.js
  47. +4 −4 tests/dummy/app/routes/application.js
  48. +39 −39 tests/dummy/config/environment.js
  49. +16 −16 tests/helpers/create-intl-block.js
  50. +6 −6 tests/helpers/run-append.js
  51. +9 −9 tests/helpers/start-app.js
  52. +4 −4 tests/helpers/test.js
  53. +54 −54 tests/unit/format-date-test.js
  54. +52 −50 tests/unit/format-html-message-test.js
  55. +176 −176 tests/unit/format-message-test.js
  56. +129 −129 tests/unit/format-number-test.js
  57. +58 −58 tests/unit/format-relative-test.js
  58. +54 −54 tests/unit/format-time-test.js
  59. +42 −42 tests/unit/intl-get-test.js
View
@@ -11,23 +11,23 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
-indent_size = 4
+indent_size = 2
[*.js]
indent_style = space
-indent_size = 4
+indent_size = 2
[*.hbs]
indent_style = space
-indent_size = 4
+indent_size = 2
[*.css]
indent_style = space
-indent_size = 4
+indent_size = 2
[*.html]
indent_style = space
-indent_size = 4
+indent_size = 2
[*.md]
trim_trailing_whitespace = false
@@ -9,39 +9,39 @@ import Translation from '../models/translation';
const { assert, makeArray } = Ember;
function normalize (fullName) {
- assert('Lookup name must be a string', typeof fullName === 'string');
- return fullName.toLocaleLowerCase();
+ assert('Lookup name must be a string', typeof fullName === 'string');
+ return fullName.toLocaleLowerCase();
}
const DefaultIntlAdapter = Ember.Object.extend({
- translationsFor(localeName) {
- if (localeName && localeName instanceof Translation) {
- return localeName;
- }
+ translationsFor(localeName) {
+ if (localeName && localeName instanceof Translation) {
+ return localeName;
+ }
- if (typeof localeName === 'string') {
- return this.container.lookup('ember-intl@translation:' + normalize(localeName));
- }
- },
-
- findTranslationByKey(localeNames, translationKey) {
- const locales = makeArray(localeNames);
- const len = locales.length;
-
- let i = 0;
- let translations, translation, key;
-
- for (; i < len; i++) {
- key = locales[i];
- translations = this.translationsFor(key);
- if (translations) {
- translation = translations.getValue(translationKey);
- if (translation) {
- return translation;
- }
- }
+ if (typeof localeName === 'string') {
+ return this.container.lookup('ember-intl@translation:' + normalize(localeName));
+ }
+ },
+
+ findTranslationByKey(localeNames, translationKey) {
+ const locales = makeArray(localeNames);
+ const len = locales.length;
+
+ let i = 0;
+ let translations, translation, key;
+
+ for (; i < len; i++) {
+ key = locales[i];
+ translations = this.translationsFor(key);
+ if (translations) {
+ translation = translations.getValue(translationKey);
+ if (translation) {
+ return translation;
}
+ }
}
+ }
});
export default DefaultIntlAdapter;
@@ -7,71 +7,71 @@ import Ember from 'ember';
import arrayToHash from '../utils/array-to-hash';
const {
- get,
- String:emberString,
- Object:EmberObject
+ get,
+ String:emberString,
+ Object:EmberObject
} = Ember;
const { camelize } = emberString;
const FormatBase = EmberObject.extend({
- init() {
- this._super(...arguments);
- this.options = arrayToHash(this.constructor.supportedOptions);
- },
+ init(...args) {
+ this._super(...args);
+ this.options = arrayToHash(this.constructor.supportedOptions);
+ },
- /**
- * Filters out all of the whitelisted formatter options
- *
- * @method filterSupporedOptions
- * @param {Object} Options object
- * @return {Object} Options object containing just whitelisted options
- * @private
- */
- filterSupporedOptions(input = {}) {
- let camelizedKey;
- let foundMatch = false;
- let out = {};
+ /**
+ * Filters out all of the whitelisted formatter options
+ *
+ * @method filterSupporedOptions
+ * @param {Object} Options object
+ * @return {Object} Options object containing just whitelisted options
+ * @private
+ */
+ filterSupporedOptions(input = {}) {
+ let camelizedKey;
+ let foundMatch = false;
+ let out = {};
- for (let key in input) {
- camelizedKey = camelize(key);
- if (this.options[camelizedKey]) {
- foundMatch = true;
- out[camelizedKey] = input[key];
- }
- }
-
- if (foundMatch) {
- return out;
- }
- },
+ for (let key in input) {
+ camelizedKey = camelize(key);
+ if (this.options[camelizedKey]) {
+ foundMatch = true;
+ out[camelizedKey] = input[key];
+ }
+ }
- /**
- * Invokes the Intl formatter methods
- *
- * @method _format
- * @param {value} Raw input value that needs formatting
- * @return {Object} Formatter options hash
- * @return {Object} Format options hash
- * @private
- */
- _format(value, formatterOptions = {}, formatOptions = {}) {
- const formatter = get(this, 'formatter');
- const { locale } = formatterOptions;
+ if (foundMatch) {
+ return out;
+ }
+ },
- if (!locale) {
- throw new Error(
- `No locale specified. This is typically done application-wide within routes/application.js. Instructions: https://github.com/yahoo/ember-intl/blob/master/README.md#configure-application-wide-locale`
- );
- }
+ /**
+ * Invokes the Intl formatter methods
+ *
+ * @method _format
+ * @param {value} Raw input value that needs formatting
+ * @return {Object} Formatter options hash
+ * @return {Object} Format options hash
+ * @private
+ */
+ _format(value, formatterOptions = {}, formatOptions = {}) {
+ const formatter = get(this, 'formatter');
+ const { locale } = formatterOptions;
- return formatter(locale, formatterOptions).format(value, formatOptions);
+ if (!locale) {
+ throw new Error(
+ `No locale specified. This is typically done application-wide within routes/application.js. Instructions: https://github.com/yahoo/ember-intl/blob/master/README.md#configure-application-wide-locale`
+ );
}
+
+ return formatter(locale, formatterOptions).format(value, formatOptions);
+ }
});
FormatBase.reopenClass({
- supportedOptions: ['locale', 'format'],
- concatenatedProperties: ['supportedOptions']
+ supportedOptions: ['locale', 'format'],
+ concatenatedProperties: ['supportedOptions']
});
export default FormatBase;
@@ -11,40 +11,40 @@ import Formatter from './-base';
const { assert } = Ember;
function assertIsDate (date, errMsg) {
- assert(errMsg, isFinite(date));
+ assert(errMsg, isFinite(date));
}
const FormatDate = Formatter.extend({
- formatType: 'date',
-
- formatter: computed({
- get() {
- return createFormatCache(Intl.DateTimeFormat);
- }
- }),
-
- format(value, options) {
- // reading a stream where the value is null returns
- // undefined. so, we need to work around this by setting it
- // to null. this condition below can go away once we drop < 1.13 support
- if (typeof value === 'undefined') {
- value = null;
- }
-
- let dateTime = new Date(value);
- assertIsDate(dateTime, 'A date or timestamp must be provided to format-date');
- let formatOptions = this.filterSupporedOptions(options);
-
- return this._format(dateTime, formatOptions);
+ formatType: 'date',
+
+ formatter: computed({
+ get() {
+ return createFormatCache(Intl.DateTimeFormat);
+ }
+ }),
+
+ format(value, options) {
+ // reading a stream where the value is null returns
+ // undefined. so, we need to work around this by setting it
+ // to null. this condition below can go away once we drop < 1.13 support
+ if (typeof value === 'undefined') {
+ value = null;
}
+
+ let dateTime = new Date(value);
+ assertIsDate(dateTime, 'A date or timestamp must be provided to format-date');
+ let formatOptions = this.filterSupporedOptions(options);
+
+ return this._format(dateTime, formatOptions);
+ }
});
FormatDate.reopenClass({
- supportedOptions: [
- 'localeMatcher', 'timeZone', 'hour12', 'formatMatcher', 'weekday',
- 'era', 'year', 'month', 'day', 'hour', 'minute', 'second',
- 'timeZoneName'
- ]
+ supportedOptions: [
+ 'localeMatcher', 'timeZone', 'hour12', 'formatMatcher', 'weekday',
+ 'era', 'year', 'month', 'day', 'hour', 'minute', 'second',
+ 'timeZoneName'
+ ]
});
export default FormatDate;
@@ -9,24 +9,24 @@ import FormatterMessage from './format-message';
const { String:emberString, Handlebars:emberHandlebars } = Ember;
const FormatHtmlMessage = FormatterMessage.extend({
- escapeProps(options = {}) {
- return Object.keys(options).reduce((result, hashKey) => {
- let value = options[hashKey];
+ escapeProps(options = {}) {
+ return Object.keys(options).reduce((result, hashKey) => {
+ let value = options[hashKey];
- if (typeof value === 'string') {
- value = emberHandlebars.Utils.escapeExpression(value);
- }
+ if (typeof value === 'string') {
+ value = emberHandlebars.Utils.escapeExpression(value);
+ }
- result[hashKey] = value;
- return result;
- }, {});
- },
+ result[hashKey] = value;
+ return result;
+ }, {});
+ },
- format(value, formatOptions = {}) {
- const options = this.escapeProps(formatOptions);
- const superResult = this._super(value, options, formatOptions.locale);
- return emberString.htmlSafe(superResult);
- }
+ format(value, formatOptions = {}) {
+ const options = this.escapeProps(formatOptions);
+ const superResult = this._super(value, options, formatOptions.locale);
+ return emberString.htmlSafe(superResult);
+ }
});
export default FormatHtmlMessage;
@@ -12,17 +12,17 @@ import Formatter from './-base';
const { get } = Ember;
const FormatMessage = Formatter.extend({
- formatter: computed({
- get() {
- return createFormatCache(IntlMessageFormat);
- }
- }),
-
- format(value, options, formats) {
- const { locale } = options;
- const formatter = get(this, 'formatter');
- return formatter(value, locale, formats).format(options);
+ formatter: computed({
+ get() {
+ return createFormatCache(IntlMessageFormat);
}
+ }),
+
+ format(value, options, formats) {
+ const { locale } = options;
+ const formatter = get(this, 'formatter');
+ return formatter(value, locale, formats).format(options);
+ }
});
export default FormatMessage;
@@ -8,26 +8,26 @@ import computed from 'ember-new-computed';
import Formatter from './-base';
const FormatNumber = Formatter.extend({
- formatType: 'number',
+ formatType: 'number',
- formatter: computed({
- get() {
- return createFormatCache(Intl.NumberFormat);
- }
- }),
-
- format(value, options) {
- return this._format(value, this.filterSupporedOptions(options));
+ formatter: computed({
+ get() {
+ return createFormatCache(Intl.NumberFormat);
}
+ }),
+
+ format(value, options) {
+ return this._format(value, this.filterSupporedOptions(options));
+ }
});
FormatNumber.reopenClass({
- supportedOptions: [
- 'localeMatcher', 'style', 'currency', 'currencyDisplay',
- 'useGrouping', 'minimumIntegerDigits', 'minimumFractionDigits',
- 'maximumFractionDigits', 'minimumSignificantDigits',
- 'maximumSignificantDigits'
- ]
+ supportedOptions: [
+ 'localeMatcher', 'style', 'currency', 'currencyDisplay',
+ 'useGrouping', 'minimumIntegerDigits', 'minimumFractionDigits',
+ 'maximumFractionDigits', 'minimumSignificantDigits',
+ 'maximumSignificantDigits'
+ ]
});
export default FormatNumber;
Oops, something went wrong.

0 comments on commit afbb0ef

Please sign in to comment.