author | ymh <ymh.work@gmail.com> |
Mon, 06 Feb 2017 15:22:39 +0100 | |
changeset 500 | 4f507ba2bb4c |
parent 28 | b0b56e0f8c7f |
permissions | -rw-r--r-- |
28 | 1 |
export default { |
2 |
name: 'i18n', |
|
3 |
initialize: function( instance ) { |
|
4 |
instance.lookup('service:i18n').set('locale', calculateLocale()); |
|
5 |
} |
|
6 |
}; |
|
7 |
||
8 |
function calculateLocale() { |
|
9 |
// whatever you do to pick a locale for the user: |
|
10 |
return navigator.language || navigator.userLanguage || 'fr-FR'; |
|
11 |
} |