-
Notifications
You must be signed in to change notification settings - Fork 49
fallback to sourcecode if pluralform exists but is not translated #110
Conversation
UnitTest is missing |
src/Translator/Translator.php
Outdated
@@ -417,7 +417,11 @@ public function translatePlural( | |||
); | |||
} | |||
|
|||
return $translation[$index]; | |||
if ($translation[$index] !== '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to use empty()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translate()
checks also against the empty string – but check against null
is missing here 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty() will check empty string and null
Are you willing to add it? It can't be merged without tests. Adding it shouldn't be complicated. Thanks! |
|
Thanks, @Blaimi; merged to develop for release with 2.10.0. |
I rebased off of develop and resolved conflicts when merging. |
If a po-File has the msgid but no translations,
translatePlural()
translates to an empty string.This change makes it consistent with the behaviour of
translate()
which also returns the source-code version if the message is not translated.example: