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

improved Croatian l10n in accordance with Croatian grammar #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
37 changes: 30 additions & 7 deletions jquery.countdown-hr.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
/* http://keith-wood.name/countdown.html
* Croatian Latin initialisation for the jQuery countdown extension
* Written by Dejan Broz [email protected] (2011) */
/**
* http://keith-wood.name/countdown.html
* Croatian l10n for the jQuery countdown plugin
* Written by Dejan Broz [email protected] (2011)
* Improved by zytzagoo (2014)
*/
(function($) {
var PLURAL_FORM_REST = 0;
var PLURAL_FORM_SINGLE = 1;
var PLURAL_FORM_PAUCAL = 2;
var determine_plural_form = function(amount) {
amount = parseInt(amount, 10);
// assume default plural (most common case)
var plural_form = PLURAL_FORM_REST;
if (amount % 10 === 1 && amount % 100 !== 11) {
// singles (/.*1$/ && ! /.*11$/)
plural_form = PLURAL_FORM_SINGLE;
}
if ((amount % 10 >= 2) && (amount % 10 <= 4) && (amount % 100 < 10 || amount % 100 >= 20)) {
// paucals (/.*[234]$/ && ! /.*1[234]$/
plural_form = PLURAL_FORM_PAUCAL;
}
return plural_form;
};
$.countdown.regionalOptions['hr'] = {
// plurals
labels: ['Godina', 'Mjeseci', 'Tjedana', 'Dana', 'Sati', 'Minuta', 'Sekundi'],
labels1: ['Godina', 'Mjesec', 'Tjedan', 'Dan', 'Sat', 'Minuta', 'Sekunda'],
labels2: ['Godine', 'Mjeseca', 'Tjedna', 'Dana', 'Sata', 'Minute', 'Sekunde'],
// singles
labels1: ['Godina', 'Mjesec', 'Tjedan', 'Dan', 'Sat', 'Minutu', 'Sekundu'],
// paucals
labels2: ['Godine', 'Mjeseca', 'Tjedana', 'Dana', 'Sata', 'Minute', 'Sekunde'],
compactLabels: ['g', 'm', 't', 'd'],
whichLabels: function(amount) {
return (amount == 1 ? 1 : (amount >= 2 && amount <= 4 ? 2 : 0));
whichLabels: function(amount){
return determine_plural_form(amount);
},
digits: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
timeSeparator: ':', isRTL: false};
Expand Down