Skip to content

Commit

Permalink
several translation updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-101 committed Sep 29, 2018
1 parent 8fb9172 commit b1df88c
Show file tree
Hide file tree
Showing 13 changed files with 1,425 additions and 1,387 deletions.
11 changes: 5 additions & 6 deletions source/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,8 @@ def updateContent(self):
sortKey = '{0} ({1})'.format(sortKey, sortDir)
except ValueError:
sortKey = ''
QTreeWidgetItem(self.fieldListBox,
[field.name, _(field.typeName), sortKey])
typeName = fieldformat.translatedTypeName(field.typeName)
QTreeWidgetItem(self.fieldListBox, [field.name, typeName, sortKey])
selectNum = currentFormat.fieldNames().index(ConfigDialog.
currentFieldName)
selectItem = self.fieldListBox.topLevelItem(selectNum)
Expand Down Expand Up @@ -939,8 +939,7 @@ def __init__(self, parent=None):
fieldTypeLayout = QVBoxLayout(fieldTypeBox)
self.fieldTypeCombo = QComboBox()
fieldTypeLayout.addWidget(self.fieldTypeCombo)
self.fieldTypeCombo.addItems([_(name) for name in
fieldformat.fieldTypes])
self.fieldTypeCombo.addItems(fieldformat.translatedFieldTypes)
self.fieldTypeCombo.currentIndexChanged.connect(self.changeFieldType)

self.formatBox = QGroupBox(_('Outpu&t Format'))
Expand Down Expand Up @@ -1377,8 +1376,8 @@ def updateFieldList(self):
self.fieldListBox.clear()
for field in activeFormat.fields():
if field.showInDialog:
QTreeWidgetItem(self.fieldListBox,
[field.name, field.typeName])
typeName = fieldformat.translatedTypeName(field.typeName)
QTreeWidgetItem(self.fieldListBox, [field.name, typeName])
selectList = self.fieldListBox.findItems(ConfigDialog.currentFieldName,
Qt.MatchFixedString |
Qt.MatchCaseSensitive)
Expand Down
13 changes: 11 additions & 2 deletions source/fieldformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
N_('Choice'), N_('AutoChoice'), N_('Combination'),
N_('AutoCombination'), N_('ExternalLink'), N_('InternalLink'),
N_('Picture'), N_('RegularExpression')]
translatedFieldTypes = [_(name) for name in fieldTypes]
_errorStr = '#####'
_dateStampString = _('Now')
_timeStampString = _('Now')
Expand Down Expand Up @@ -429,8 +430,8 @@ class NumberField(HtmlTextField):
(_('Decimal Point\t.'), '.'),
(_('Decimal Comma\t,'), ','),
('', ''),
(_('Comma Separator\t\,'), '\,'),
(_('Dot Separator\t\.'), '\.'),
(_('Comma Separator\t\\,'), '\\,'),
(_('Dot Separator\t\\.'), '\\.'),
(_('Space Separator (internal)\t<space>'), ' '),
('', ''),
(_('Optional Sign\t-'), '-'),
Expand Down Expand Up @@ -2463,3 +2464,11 @@ def adjTimeAmPm(timeFormat, time):
amPm = 'AM' if time.hour < 12 else 'PM'
timeFormat = re.sub(r'(?<!%)%p', amPm, timeFormat)
return timeFormat

def translatedTypeName(typeName):
"""Return a translated type name.
Arguments:
typeName -- the English type name
"""
return translatedFieldTypes[fieldTypes.index(typeName)]
Binary file modified translations/qt_de.qm
Binary file not shown.
Binary file modified translations/qt_es.qm
Binary file not shown.
Binary file modified translations/treeline_de.qm
Binary file not shown.
Binary file modified translations/treeline_es.qm
Binary file not shown.
Loading

0 comments on commit b1df88c

Please sign in to comment.