|
|
|
|
@ -1,10 +1,13 @@ |
|
|
|
|
import isNull from 'lodash/isNull' |
|
|
|
|
|
|
|
|
|
import { history } from 'config/history' |
|
|
|
|
import { client } from 'config/clients' |
|
|
|
|
|
|
|
|
|
const KEY = 'lang' |
|
|
|
|
|
|
|
|
|
export const getLanguageUrlParam = () => { |
|
|
|
|
const lang = new URLSearchParams(history.location.search).get(KEY) |
|
|
|
|
return lang || undefined |
|
|
|
|
return (lang !== 'null' && !isNull(lang)) ? lang : client.defaultLanguage |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const addLanguageUrlParam = (lang: string, url: string) => { |
|
|
|
|
|