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

Missing Slovak sk_messages.dart #226

Open
michalidesko opened this issue Jul 2, 2024 · 0 comments
Open

Missing Slovak sk_messages.dart #226

michalidesko opened this issue Jul 2, 2024 · 0 comments

Comments

@michalidesko
Copy link

I translated from Czech language, should be right:

import 'package:timeago/src/messages/lookupmessages.dart';

/// Slovak Messages
class SkMessages implements LookupMessages {
@OverRide
String prefixAgo() => 'pred';
@OverRide
String prefixFromNow() => 'o';
@OverRide
String suffixAgo() => '';
@OverRide
String suffixFromNow() => 'od teraz';
@OverRide
String lessThanOneMinute(int seconds) => 'chvíľou';
@OverRide
String aboutAMinute(int minutes) => 'minútou';
@OverRide
String minutes(int minutes) =>
_pluralize(minutes, 'minútou', 'minútami', 'minútami');
@OverRide
String aboutAnHour(int minutes) => 'hodinou';
@OverRide
String hours(int hours) =>
_pluralize(hours, 'hodinou', 'hodinami', 'hodinami');
@OverRide
String aDay(int hours) => 'dňom';
@OverRide
String days(int days) => _pluralize(days, 'dňom', 'dňami', 'dňami');
@OverRide
String aboutAMonth(int days) => 'mesiacom';
@OverRide
String months(int months) =>
_pluralize(months, 'mesiacom', 'mesiacmi', 'mesiacmi');
@OverRide
String aboutAYear(int year) => 'rokom';
@OverRide
String years(int years) => _pluralize(years, 'rokom', 'rokmi', 'rokmi');
@OverRide
String wordSeparator() => ' ';
}

/// Slovak short Messages
class SkShortMessages implements LookupMessages {
@OverRide
String prefixAgo() => '';
@OverRide
String prefixFromNow() => '';
@OverRide
String suffixAgo() => '';
@OverRide
String suffixFromNow() => '';
@OverRide
String lessThanOneMinute(int seconds) => 'teraz';
@OverRide
String aboutAMinute(int minutes) => '1 min';
@OverRide
String minutes(int minutes) => '$minutes min';
@OverRide
String aboutAnHour(int minutes) => '~1 hod';
@OverRide
String hours(int hours) => '$hours hod';
@OverRide
String aDay(int hours) => '~1 deň';
@OverRide
String days(int days) => _pluralize(days, 'deň', 'dni', 'dní');
@OverRide
String aboutAMonth(int days) => '~1 mesiac';
@OverRide
String months(int months) => _pluralize(months, 'mesiac', 'mesiace', 'mesiacov');
@OverRide
String aboutAYear(int year) => '~1 rok';
@OverRide
String years(int years) => _pluralize(years, 'rok', 'roky', 'rokov');
@OverRide
String wordSeparator() => ' ';
}

String _pluralize(int n, String form1, String form2, String form3) {
// Rules as per https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html
if (n == 1) return '$n $form1';
if (n >= 2 && n <= 4) return '$n $form2';
return '$n $form3';
}

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

No branches or pull requests

1 participant