PyQt5 QSpinBox – Getting translated version of text
In this article we will see how we can get the translated version of the text. Translated version of text is based on the disambiguation string and value of n for strings containing plurals. If no appropriate translated string is available translated text will be a UTF-8 string i.e a Unicode codec and can represent all characters in a Unicode string like QString. However, invalid sequences are possible with UTF-8 and, if any such are found, they will be replaced with one or more “replacement characters”, or suppressed.
In order to do this we use
tr method with the spin box object.
Syntax : spin_box.tr(text, d_text, n)
Argument : It takes 3 arguments first one is the text and other two are not compulsory first is disambiguation string and other is the integer that refer to the plurals number
Return : It returns string
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course