Last active
November 10, 2016 19:28
-
-
Save derzunov/e8eb5aa8d8240f19796ab874a7c5bb08 to your computer and use it in GitHub Desktop.
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
// Full example code see here - https://github.com/derzunov/redux-react-i18n/tree/master/example | |
import { i18nActions, i18nReducer, Loc } from 'redux-react-i18n'; | |
//... | |
// Code Code Code ... | |
//... | |
store.dispatch( i18nActions.setLanguages( | |
[ | |
{ | |
code: 'ru-RU', | |
name: 'Русский' | |
}, | |
{ | |
code: 'pl', | |
name: 'Polish' | |
} | |
] | |
) ); | |
store.dispatch( i18nActions.setDictionaries( | |
{ | |
'ru-RU': | |
{ | |
'key_1': 'Первый дефолтный ключ из установленного нами словаря', | |
'key_2': [ [ "Остался", "Осталось", "Осталось" ], " ", "$count", " ", [ "час", "часа", "часов" ] ], | |
'key_3': 'Просто число после двоеточия: $Count' | |
}, | |
'pl': | |
{ | |
'key_1': 'Prosze, dwa bilety drugiej klasy do Warszawy.', | |
'key_2': [[ "Pozostała", "Pozostały", "Pozostało" ], " ", "$count", " ", [ "godzina", "godziny", "godzin" ] ], | |
'key_3': 'Numer: $Count' | |
} | |
} | |
) ); | |
store.dispatch( i18nActions.setCurrent( 'ru-RU' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment