Use org-html--translate ("Listing N:", "Table N:", ..)

master
Kaushal Modi 8 years ago
parent 27397f2f34
commit 6679abdb8b
  1. 8
      ox-blackfriday.el
  2. 16
      ox-hugo.el

@ -852,17 +852,19 @@ contextual information."
table-num
(caption-html (if (not caption)
""
(let ((caption-str
(let ((caption-prefix-fmt-str (org-html--translate "Table %d:" info))
(caption-str
(org-html-convert-special-strings ;Interpret em-dash, en-dash, etc.
(org-export-data-with-backend caption 'html info))))
(setq table-num (org-export-get-ordinal
table info
nil #'org-html--has-caption-p))
(format (concat "<div class=\"table-caption\">\n"
" <span class=\"table-number\">Table %d:</span>\n"
" <span class=\"table-number\">%s</span>\n"
" %s\n"
"</div>\n\n")
table-num caption-str))))
(format caption-prefix-fmt-str table-num)
caption-str))))
(attr (org-export-read-attribute :attr_html table))
;; At the moment only the `class' attribute is supported in
;; #+attr_html above tables.

@ -946,7 +946,7 @@ contents according to the current headline."
(unless local
(let ((style (plist-get info :md-headline-style))
(loffset (string-to-number (plist-get info :hugo-level-offset)))
(title "Table of Contents"))
(title (org-html--translate "Table of Contents" info)))
(org-hugo--headline-title style 1 loffset title))))
(toc-items
(mapconcat
@ -1713,11 +1713,11 @@ and rewrite link paths to make blogging more seamless."
;; https://github.com/gohugoio/hugo/issues/4406
;; gets resolved.
"" ;"<span class=\\\"figure-number\\\">"
(format (org-html--translate "Figure %d: " info)
(format (org-html--translate "Figure %d:" info)
(org-export-get-ordinal
useful-parent info
nil #'org-html--has-caption-p))
"" ;"</span>"
" " ;" </span>"
caption))))
;; (message "[ox-hugo-link DBG] inline image? %s\npath: %s"
;; inline-image path)
@ -2067,14 +2067,20 @@ channel."
(let* ((src-block-num (org-export-get-ordinal
src-block info
nil #'org-html--has-caption-p))
(caption-prefix (let* ((fmt-str (org-html--translate "Listing %d:" info))
(fmt-str (or (and (string= fmt-str "Listing %d:")
"Code Snippet %d:")
fmt-str)))
(format fmt-str src-block-num)))
(caption-str
(org-html-convert-special-strings ;Interpret em-dash, en-dash, etc.
(org-export-data-with-backend caption 'html info))))
(format (concat "\n\n<div class=\"src-block-caption\">\n"
" <span class=\"src-block-number\">Code Snippet %d:</span>\n"
" <span class=\"src-block-number\">%s</span>\n"
" %s\n"
"</div>")
src-block-num caption-str))))
caption-prefix caption-str))))
content
ret)
;; (message "ox-hugo src [dbg] number-lines: %S" number-lines)

Loading…
Cancel
Save