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

Support Bangla Language #102

Merged
merged 9 commits into from
May 3, 2021
Merged

Support Bangla Language #102

merged 9 commits into from
May 3, 2021

Conversation

yeahia2508
Copy link
Contributor

No description provided.

@jama5262 jama5262 changed the base branch from master to develop March 18, 2021 05:44
Comment on lines 448 to 466
test(
'test Jiffy.locale() method with parsing bn locale should return correct date time in bn locale',
() async {
var locale = await Jiffy.locale('bn');
expect(jiffy1.fromNow(), 'কিছু মুহূর্ত আগে');
expect(jiffy2.fromNow(), 'কিছু মুহূর্ত পরে');
expect(jiffy3.fromNow(), 'এক মিনিট আগে');
expect(jiffy5.fromNow(), '১০ মিনিট আগে');
expect(jiffy6.fromNow(), 'এক ঘন্টা আগে');
expect(jiffy7.fromNow(), '১০ ঘণ্টা আগে');
expect(jiffy8.fromNow(), 'এক দিন আগে');
expect(jiffy9.fromNow(), '১০ দিন আগে');
expect(jiffy10.from(Jiffy('2019-10-01')), 'এক মাস আগে');
expect(jiffy11.fromNow(), '১০ মাস আগে');
expect(jiffy12.fromNow(), 'এক বছর আগে');
expect(jiffy13.fromNow(), '১০ বছর আগে');
expect(locale.startOfWeek(), StartOfWeek.SUNDAY);
expect(locale.ordinals(), null);
});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this test in its group, not outside

@override
String aboutAMinute(int minutes) => 'এক মিনিট';
@override
String minutes(int minutes) => '$minutes মিনিট';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you've added bn locale to the lib/src/utils/replace.dart file to replace all number characters but was never used. Please see the suggested edit example

Suggested change
String minutes(int minutes) => '$minutes মিনিট';
String minutes(int minutes) => replaceToLocaleNum('$minutes মিনিট', 'bn');

Copy link
Owner

@jama5262 jama5262 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure you've formatted your code so that the tests could pass, try running this command

flutter format lib test

expect(jiffy7.fromNow(), '১০ ঘন্টা আগে');
expect(jiffy8.fromNow(), 'এক দিন আগে');
expect(jiffy9.fromNow(), '১০ দিন আগে');
expect(jiffy10.from(Jiffy('2019-10-01')), 'এক মাস আগে');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(jiffy10.from(Jiffy('2019-10-01')), 'এক মাস আগে');
expect(jiffy10.from(Jiffy('2019-10-01', 'yyyy-MM-dd')), 'এক মাস আগে');
// or
expect(jiffy10.from(Jiffy([2019, 10, 1])), 'এক মাস আগে');

Copy link
Owner

@jama5262 jama5262 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix, and get merged

  1. Please fetch the new changes from develop branch, new nl local has been added
  2. Remember to format your code after every commit so that the tests pass,

Format jiffy_relative_locale_test.dart file

@codecov-commenter
Copy link

codecov-commenter commented May 3, 2021

Codecov Report

Merging #102 (bdd7bc1) into develop (bb9e959) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #102      +/-   ##
===========================================
+ Coverage    93.44%   93.59%   +0.14%     
===========================================
  Files           31       32       +1     
  Lines         1266     1295      +29     
===========================================
+ Hits          1183     1212      +29     
  Misses          83       83              
Impacted Files Coverage Δ
lib/src/locale/availableLocales.dart 98.21% <100.00%> (+0.03%) ⬆️
lib/src/locale/bnLocale.dart 100.00% <100.00%> (ø)
lib/src/utils/replace.dart 91.66% <100.00%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb9e959...bdd7bc1. Read the comment docs.

@jama5262 jama5262 merged commit 15c334d into jama5262:develop May 3, 2021
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