Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(server/i18n): add flow types (i18nConfigObject)
Browse files Browse the repository at this point in the history
feat(server/i18n): add flow types
  • Loading branch information
Metnew committed Sep 17, 2017
1 parent e203edf commit 3904e56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/i18n/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// @flow
import {readFileSync} from 'fs' // readFile
import path from 'path'
import {sync as globSync} from 'glob'
// import {addLocaleData} from 'react-intl'
import enLocaleData from 'react-intl/locale-data/en'
import ruLocaleData from 'react-intl/locale-data/ru'
import type {i18nConfigObject} from 'types'

const translations = globSync('locals/*.json')
.map(filename => [
.map((filename: string) => [
path.basename(filename, '.json'),
readFileSync(filename, 'utf8')
])
Expand All @@ -24,7 +26,7 @@ const summaryLocaleData = {
export const defaultLanguage = 'en'
export const supportedLanguages = ['en', 'ru']

export default lang => {
export default (lang: string): i18nConfigObject => {
console.log(lang)
return {
lang,
Expand Down

0 comments on commit 3904e56

Please sign in to comment.