-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from silviuilas/master
add romanian language
- Loading branch information
Showing
5 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import '../messages.dart'; | ||
|
||
/// Romanian messages | ||
class RomanianMessages implements Messages { | ||
@override | ||
String prefixAgo() => 'acum'; | ||
|
||
@override | ||
String suffixAgo() => ''; | ||
|
||
@override | ||
String secsAgo(int seconds) { | ||
if (seconds == 1) { | ||
return 'o secundă'; | ||
} | ||
return '$seconds secunde'; | ||
} | ||
|
||
@override | ||
String minAgo(int minutes) => 'un minut'; | ||
|
||
@override | ||
String minsAgo(int minutes) => '$minutes minute'; | ||
|
||
@override | ||
String hourAgo(int minutes) => 'o oră'; | ||
|
||
@override | ||
String hoursAgo(int hours) => '$hours ore'; | ||
|
||
@override | ||
String dayAgo(int hours) => 'o zi'; | ||
|
||
@override | ||
String daysAgo(int days) => '$days zile'; | ||
|
||
@override | ||
String wordSeparator() => ' '; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import 'package:get_time_ago/src/messages/languages/ro_msg.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
final messages = RomanianMessages(); | ||
|
||
test('prefixAgo returns "acum"', () { | ||
expect(messages.prefixAgo(), 'acum'); | ||
}); | ||
|
||
test('suffixAgo returns empty string', () { | ||
expect(messages.suffixAgo(), ''); | ||
}); | ||
|
||
test('secsAgo returns correct strings', () { | ||
expect(messages.secsAgo(1), 'o secundă'); | ||
expect(messages.secsAgo(5), '5 secunde'); | ||
}); | ||
|
||
test('minAgo returns "un minut"', () { | ||
expect(messages.minAgo(1), 'un minut'); | ||
}); | ||
|
||
test('minsAgo returns correct strings', () { | ||
expect(messages.minsAgo(2), '2 minute'); | ||
}); | ||
|
||
test('hourAgo returns "o oră"', () { | ||
expect(messages.hourAgo(1), 'o oră'); | ||
}); | ||
|
||
test('hoursAgo returns correct strings', () { | ||
expect(messages.hoursAgo(3), '3 ore'); | ||
}); | ||
|
||
test('dayAgo returns "o zi"', () { | ||
expect(messages.dayAgo(1), 'o zi'); | ||
}); | ||
|
||
test('daysAgo returns correct strings', () { | ||
expect(messages.daysAgo(4), '4 zile'); | ||
}); | ||
|
||
test('wordSeparator returns space', () { | ||
expect(messages.wordSeparator(), ' '); | ||
}); | ||
} |