Fix dev locale

This commit is contained in:
Chocobozzz 2018-08-16 11:48:48 +02:00
parent 5d128505dc
commit c0ffdd0958
3 changed files with 4 additions and 3 deletions

View File

@ -71,7 +71,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {
useFactory: (locale) => { useFactory: (locale) => {
// On dev mode, test localization // On dev mode, test localization
if (isOnDevLocale()) { if (isOnDevLocale()) {
locale = getDevLocale() locale = buildFileLocale(getDevLocale())
return require(`raw-loader!../locale/target/angular_${locale}.xml`) return require(`raw-loader!../locale/target/angular_${locale}.xml`)
} }

View File

@ -5,7 +5,7 @@ function isOnDevLocale () {
} }
function getDevLocale () { function getDevLocale () {
return 'fr' return 'fr-FR'
} }
export { export {

View File

@ -6,6 +6,7 @@ import { environment } from './environments/environment'
import { hmrBootstrap } from './hmr' import { hmrBootstrap } from './hmr'
import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
import { buildFileLocale } from '../../shared'
let providers = [] let providers = []
if (environment.production) { if (environment.production) {
@ -14,7 +15,7 @@ if (environment.production) {
// Template translation, should be in the bootstrap step // Template translation, should be in the bootstrap step
if (isOnDevLocale()) { if (isOnDevLocale()) {
const locale = getDevLocale() const locale = buildFileLocale(getDevLocale())
const translations = require(`raw-loader!./locale/target/angular_${locale}.xml`) const translations = require(`raw-loader!./locale/target/angular_${locale}.xml`)
providers = [ providers = [