implement feature request #1489

Signed-off-by: Umair Khan <omerjerk@gmail.com>
Replace if condition with a better code

Signed-off-by: Umair Khan <omerjerk@gmail.com>
Merge pull request #866 from omerjerk/QA_4_1

implement feature request #1489
Translated using Weblate (Portuguese (Brazil))

Currently translated at 100.0% (2749 of 2749)
Translated using Weblate (Swedish)

Currently translated at 97.8% (2691 of 2749)
Merge remote-tracking branch 'origin/QA_4_1' into QA_4_1
Merge commit '494a1a8727165b22e685ce72af11bc27d8626cc3'
Merge remote-tracking branch 'origin/QA_4_1'