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

Pluralization dont work because wrong RU locale code #93

Open
wiistriker opened this issue Dec 1, 2015 · 1 comment
Open

Pluralization dont work because wrong RU locale code #93

wiistriker opened this issue Dec 1, 2015 · 1 comment

Comments

@wiistriker
Copy link

https://github.com/kevinlawler/NSDate-TimeAgo/blob/master/NSDate%2BTimeAgo.m#L366
but locale code is "ru-RU"

What is a good way to check locale? Starts with "ru" or simple:

if([localeCode isEqual:@"ru"] || [localeCode isEqualToString:@"ru-RU"]) {

?

@wiistriker wiistriker changed the title Pluralization dont work because wrong locale code Pluralization dont work because wrong RU locale code Dec 1, 2015
@mixdesign
Copy link
Contributor

I think you are right.
SO answer has interesting comment related to this issue:
http://stackoverflow.com/questions/3910244/getting-current-device-language-in-ios#comment19209319_4221416

Comment advices to do:

 NSString * localeCode = [[[NSLocale preferredLanguages] objectAtIndex:0] substringToIndex:2]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants