Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Belarusian localization #34

Merged
merged 6 commits into from
Sep 13, 2016
Merged

Add Belarusian localization #34

merged 6 commits into from
Sep 13, 2016

Conversation

ilyankou
Copy link
Contributor

@ilyankou ilyankou commented Sep 13, 2016

#19

@hustcc
Copy link
Owner

hustcc commented Sep 13, 2016

Thank you for your work, because of the complex of be locale, so add some testcase into tests/test.js will be perfact. like this:

// 1. Test be locale
  // test second
  t.equal(timeago('2016-06-23 12:12:12').format('2016-06-23 12:12:09'), 'just now');
  // test second
  t.equal(timeago('2016-06-23 12:12:12').format('2016-06-23 12:12:01'), '11 seconds ago');

  // test minute
  t.equal(timeago('2016-06-23 12:11:12').format('2016-06-23 12:10:01'), '1 minute ago');
  t.equal(timeago('2016-06-23 12:12:12').format('2016-06-23 12:09:01'), '3 minutes ago');

  // test hour
  t.equal(timeago('2016-06-23 13:12:12').format('2016-06-23 12:10:01'), '1 hour ago');
  t.equal(timeago('2016-06-23 15:08:12').format('2016-06-23 12:09:01'), '2 hours ago');

  // test day
  t.equal(timeago('2016-06-24 13:12:12').format('2016-06-23 12:10:01'), '1 day ago');
  t.equal(timeago('2016-06-25 15:08:12').format('2016-06-23 12:09:01'), '2 days ago');

  // test week
  t.equal(timeago('2016-06-30 13:12:12').format('2016-06-23 12:10:01'), '1 week ago');
  t.equal(timeago('2016-07-18 15:08:12').format('2016-06-23 12:09:01'), '3 weeks ago');

  // test month
  t.equal(timeago('2016-07-25 13:12:12').format('2016-06-23 12:10:01'), '1 month ago');
  t.equal(timeago('2016-08-23 15:08:12').format('2016-06-23 12:09:01'), '2 months ago');

  // test year
  t.equal(timeago('2017-06-23 13:12:12').format('2016-06-23 12:10:01'), '1 year ago');
  t.equal(timeago('2020-06-23 15:08:12').format('2016-06-23 12:09:01'), '4 years ago');

  // end be locale test ---------------------------------------------------------

just translate en to be, and append into tests/test.js will be ok.

After do that, I will process this pr, thank you very much~

@likerRr
Copy link
Collaborator

likerRr commented Sep 13, 2016

@ilyankou take a look at #35

@likerRr
Copy link
Collaborator

likerRr commented Sep 13, 2016

@ilyankou sorry, but your test don't cover all possible cases (e.g. "5 хвiлiн таму"). Please, update them. And I think it would be better to keep them separately because it's gonna be mess when all the test are in one file. @hustcc , what do you think?

@hustcc
Copy link
Owner

hustcc commented Sep 13, 2016

@likerRr keep them separately will be more tidy. Very nice work^_^~

I will rewrite en and zh_CN into separated test files.

@hustcc
Copy link
Owner

hustcc commented Sep 13, 2016

@likerRr I push a commit 8e30c74, separate en and zh_CN into another file.

And in tests/test.js, read locale name from tests/locales, and require the testcase.

Thank you very much~

@hustcc hustcc merged commit 5e8887e into hustcc:master Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants