<commit_before>import { connect } from 'react-redux'

import { getLang } from '../selectors/locales'
import { getUrlName } from '../routeTable'

import * as locales from '../locales'

import LanguagePicker from '../components/LanguagePicker'

const mapStateToProps = state => ({
  pathName: typeof window === 'undefined' || !window ? 'home' : getUrlName(getLang(state), window.location.pathname) || 'home',
  availableLangs: Object.keys(locales),
  selectedLang: getLang(state)
})

export default connect(mapStateToProps)(LanguagePicker)<commit_msg>Resolve language picker from URL on ssr<commit_after>import { connect } from 'react-redux'

import { getLang } from '../selectors/locales'
import { getUrlName } from '../routeTable'

import * as locales from '../locales'

import LanguagePicker from '../components/LanguagePicker'

const mapStateToProps = (state) => ({
  pathName: (typeof window === 'undefined' || !window
    ? getUrlName(getLang(state), state.server.entryPath)
    : getUrlName(getLang(state), window.location.pathname)) || 'home',
  availableLangs: Object.keys(locales),
  selectedLang: getLang(state)
})

export default connect(mapStateToProps)(LanguagePicker)
{'fraction_non_alphanumeric': 0.14152542372881355, 'fraction_numerical': 0.0, 'mean_word_length': 5.349462365591398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4420083', 'n_tokens_mistral': 347, 'n_tokens_neox': 346, 'n_words': 86}