server/bo_client/app/instance-initializers/i18n.js
author ymh <ymh.work@gmail.com>
Mon, 03 Oct 2016 16:32:41 +0200
changeset 318 5564f5065f81
parent 28 b0b56e0f8c7f
permissions -rw-r--r--
add a root url for corpus back apis. it is set to the same than root api for the moment

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';
}