~usb-creator-hackers/usb-creator/trunk

« back to all changes in this revision

Viewing changes to usbcreator/frontends/kde/translate.py

  • Committer: Benjamin Drung
  • Date: 2022-11-02 13:01:26 UTC
  • Revision ID: benjamin.drung@canonical.com-20221102130126-4z0xyivy5f37dp13
Move to https://code.launchpad.net/~usb-creator-hackers/usb-creator/+git/main

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#############################################################################
2
 
##
3
 
## Copyright 2008 Roderick B. Greening <roderick.greening@gmail.com>
4
 
##
5
 
## This program is free software; you can redistribute it and/or
6
 
## modify it under the terms of the GNU General Public License as
7
 
## published by the Free Software Foundation; either version 3 of
8
 
## the License, or (at your option) any later version.
9
 
##
10
 
## This program is distributed in the hope that it will be useful,
11
 
## but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
## GNU General Public License for more details.
14
 
##
15
 
## You should have received a copy of the GNU General Public License
16
 
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
 
##
18
 
#############################################################################
19
 
 
20
 
#############################################################################
21
 
# Name: translate.py
22
 
#
23
 
# Description: Re-usable include which re-implements the translate method
24
 
#              from uic, and changes it to use gettext.
25
 
#############################################################################
26
 
 
27
 
from PyQt5 import uic
28
 
 
29
 
# FIXME: apachelogger is not sure that the following function does what it is
30
 
#        supposed to, but generally piping things through _() should yield a
31
 
#        translation, whether that actually is the case or not remains to be verified
32
 
 
33
 
# Re-implement it
34
 
def translate(self, prop):
35
 
    """Re-implement method from uic and change it to use gettext"""
36
 
    if prop.get("notr", None) == "true":
37
 
        return propt.text
38
 
        return self._cstring(prop)
39
 
    else:
40
 
        if prop.text is None:
41
 
            return ""
42
 
        return _(prop.text)