Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion lib/utils/Application.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,68 @@
import 'package:flutter/material.dart';

import 'package:timeago/timeago.dart' as timeago;

class Application {
static final Application _application = Application._internal();

factory Application() {
return _application;
}

Application._internal();
Application._internal() {
for (var entry in _localeMessages.entries) {
timeago.setLocaleMessages(entry.key, entry.value);
}
}

final Map<String, timeago.LookupMessages> _localeMessages = {
// 'bg',
'bn': timeago.BnMessages(),
'bn_short': timeago.BnShortMessages(),
'ca': timeago.CaMessages(),
'ca_short': timeago.CaShortMessages(),
'de': timeago.DeMessages(),
'de_short': timeago.DeShortMessages(),
'el': timeago.GrMessages(),
'el_short': timeago.GrShortMessages(),
'en': timeago.EnMessages(),
'en_short': timeago.EnShortMessages(),
'es': timeago.EsMessages(),
'es_short': timeago.EsShortMessages(),
'fr': timeago.FrMessages(),
'fr_short': timeago.FrShortMessages(),
'hr': timeago.HrMessages(),
'hr_short': timeago.HrMessages(),
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

The short Croatian locale should use timeago.HrShortMessages() instead of timeago.HrMessages() to maintain consistency with other language short variants.

Suggested change
'hr_short': timeago.HrMessages(),
'hr_short': timeago.HrShortMessages(),

Copilot uses AI. Check for mistakes.
'hu': timeago.HuMessages(),
'hu_short': timeago.HuShortMessages(),
'it': timeago.ItMessages(),
'it_short': timeago.ItShortMessages(),
'lb': timeago.DeMessages(),
'lb_short': timeago.DeShortMessages(),
// 'mk': ,
'nl': timeago.NlMessages(),
'nl_short': timeago.NlShortMessages(),
'pt': timeago.PtBrMessages(),
'pt_short': timeago.PtBrShortMessages(),
'ro': timeago.RoMessages(),
'ro_short': timeago.RoShortMessages(),
'ru': timeago.RuMessages(),
'ru_short': timeago.RuShortMessages(),
// 'sl': ,
// 'sq': ,
'sr': timeago.SrMessages(),
'sr_short': timeago.SrShortMessages(),
'sv': timeago.SvMessages(),
'sv_short': timeago.SvShortMessages(),
'tr': timeago.TrMessages(),
'tr_short': timeago.TrShortMessages(),
'zh': timeago.ZhCnMessages(),
'zh_short': timeago.ZhCnMessages(),
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

The short Chinese locale should use timeago.ZhCnShortMessages() instead of timeago.ZhCnMessages() to maintain consistency with other language short variants.

Suggested change
'zh_short': timeago.ZhCnMessages(),
'zh_short': timeago.ZhCnShortMessages(),

Copilot uses AI. Check for mistakes.
};

final List<String> supportedLanguagesCodes = [
'bg',
'bn',
'ca',
'de',
'el',
Expand All @@ -29,6 +81,7 @@ class Application {
'sl',
'sq',
'sr',
'sv',
'tr',
'zh',
];
Expand Down
Loading