Comments (6)
@ericf I kind of like having them separate, otherwise the consumer will need to be cognizant of keeping the default locale at the tail of the locales array.
This is currently how its used in ember-intl.
// pseudo-code but it's pretty similar
getMessage: function (path) {
var locales = Ember.makeArray(this.locales); // in case the user just set a string
locales.push(this.defaultLocale); // in the actual implementation I don't push if locales contains the defaultLocale
for(var i=0;i<locales.length;i++) {
var locale = this.getLocaleObject(locales[i]);
var msg = locale.get(key);
if (typeof msg !== 'undefined') { return msg; }
}
}
from ember-intl.
This the way locales
is suppose to work as a fallback anyways, so I think it fits. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation
from ember-intl.
Ah, that makes sense. I'll remove it. Do you want me to update the other libs while I'm at it?
from ember-intl.
Ah, that makes sense. I'll remove it. Do you want me to update the other libs while I'm at it?
Let's discuss it first. That's why I cc'd @caridy
from ember-intl.
The result of the chat offline was to remove references to defaultLocale
and then remove it from the code base when we remove it from all the other integration libs.
from ember-intl.
#67 supersedes this
from ember-intl.
Related Issues (20)
- FORMAT_ERROR when using the `Intl.RelativeTimeFormat` polyfill with `v6.0.0` of ember-intl HOT 3
- Double `intl.d.ts` cause type errors HOT 8
- Unexpected locale `en-us` after upgrade to ember-intl v6 HOT 6
- A simple, autogenerated integration test fails for a component using a translation in ember-intl 6.1.2 HOT 6
- Bundle size regression in v6.2.0 HOT 3
- Merge this into formatjs HOT 3
- Incompatible with native `ember-source` types HOT 5
- `allowEmpty` class property not respected in v6.3.1 HOT 1
- Extending helpers like FormatDate has braking changes between v6.2.2 and v6.3.0+ HOT 5
- Basic usage results in: You attempted to update `_locale` [...] infinite revalidation bugs, and performance issues, and is not supported. HOT 4
- How to use `publicOnly: true` in Embroider apps HOT 10
- v6 - Error on valid use of `many`: message cannot be parsed: Unknown plural category: many HOT 1
- Deleted
- Plans for v7 release (draft)
- Memory leak regression after upgrading to `>= 6.3.0` HOT 3
- Do not blow up the whole page if a variable is missing ? HOT 2
- Vulnerability in dependency `glob-parent` via `broccoli-merge-files` HOT 10
- Create a docs-app that checks `wrapTranslationsWithNamespace: true`
- Create a docs-app that checks fetching translations HOT 1
- Create a docs-app that checks `publicOnly: true`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-intl.