Skip to content

Commit 4c9a234

Browse files
committed
refactor(localization): simplify ar timeago messages
- Shortened time units - Removed plural logic - Updated prefix/suffix usage
1 parent d73221e commit 4c9a234

File tree

1 file changed

+14
-39
lines changed

1 file changed

+14
-39
lines changed

lib/shared/localization/ar_timeago_messages.dart

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,40 @@ import 'package:timeago/timeago.dart' as timeago;
33
/// Custom Arabic lookup messages for the timeago package.
44
class ArTimeagoMessages implements timeago.LookupMessages {
55
@override
6-
String prefixAgo() => 'منذ';
6+
String prefixAgo() => ''; // No prefix, will include in string
77
@override
8-
String prefixFromNow() => 'بعد';
8+
String prefixFromNow() => 'بعد '; // Prefix for future
99
@override
10-
String suffixAgo() => '';
10+
String suffixAgo() => ''; // No suffix
1111
@override
1212
String suffixFromNow() => '';
1313

1414
@override
15-
String lessThanOneMinute(int seconds) => 'لحظات';
15+
String lessThanOneMinute(int seconds) => 'الآن';
1616
@override
17-
String aboutAMinute(int minutes) => 'دقيقة واحدة';
17+
String aboutAMinute(int minutes) => 'منذ 1د';
1818
@override
19-
String minutes(int minutes) {
20-
if (minutes == 1) return 'دقيقة واحدة';
21-
if (minutes == 2) return 'دقيقتين';
22-
if (minutes >= 3 && minutes <= 10) return '$minutes دقائق';
23-
return '$minutes دقيقة';
24-
}
19+
String minutes(int minutes) => 'منذ ${minutes}د';
2520

2621
@override
27-
String aboutAnHour(int minutes) => 'ساعة واحدة';
22+
String aboutAnHour(int minutes) => 'منذ 1س';
2823
@override
29-
String hours(int hours) {
30-
if (hours == 1) return 'ساعة واحدة';
31-
if (hours == 2) return 'ساعتين';
32-
if (hours >= 3 && hours <= 10) return '$hours ساعات';
33-
return '$hours ساعة';
34-
}
24+
String hours(int hours) => 'منذ ${hours}س';
3525

3626
@override
37-
String aDay(int hours) => 'يوم واحد';
27+
String aDay(int hours) => 'منذ 1ي'; // Or 'أمس' if preferred for exactly 1 day
3828
@override
39-
String days(int days) {
40-
if (days == 1) return 'يوم واحد';
41-
if (days == 2) return 'يومين';
42-
if (days >= 3 && days <= 10) return '$days أيام';
43-
return '$days يومًا';
44-
}
29+
String days(int days) => 'منذ ${days}ي';
4530

4631
@override
47-
String aboutAMonth(int days) => 'شهر واحد';
32+
String aboutAMonth(int days) => 'منذ 1ش';
4833
@override
49-
String months(int months) {
50-
if (months == 1) return 'شهر واحد';
51-
if (months == 2) return 'شهرين';
52-
if (months >= 3 && months <= 10) return '$months أشهر';
53-
return '$months شهرًا';
54-
}
34+
String months(int months) => 'منذ ${months}ش';
5535

5636
@override
57-
String aboutAYear(int year) => 'سنة واحدة';
37+
String aboutAYear(int year) => 'منذ 1سنة'; // Using سنة for year
5838
@override
59-
String years(int years) {
60-
if (years == 1) return 'سنة واحدة';
61-
if (years == 2) return 'سنتين';
62-
if (years >= 3 && years <= 10) return '$years سنوات';
63-
return '$years سنة';
64-
}
39+
String years(int years) => 'منذ ${years}سنوات'; // Standard plural
6540

6641
@override
6742
String wordSeparator() => ' ';

0 commit comments

Comments
 (0)