mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: use 'other' instead of 'many' for Ukrainian pluralization until translations are fixed
This commit is contained in:
@ -6,5 +6,5 @@ I18n.pluralizationRules['uk'] = function (n) {
|
|||||||
if (n == 0) return ["zero", "none", "other"];
|
if (n == 0) return ["zero", "none", "other"];
|
||||||
if (n % 10 == 1 && n % 100 != 11) return "one";
|
if (n % 10 == 1 && n % 100 != 11) return "one";
|
||||||
if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) return "few";
|
if (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20)) return "few";
|
||||||
return "many";
|
return "other"; // TODO: should be "many" but is not defined in translations
|
||||||
};
|
};
|
||||||
|
@ -103,7 +103,8 @@
|
|||||||
:tl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
:tl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
||||||
:to => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
:to => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
||||||
:tr_TR => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
:tr_TR => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
||||||
:uk => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
# TODO put this back when translations are correct: :uk => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
|
||||||
|
:uk => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :other : :other } } } },
|
||||||
:ur => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
:ur => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
|
||||||
:vi => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
:vi => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
|
||||||
:wa => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
:wa => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
|
||||||
|
@ -8,7 +8,8 @@ MessageFormat.locale.uk = function (n) {
|
|||||||
}
|
}
|
||||||
if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
|
if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) ||
|
||||||
((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
|
((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) {
|
||||||
return 'many';
|
// return 'many';
|
||||||
|
return 'other'; // TODO should be "many" but is not defined in translations
|
||||||
}
|
}
|
||||||
return 'other';
|
return 'other';
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user