Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
[Fix] Better locales support
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Oct 18, 2017
1 parent 9fb1c0f commit af63f16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion locales/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export default {
en,
ru,
es,
pt_br,
'pt-BR': pt_br,
sk
};
4 changes: 2 additions & 2 deletions utils/i18n.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @flow

import DeviceInfo from 'react-native-device-info';
import { getDeviceLocale } from 'react-native-device-info';
import I18n from 'i18n-js';

import locales from 'locales';

I18n.fallbacks = true;
I18n.locale = DeviceInfo.getDeviceLocale().split('-')[0];
I18n.locale = getDeviceLocale();
I18n.translations = locales;

I18n.pluralization['ru'] = function (count) {
Expand Down
2 changes: 1 addition & 1 deletion utils/moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import moment from 'moment';

import 'moment/min/locales';

moment.locale(getDeviceLocale().split('-')[0]);
moment.locale(getDeviceLocale());

export default moment;

0 comments on commit af63f16

Please sign in to comment.