appy.pod: added .docx and .xlsx as conversion formats for converter.py. appy.gen: translation system: if not message is present, the label itself is used for the message.
This commit is contained in:
parent
e5cef2b8a4
commit
41fbedd279
4 changed files with 36 additions and 12 deletions
|
@ -1088,9 +1088,13 @@ class BaseMixin:
|
|||
# Fallback to 'en'.
|
||||
translation = getattr(tool, 'en').appy()
|
||||
res = getattr(translation, label, '')
|
||||
# Perform replacements if needed
|
||||
for name, repl in mapping.iteritems():
|
||||
res = res.replace('${%s}' % name, repl)
|
||||
# If still no result, put the label instead of a translated message
|
||||
if not res: res = label
|
||||
else:
|
||||
# Perform replacements
|
||||
res = res.replace('\r\n', '<br/>').replace('\n', '<br/>')
|
||||
for name, repl in mapping.iteritems():
|
||||
res = res.replace('${%s}' % name, repl)
|
||||
return res
|
||||
|
||||
def getPageLayout(self, layoutType):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue