Bureaucrats, coding, Administrators
2,634
edits
m (→Implement {{tl|Dictionary}}: Backport changes from tf wiki) |
m (→Implement {{tl|Dictionary}}: backport) |
||
Line 125: | Line 125: | ||
'name': 'price', | 'name': 'price', | ||
'sync': 'Template:Dictionary/price/Special:SyncData', | 'sync': 'Template:Dictionary/price/Special:SyncData', | ||
'allTemplate': 'item price/fmt' | 'allTemplate': { | ||
'template': 'item price/fmt', | |||
'params': { | |||
'tt': <nowiki>'{{{tt|yes}}}'</nowiki> | |||
} | |||
} | |||
}, | }, | ||
u'Template:Dictionary/mechanics': { | u'Template:Dictionary/mechanics': { | ||
Line 207: | Line 212: | ||
unordered[k] = data[k] | unordered[k] = data[k] | ||
h.update((k + u'=' + data[k]).encode('utf8')) | h.update((k + u'=' + data[k]).encode('utf8')) | ||
if 'allTemplate' in self.dictionaries[currentDict] and len(unordered): | if 'allTemplate' in self.dictionaries[currentDict] and (len(unordered) or len(self.dictionaries[currentDict]['allTemplate']['params'])): | ||
allKey = [] | allKey = [] | ||
keys = unordered.keys() | keys = unordered.keys() | ||
Line 213: | Line 218: | ||
for k in keys: | for k in keys: | ||
allKey.append(k + u'=' + unordered[k]) | allKey.append(k + u'=' + unordered[k]) | ||
for p in self.dictionaries[currentDict]['allTemplate']['params']: | |||
allKey.append(u(p) + u'=' + u(self.dictionaries[currentDict]['allTemplate']['params'][p])) | |||
insertIndex = 0 | insertIndex = 0 | ||
if isTranslation and self.defaultLang in data: | if isTranslation and self.defaultLang in data: | ||
insertIndex = 1 | insertIndex = 1 | ||
ordered.insert(insertIndex, u(self.allKeyName) + u'={{' + u(self.dictionaries[currentDict]['allTemplate']) + u'|' + u'|'.join(allKey) + u'}}') | ordered.insert(insertIndex, u(self.allKeyName) + u'={{' + u(self.dictionaries[currentDict]['allTemplate']['template']) + u'|' + u'|'.join(allKey) + u'}}') | ||
subpage = subpage.replace(u'%options%', u'|'.join(ordered)) | subpage = subpage.replace(u'%options%', u'|'.join(ordered)) | ||
else: # No subkeys | else: # No subkeys |