Add support for i18n in templates

i18n
Jed Fox 7 years ago
parent 75b3ab90ab
commit 0873162a7a

@ -7,5 +7,7 @@ app.templates.render = (name, value, args...) ->
result
else if typeof template is 'function'
template(value, args...)
else if typeof template is 'object'
_ template, value
else
template

@ -1,4 +1,4 @@
notice = (text) -> """<p class="_notice-text">#{text}</p>"""
notice = (text) -> """<p class="_notice-text">#{_ text}</p>"""
app.templates.singleDocNotice = (doc) ->
notice """ You're browsing the #{doc.fullName} documentation. To browse all docs, go to

@ -1,12 +1,12 @@
notif = (title, html) ->
html = html.replace /<a /g, '<a class="_notif-link" '
""" <h5 class="_notif-title">#{title}</h5>
""" <h5 class="_notif-title">#{_ title}</h5>
#{html}
<button type="button" class="_notif-close" title="Close"><svg><use xlink:href="#icon-close"/></svg>Close</a>
"""
textNotif = (title, message) ->
notif title, """<p class="_notif-text">#{message}"""
notif title, """<p class="_notif-text">#{_ message}"""
app.templates.notifUpdateReady = ->
textNotif """<span data-behavior="reboot">DevDocs has been updated.</span>""",

Loading…
Cancel
Save