Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trans: High quality review of source strings #1462

Merged
merged 16 commits into from
Jun 30, 2023
Merged
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Version 1.3.4-dev (development of upcoming release)
* Feature: Exclude /swapfile by default (#1053)
* Documentation: Removed outdated docbook (#1345).
* Build: Introduced .readthedocs.yaml as asked by ReadTheDocs.org (#1443).
* Translation: Strings to translate now easier to understand for translators (#1448).
* Translation: Strings to translate now easier to understand for translators (#1448, #1457).
* Translation: Updated and completed "German" (#1454).

Version 1.3.3 (2023-01-04)
Expand Down
18 changes: 9 additions & 9 deletions common/backintime.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def createParsers(app_name = 'backintime'):
nargs = 0
aliases = [(command, nargs), ('b', nargs)]
description = 'Take a new snapshot. Ignore if the profile ' +\
'is not scheduled or if the machine runs on battery.'
'is not scheduled or if the machine is running on battery.'
backupCP = subparsers.add_parser(command,
parents = [rsyncArgsParser],
epilog = epilogCommon,
Expand Down Expand Up @@ -263,7 +263,7 @@ def createParsers(app_name = 'backintime'):
action = 'store',
default = 40,
nargs = '?',
help = 'File size used to for benchmark.')
help = 'File size used for benchmark.')

command = 'check-config'
description = 'Check the profiles configuration and install crontab entries.'
Expand Down Expand Up @@ -400,17 +400,17 @@ def createParsers(app_name = 'backintime'):

backupGroup.add_argument ('--no-local-backup',
action = 'store_true',
help = 'Temporary disable creation of backup files before changing local files. ' +\
'This can be switched of permanently in Settings, too.')
help = 'Temporarily disable creation of backup files before changing local files. ' +\
'This can be switched off permanently in Settings, too.')

restoreCP.add_argument ('--only-new',
action = 'store_true',
help = 'Only restore files which does not exist or are newer than ' +\
help = 'Only restore files which do not exist or are newer than ' +\
'those in destination. Using "rsync --update" option.')

command = 'shutdown'
nargs = 0
description = 'Shutdown the computer after the snapshot is done.'
description = 'Shut down the computer after the snapshot is done.'
shutdownCP = subparsers.add_parser(command,
epilog = epilogCommon,
help = description,
Expand All @@ -431,7 +431,7 @@ def createParsers(app_name = 'backintime'):
command = 'snapshots-list'
nargs = 0
aliases.append((command, nargs))
description = 'Show a list of snapshots IDs.'
description = 'Show a list of snapshot IDs.'
snapshotsListCP = subparsers.add_parser(command,
parents = [snapshotPathParser],
epilog = epilogCommon,
Expand All @@ -443,7 +443,7 @@ def createParsers(app_name = 'backintime'):
command = 'snapshots-list-path'
nargs = 0
aliases.append((command, nargs))
description = "Show the path's to snapshots."
description = "Show the paths to snapshots."
snapshotsListPathCP = subparsers.add_parser(command,
parents = [snapshotPathParser],
epilog = epilogCommon,
Expand Down Expand Up @@ -514,7 +514,7 @@ def startApp(app_name = 'backintime'):
if tools.usingSudo() and os.getenv('BIT_SUDO_WARNING_PRINTED', 'false') == 'false':
os.putenv('BIT_SUDO_WARNING_PRINTED', 'true')
logger.warning("It looks like you're using 'sudo' to start %(app)s. "
"This will cause some troubles. Please use either 'sudo -i %(app_name)s' "
"This will cause some trouble. Please use either 'sudo -i %(app_name)s' "
"or 'pkexec %(app_name)s'."
%{'app_name': app_name, 'app': config.Config.APP_NAME})

Expand Down
2 changes: 1 addition & 1 deletion common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def remove(cfg, snapshot_ids = None, force = None):
sids = [selectSnapshot(snapshotsList, cfg, sid, 'SnapshotID to remove') for sid in snapshot_ids]

if not force:
print('Do you really want to remove this snapshots?')
print('Do you really want to remove these snapshots?')
[print(sid.displayName) for sid in sids]
if not 'yes' == input('(no/yes): '):
return
Expand Down
16 changes: 8 additions & 8 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Config(configfile.ConfigFileWithProfiles):
CUSTOM_HOUR: _('Custom Hours'),
DAY: _('Every Day'),
REPEATEDLY: _('Repeatedly (anacron)'),
UDEV: _('When drive get connected (udev)'),
UDEV: _('When drive gets connected (udev)'),
WEEK: _('Every Week'),
MONTH: _('Every Month'),
YEAR: _('Every Year')
Expand Down Expand Up @@ -371,7 +371,7 @@ def checkConfig(self):
self.notifyError(
'{}\n{}'.format(
_('Profile: "{name}"').format(name=profile_name),
_('You must select at least one folder to backup!')
_('You must select at least one folder to back up!')
)
)

Expand Down Expand Up @@ -486,7 +486,7 @@ def setSnapshotsPath(self, value, profile_id = None, mode = None):
try:
os.chmod(p, 0o777)
except PermissionError as e:
msg = "Failed to change permissions world writeable for '{}': {}"
msg = "Failed to set permissions world-writable for '{}': {}"
logger.warning(msg.format(p, str(e)), self)

# Test filesystem
Expand All @@ -503,7 +503,7 @@ def setSnapshotsPath(self, value, profile_id = None, mode = None):

elif fs == 'cifs' and not self.copyLinks():
self.notifyError(_(
'Destination filesystem for {path} is a SMB mounted share. '
'Destination filesystem for {path} is an SMB-mounted share. '
'Please make sure the remote SMB server supports symlinks or '
'activate {copyLinks} in {expertOptions}.')
.format(path=value,
Expand All @@ -512,7 +512,7 @@ def setSnapshotsPath(self, value, profile_id = None, mode = None):

elif fs == 'fuse.sshfs' and mode not in ('ssh', 'ssh_encfs'):
self.notifyError(_(
"Destination filesystem for {path} is a sshfs mounted share."
"Destination filesystem for {path} is an sshfs-mounted share."
" sshfs doesn't support hard-links. "
"Please use mode 'SSH' instead.")
.format(path=value))
Expand Down Expand Up @@ -651,7 +651,7 @@ def sshMaxArgLength(self, profile_id = None):
#?0 = unlimited;0, >700
value = self.profileIntValue('snapshots.ssh.max_arg_length', 0, profile_id)
if value and value < 700:
raise ValueError('SSH max arg length %s is to low to run commands' % value)
raise ValueError('SSH max arg length %s is too low to run commands' % value)
return value

def setSshMaxArgLength(self, value, profile_id = None):
Expand Down Expand Up @@ -1266,7 +1266,7 @@ def rsyncOptions(self, profile_id = None):
if '--old-args' in val:
logger.warning(
'Found rsync flag "--old-args". That flag will be removed '
'from the options because it does conflict with '
'from the options because it conflicts with '
'the flag "-s" (also known as "--secluded-args" or '
'"--protected-args") which is used by Back In Time to force '
'the "new form of argument protection" in rsync.'
Expand Down Expand Up @@ -1626,7 +1626,7 @@ def createNewCrontab(self, oldCrontab):
# entries if there is no automatic entry.
newCrontab.append(self.SYSTEM_ENTRY_MESSAGE)
newCrontab.append("#Please don't delete these two lines, or all custom backintime "
"entries are going to be deleted next time you call the gui options!")
"entries will be deleted next time you call the gui options!")
buhtz marked this conversation as resolved.
Show resolved Hide resolved
return newCrontab

def cronLine(self, profile_id):
Expand Down
2 changes: 1 addition & 1 deletion common/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def mount(self, check = True):
raise HashCollision(
f'Hash collision occurred in hash_id {self.hash_id}. '
'Incrementing global value hash_collision and '
'try again.')
'trying again.')

logger.info('Mountpoint {} is already mounted'
.format(self.currentMountpoint),
Expand Down
14 changes: 7 additions & 7 deletions common/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def takeSnapshotMessage(self):
try:
mid = int(items[0])
except Exception as e:
logger.debug('Failed extract message ID from %s: %s'
logger.debug('Failed to extract message ID from %s: %s'
%(items[0], str(e)),
self)

Expand Down Expand Up @@ -746,7 +746,7 @@ def backup(self, force = False):
if not self.config.canBackup(profile_id):
if self.config.PLUGIN_MANAGER.hasGuiPlugins and self.config.notify():
self.setTakeSnapshotMessage(1,
_('Can\'t find snapshots folder.\nIf it is on a removable drive please plug it.') +
_('Can\'t find snapshots folder.\nIf it is on a removable drive please plug it in.') +
'\n' +
gettext.ngettext('Waiting %s second.', 'Waiting %s seconds.', 30) % 30,
30)
Expand Down Expand Up @@ -962,7 +962,7 @@ def backupConfig(self, sid):
# But we need a real ERROR here.
if rc != 0:
logger.error(
f'Backup the config in "{self.config.snapshotsMode()}"'
f'Backing up the config in "{self.config.snapshotsMode()}"'
f' mode failed! The return code was {rc} and the'
f' command was {cmd}. Also see the previous '
'WARNING message for a more details.', parent=self)
Expand Down Expand Up @@ -1384,7 +1384,7 @@ def smartRemoveList(self,
snapshots = listSnapshots(self.config)
logger.debug("Considered: %s" %snapshots, self)
if len(snapshots) <= 1:
logger.debug("There is only one snapshots, so keep it", self)
logger.debug("There is only one snapshot, so keep it", self)
return

if now_full is None:
Expand Down Expand Up @@ -2673,12 +2673,12 @@ def saveToContinue(self, enable):
with open(flag, 'wt') as f:
pass
except Exception as e:
logger.error("Failed to set 'save_to_continue' flag: %s" %str(e))
logger.error("Failed to set 'save_to_continue' flag: %s" %str(e)) # should be "safe", throughout
elif os.path.exists(flag):
try:
os.remove(flag)
except Exception as e:
logger.error("Failed to remove 'save_to_continue' flag: %s" %str(e))
logger.error("Failed to remove 'save_to_continue' flag: %s" %str(e)) # should be "safe", throughout

@property
def hasChanges(self):
Expand Down Expand Up @@ -2783,7 +2783,7 @@ def iterSnapshots(cfg, includeNewSnapshot = False):
yield sid
except Exception as e:
if not isinstance(e, LastSnapshotSymlink):
logger.debug("'{}' is no snapshot ID: {}".format(item, str(e)))
logger.debug("'{}' is not a snapshot ID: {}".format(item, str(e)))


def listSnapshots(cfg, includeNewSnapshot = False, reverse = True):
Expand Down
6 changes: 3 additions & 3 deletions common/sshtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def maxArg():
raise MountException(
"Checking commands on remote host didn't return any "
"output. We already checked the maximum argument length "
"but it seem like there is an other problem")
"but it seems like there is another problem")

logger.warning(
'Looks like the command was to long for remote SSHd. '
Expand Down Expand Up @@ -897,7 +897,7 @@ def maxArg():
# Argument list too long
if e.errno == 7:
logger.debug(
'Argument list too log (Python exception)', self)
'Argument list too long (Python exception)', self)

return maxArg()

Expand Down Expand Up @@ -1013,7 +1013,7 @@ def sshKeyGen(keyfile):
if proc.returncode:
logger.error('Failed to create a new ssh-key: {}'.format(err))
else:
logger.info('Successfully create new ssh-key "{}"'.format(keyfile))
logger.info('Successfully created new ssh-key "{}"'.format(keyfile))

return not proc.returncode

Expand Down
18 changes: 9 additions & 9 deletions common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def keyringSupported():
logger.debug('No keyring due to import error.')
return False

keyring_config_file_folder = "Unkown"
keyring_config_file_folder = "Unknown"
try:
keyring_config_file_folder = keyring.util.platform_.config_root()
except:
Expand Down Expand Up @@ -1418,7 +1418,7 @@ def readCrontab():
crontab = [x.strip() for x in out.strip('\n').split('\n')]
if crontab == ['']: # Fixes issue #1181 (line count of empty crontab was 1 instead of 0)
crontab = []
logger.debug('Read %s lines from users crontab'
logger.debug('Read %s lines from user crontab'
%len(crontab))
return crontab

Expand Down Expand Up @@ -1455,7 +1455,7 @@ def writeCrontab(lines):
%(proc.returncode, err))
return False
else:
logger.debug('Wrote %s lines to users crontab'
logger.debug('Wrote %s lines to user crontab'
%len(lines))
return True

Expand Down Expand Up @@ -1613,30 +1613,30 @@ def checkUnique(self, path):
size,inode = dum.st_size, dum.st_ino
# is it a hlink ?
if (size, inode) in self._size_inode:
logger.debug("[deep test] : skip, it's a duplicate (size, inode)", self)
logger.debug("[deep test]: skip, it's a duplicate (size, inode)", self)
return False
self._size_inode.add((size,inode))
if size not in self._uniq_dict:
# first item of that size
unique_key = size
logger.debug("[deep test] : store current size ?", self)
logger.debug("[deep test]: store current size?", self)
else:
prev = self._uniq_dict[size]
if prev:
# store md5sum instead of previously stored size
md5sum_prev = md5sum(prev)
self._uniq_dict[size] = None
self._uniq_dict[md5sum_prev] = prev
logger.debug("[deep test] : size duplicate, remove the size, store prev md5sum", self)
logger.debug("[deep test]: size duplicate, remove the size, store prev md5sum", self)
unique_key = md5sum(path)
logger.debug("[deep test] : store current md5sum ?", self)
logger.debug("[deep test]: store current md5sum?", self)
else:
# store a tuple of (size, modification time)
obj = os.stat(path)
unique_key = (obj.st_size, int(obj.st_mtime))
# store if not already present, then return True
if unique_key not in self._uniq_dict:
logger.debug(" >> ok, store !", self)
logger.debug(" >> ok, store!", self)
self._uniq_dict[unique_key] = path
return True
logger.debug(" >> skip (it's a duplicate)", self)
Expand Down Expand Up @@ -2347,7 +2347,7 @@ def start(self):
"""
# Check for a pidfile to see if the daemon already runs
if self.pidfile and not self.appInstance.check():
message = "pidfile %s already exist. Daemon already running?\n"
message = "pidfile %s already exists. Daemon already running?\n"
logger.error(message % self.pidfile, self)
sys.exit(1)

Expand Down
Loading