1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-24 15:23:11 +02:00

Add feature request processwire/processwire-issues#1757 which adds support for non-plural translations of 0 quantities in the _n('%d item', %d items', 0); translation function. To use, translate the file wire/modules/LanguageSupport/LanguageTranslator.php and edi the "Is zero (0) plural or singular?" setting at the top.

This commit is contained in:
Ryan Cramer
2023-06-23 11:03:44 -04:00
parent a01b922efb
commit a6795b61ce
2 changed files with 10 additions and 3 deletions

View File

@@ -644,6 +644,7 @@ class LanguageTranslator extends Wire {
$v = '';
switch(strtolower($str)) {
case '0-plural': $v = $this->_('0-plural'); break; // Is zero (0) plural or singular? type=radios options=[0-plural:Plural,0-singular:Singular] // i.e. would language use "0 items" (plural) or "0 item" (singular)?
case 'edit': $v = $this->_('Edit'); break;
case 'delete': $v = $this->_('Delete'); break;
case 'save': $v = $this->_('Save'); break;