-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from CaptainFact/staging
Release 0.7.9
- Loading branch information
Showing
25 changed files
with
216 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// TODO Declare translations directly in JS | ||
|
||
import achievements from '../../assets/assets/locales/en/achievements.json' | ||
import errors from '../../assets/assets/locales/en/errors.json' | ||
import help from '../../assets/assets/locales/en/help.json' | ||
import history from '../../assets/assets/locales/en/history.json' | ||
import home from '../../assets/assets/locales/en/home.json' | ||
import main from '../../assets/assets/locales/en/main.json' | ||
import user from '../../assets/assets/locales/en/user.json' | ||
import videoDebate from '../../assets/assets/locales/en/videoDebate.json' | ||
|
||
export default { | ||
achievements, | ||
errors, | ||
help, | ||
history, | ||
home, | ||
main, | ||
user, | ||
videoDebate | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// TODO Declare translations directly in JS | ||
|
||
import achievements from '../../assets/assets/locales/fr/achievements.json' | ||
import errors from '../../assets/assets/locales/fr/errors.json' | ||
import help from '../../assets/assets/locales/fr/help.json' | ||
import history from '../../assets/assets/locales/fr/history.json' | ||
import home from '../../assets/assets/locales/fr/home.json' | ||
import main from '../../assets/assets/locales/fr/main.json' | ||
import user from '../../assets/assets/locales/fr/user.json' | ||
import videoDebate from '../../assets/assets/locales/fr/videoDebate.json' | ||
|
||
export default { | ||
achievements, | ||
errors, | ||
help, | ||
history, | ||
home, | ||
main, | ||
user, | ||
videoDebate | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import i18n from 'i18next' | ||
import titleCase from 'voca/title_case' | ||
|
||
import dateLocaleFR from 'date-fns/locale/fr' | ||
import datelocaleEN from 'date-fns/locale/en' | ||
import fr from './fr' | ||
import en from './en' | ||
import store from '../state/index' | ||
import { fetchLocale } from '../state/user_preferences/effects' | ||
import { JS_ENV } from '../config.jsenv' | ||
|
||
|
||
// Add default formats for dates | ||
dateLocaleFR.defaultDateTimeFormat = "[Le] D MMM YYYY [à] H:mm" | ||
dateLocaleFR.defaultDateFormat = "[Le] D MMM YYYY" | ||
datelocaleEN.defaultDateTimeFormat = "D MMM YYYY [at] H:mm" | ||
datelocaleEN.defaultDateFormat = "D MMM YYYY" | ||
|
||
export const locales = {fr: dateLocaleFR, en: datelocaleEN} | ||
|
||
// Configure I18N | ||
i18n | ||
.init({ | ||
fallbackLng: 'en', | ||
resources: {fr, en}, | ||
lng: store.getState().UserPreferences.locale, | ||
defaultNS: 'main', | ||
joinArrays: '\n', | ||
debug: JS_ENV !== 'prod', | ||
react: { | ||
wait: true | ||
}, | ||
interpolation: { | ||
escapeValue: false, // Not needed for react | ||
formatSeparator: ',', | ||
format: function(value, format, lng) { | ||
if (format === 'lowerCase') return value.toLowerCase(); | ||
if (format === 'upperCase') return value.toUpperCase(); | ||
if (format === 'titleCase') return titleCase(value); | ||
if (format === 'unSnake') return value.replace('_', ' '); | ||
return value; | ||
} | ||
} | ||
}); | ||
|
||
i18n.on('languageChanged', language => store.dispatch(fetchLocale(language))) | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.