author | ymh <ymh.work@gmail.com> |
Thu, 06 Apr 2017 11:29:14 +0200 | |
changeset 530 | a76bae4795d5 |
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 |
} |