Use the correct language in lang attributes

Set the lang attribute in the html element to be the right
language, and also add lang attributes to text in a language that
is different to the page language, such as the language switcher
links.
This commit is contained in:
Jack Taylor 2017-04-07 13:08:44 +09:00
parent ff657d2db1
commit 9c467304ec
6 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ .Lang }}">
{{ partial "head.html" . }} {{ partial "head.html" . }}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ .Lang }}">
{{ partial "head.html" . }} {{ partial "head.html" . }}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ .Lang }}">
{{ partial "head.html" . }} {{ partial "head.html" . }}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ .Lang }}">
{{ partial "head.html" . }} {{ partial "head.html" . }}

View File

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="{{ .Lang }}">
{{ partial "head.html" . }} {{ partial "head.html" . }}

View File

@ -36,7 +36,7 @@
<div class="navlinks-children"> <div class="navlinks-children">
{{ range .Site.Languages }} {{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }} {{ if not (eq .Lang $.Site.Language.Lang) }}
<a href="/{{ .Lang }}">{{ default .Lang .LanguageName }}</a> <a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
@ -45,7 +45,7 @@
<li> <li>
{{ range .Site.Languages }} {{ range .Site.Languages }}
{{ if not (eq .Lang $.Site.Language.Lang) }} {{ if not (eq .Lang $.Site.Language.Lang) }}
<a href="/{{ .Lang }}">{{ default .Lang .LanguageName }}</a> <a href="/{{ .Lang }}" lang="{{ .Lang }}">{{ default .Lang .LanguageName }}</a>
{{ end }} {{ end }}
{{ end }} {{ end }}
</li> </li>