2015-06-14 10:47:18 +00:00
|
|
|
//
|
|
|
|
// RNI18n.m
|
|
|
|
// RNI18n
|
|
|
|
//
|
|
|
|
// Created by Alexander Zaytsev on 14/06/15.
|
|
|
|
// Copyright (c) 2015 Alexander Zaytsev. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "RNI18n.h"
|
2015-06-14 11:01:41 +00:00
|
|
|
|
2015-06-14 12:14:02 +00:00
|
|
|
@interface RNI18n ()
|
|
|
|
-(NSString*) getCurrentLocale;
|
|
|
|
@end
|
2015-06-14 10:47:18 +00:00
|
|
|
|
|
|
|
@implementation RNI18n
|
|
|
|
RCT_EXPORT_MODULE();
|
|
|
|
|
|
|
|
-(NSString*) getCurrentLocale{
|
2016-08-07 09:43:10 +00:00
|
|
|
NSString *localeString=[[NSLocale preferredLanguages] objectAtIndex:0];
|
2015-06-14 10:47:18 +00:00
|
|
|
return localeString;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSDictionary *)constantsToExport
|
|
|
|
{
|
|
|
|
return @{ @"locale": [self getCurrentLocale] };
|
|
|
|
}
|
|
|
|
@end
|