Repository: gohugoio/hugo (language: go)

Issue:
Menu template in theme skeleton throws empty warnings with --printI18nWarnings flag
The menu partial in the embedded theme skeleton attempts to translate empty identifiers, resulting in empty warnings when building site with the `--printI81nWarnings` CLI flag.

Reference <https://discourse.gohugo.io/t/find-missing-translations/46502/>


Discussion / hints:

Fix patch:
diff --git a/create/skeletons/theme/layouts/partials/menu.html b/create/skeletons/theme/layouts/partials/menu.html
index 8f72130d07b..71831809606 100644
--- a/create/skeletons/theme/layouts/partials/menu.html
+++ b/create/skeletons/theme/layouts/partials/menu.html
@@ -27,6 +27,12 @@
     {{- else if $page.HasMenuCurrent .Menu .}}
       {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
     {{- end }}
+    {{- $name := .Name }}
+    {{- with .Identifier }}
+      {{- with T . }}
+        {{- $name = . }}
+      {{- end }}
+    {{- end }}
     <li>
       <a
         {{- range $k, $v := $attrs }}
@@ -34,7 +40,7 @@
             {{- printf " %s=%q" $k $v | safeHTMLAttr }}
           {{- end }}
         {{- end -}}
-      >{{ or (T .Identifier) .Name | safeHTML }}</a>
+      >{{ $name }}</a>
       {{- with .Children }}
         <ul>
           {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}


Test patch: