Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +01:00
simplified pluralization logic
Dieser Commit ist enthalten in:
Ursprung
cdfd699491
Commit
7bc7c4013e
2 geänderte Dateien mit 7 neuen und 7 gelöschten Zeilen
|
@ -3,14 +3,13 @@ import I18n from "I18n";
|
|||
|
||||
export default registerUnbound("char-counter", function(body, maxLength) {
|
||||
let bodyLength = body ? body.length : 0;
|
||||
let length = maxLength || bodyLength;
|
||||
let characterString = length == 1 ? 'wizard.character' : 'wizard.characters';
|
||||
let finalString;
|
||||
|
||||
if(maxLength) {
|
||||
finalString = `<div class="body-length">${bodyLength} / ${maxLength} ${ I18n.t(characterString)}</div>`;
|
||||
if (maxLength) {
|
||||
finalString = `<div class="body-length">${bodyLength} / ${I18n.t('wizard.x_characters', { count: parseInt(maxLength) })}</div>`;
|
||||
} else {
|
||||
finalString = `<div class="body-length">${bodyLength} ${ I18n.t(characterString)}</div>`;
|
||||
finalString = `<div class="body-length">${I18n.t('wizard.x_characters', { count: parseInt(bodyLength) })}</div>`;
|
||||
}
|
||||
|
||||
return new Handlebars.SafeString(finalString);
|
||||
});
|
||||
|
|
|
@ -471,8 +471,9 @@ en:
|
|||
requires_login: "You need to be logged in to access this wizard."
|
||||
reset: "Reset this wizard."
|
||||
step_not_permitted: "You're not permitted to view this step."
|
||||
characters: "Characters"
|
||||
character: "Character"
|
||||
x_characters:
|
||||
one: "%{count} Character"
|
||||
other: "%{count} Characters"
|
||||
|
||||
wizard_composer:
|
||||
show_preview: "Preview Post"
|
||||
|
|
Laden …
In neuem Issue referenzieren