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

Commit

Permalink
fixed Russian-specific localization rules;
Browse files Browse the repository at this point in the history
fixed and finished Russian localization strings
  • Loading branch information
Vlas Voloshin committed Oct 2, 2013
1 parent 9426949 commit 5c3a5c9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 40 deletions.
10 changes: 4 additions & 6 deletions NSDate+TimeAgo.m
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,12 @@ -(NSString *)getLocaleFormatUnderscoresWithValue:(double)value

// Russian (ru)
if([localeCode isEqual:@"ru"]) {
NSString *valueStr = [NSString stringWithFormat:@"%.f", value];
int l = valueStr.length;
int XY = [[valueStr substringWithRange:NSMakeRange(l - 2, l)] intValue];
int XY = (int)floor(value) % 100;
int Y = (int)floor(value) % 10;

if(Y == 0 || Y > 4 || XY == 11) return @"";
if(Y != 1 && Y < 5) return @"_";
if(Y == 1) return @"__";
if(Y == 0 || Y > 4 || (XY > 10 && XY < 15)) return @"";
if(Y > 1 && Y < 5 && (XY < 10 || XY > 20)) return @"_";
if(Y == 1 && XY != 11) return @"__";
}

// Add more languages here, which are have specific translation rules...
Expand Down
68 changes: 34 additions & 34 deletions NSDateTimeAgo.bundle/ru.lproj/NSDateTimeAgo.strings
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,73 @@
Assume value for (seconds, hours, minutes, days, weeks, months or years) is XXXY, Y is last digit, XY is last two digits;
*/

/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d days ago" = "%d дней назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _days ago" = "%d дня назад";

/* If Y == 1; */
/* Y == 1 AND XY != 11; */
"%d __days ago" = "%d день назад";


/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d hours ago" = "%d часов назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _hours ago" = "%d часа назад";

/* If Y == 1; */
/* Y == 1 AND XY != 11; */
"%d __hours ago" = "%d час назад";


/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d minutes ago" = "%d минут назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _minutes ago" = "%d минуты назад";

/* If Y == 1; */
/* Y == 1 AND XY != 11; */
"%d __minutes ago" = "%d минуту назад";


/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d months ago" = "%d месяцев назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _months ago" = "%d месяца назад";

/* If Y == 1; */
/* Y == 1 AND XY != 11; */
"%d __months ago" = "%d месяц назад";


/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d seconds ago" = "%d секунд назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _seconds ago" = "%d секунды назад";

/* If Y == 1; */
"%d __seconds ago" = "%d секунда назад";
/* Y == 1 AND XY != 11; */
"%d __seconds ago" = "%d секунду назад";


/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d weeks ago" = "%d недель назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _weeks ago" = "%d недели назад";

/* If Y == 1; */
"%d __weeks ago" = "%d неделя назад";
/* Y == 1 AND XY != 11; */
"%d __weeks ago" = "%d неделю назад";


/* Y ==0 OR Y > 4 OR XY == 11; */
/* Y == 0 OR Y > 4 OR (XY > 10 AND XY < 15); */
"%d years ago" = "%d лет назад";

/* If Y != 1 AND Y < 5; */
/* Y > 1 AND Y < 5 AND (XY < 10 OR XY > 20); */
"%d _years ago" = "%d года назад";

/* If Y == 1; */
/* Y == 1 AND XY != 11; */
"%d __years ago" = "%d год назад";


Expand All @@ -80,7 +80,7 @@
"An hour ago" = "Час назад";

/* No comment provided by engineer. */
"Just now" = "Сейчас";
"Just now" = "Только что";

/* No comment provided by engineer. */
"Last month" = "Месяц назад";
Expand All @@ -95,31 +95,31 @@
"Yesterday" = "Вчера";

/* No comment provided by engineer. */
"1 year ago" = "1 year ago";
"1 year ago" = "1 год назад";

/* No comment provided by engineer. */
"1 month ago" = "1 month ago";
"1 month ago" = "1 месяц назад";

/* No comment provided by engineer. */
"1 week ago" = "1 week ago";
"1 week ago" = "1 неделю назад";

/* No comment provided by engineer. */
"1 day ago" = "1 day ago";
"1 day ago" = "1 день назад";

/* No comment provided by engineer. */
"This morning" = "This morning";
"This morning" = "Этим утром";

/* No comment provided by engineer. */
"This afternoon" = "This afternoon";
"This afternoon" = "Этим днём";

/* No comment provided by engineer. */
"Today" = "Today";
"Today" = "Сегодня";

/* No comment provided by engineer. */
"This week" = "This week";
"This week" = "На этой неделе";

/* No comment provided by engineer. */
"This month" = "This month";
"This month" = "В этом месяце";

/* No comment provided by engineer. */
"This year" = "This year";
"This year" = "В этом году";

0 comments on commit 5c3a5c9

Please sign in to comment.