server/bo_client/app/instance-initializers/i18n.js
author Chloe Laisne <chloe.laisne@gmail.com>
Fri, 14 Oct 2016 19:53:56 +0200
changeset 334 cffb9b124af3
parent 28 b0b56e0f8c7f
permissions -rw-r--r--
Remove play transcript button if sentence playing

export default {
  name: 'i18n',
  initialize: function( instance ) {
    instance.lookup('service:i18n').set('locale', calculateLocale());
  }
};

function calculateLocale() {
  // whatever you do to pick a locale for the user:
  return navigator.language || navigator.userLanguage || 'fr-FR';
}