Skip to content

Commit bc4b1c9

Browse files
authored
Adding correct lang codes! (#809)
* Rough and ready lang attributes * LANGUAGE CODES :)
1 parent 72990c3 commit bc4b1c9

File tree

36 files changed

+41
-3
lines changed

36 files changed

+41
-3
lines changed

config/eleventy.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { DateTime } = require('luxon')
22
const CleanCSS = require('clean-css')
33
const UglifyJS = require('uglify-es')
44
const htmlmin = require('html-minifier')
5+
const { EleventyI18nPlugin } = require("@11ty/eleventy");
56
const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
67
const markdown = require('markdown-it')({
78
html: true,
@@ -17,7 +18,9 @@ const markdown = require('markdown-it')({
1718

1819
module.exports = eleventyConfig => {
1920
eleventyConfig.addPlugin(syntaxHighlight)
20-
21+
eleventyConfig.addPlugin(EleventyI18nPlugin, {
22+
defaultLanguage: 'en',
23+
});
2124
eleventyConfig.setLibrary('md', markdown)
2225

2326
eleventyConfig.addFilter('cssmin', code => {

src/_includes/layouts/default.njk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en" itemscope itemtype="https://schema.org/Article">
2+
<html lang="{% if lang %}{{ lang }}{% else %}{{ page.lang }}{% endif %}" itemscope itemtype="https://schema.org/Article">
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -36,6 +36,9 @@
3636
<meta name="mobile-web-app-capable" content="yes">
3737
<!-- robots and humans -->
3838
<meta name="robots" content="index,follow">
39+
<script>
40+
console.log(page.lang)
41+
</script>
3942
<!-- inlined css -->
4043
{% set css %}
4144
{% include "assets/css/prism.css" %}

src/translations/arabic/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: أسئلة مقابله شخصية في تطوير واجهةالويب
33
layout: layouts/page.njk
44
rtl: true
55
permalink: /translations/arabic/index.html
6+
lang : ar
67
---
78
<div dir="rtl">
89
<h1>أسئلة مقابله شخصية في تطوير واجهةالويب</h1>

src/translations/bulgarian/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Въпроси за интервю за front-end разработчици
33
layout: layouts/page.njk
44
permalink: /translations/bulgarian/index.html
5+
lang : bg
56
---
67

78
# Въпроси за интервю за front-end разработчици

src/translations/burmese/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Front-end developer အလုပ်နှင့်ဆိုင်သော အင်တာဗျူး မေးခွန်းများ
33
layout: layouts/page.njk
44
permalink: /translations/burmese/index.html
5+
lang : my
56
---
67

78
# Front-end developer အလုပ်နှင့်ဆိုင်သော အင်တာဗျူး မေးခွန်းများ

src/translations/chinese-traditional/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: 前端工程師面試問題集
33
layout: layouts/page.njk
44
permalink: /translations/chinese-traditional/index.html
5+
lang: zh
56
---
67

78
# 前端工程師面試問題集

src/translations/chinese/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: 前端工作面试问题
33
layout: layouts/page.njk
44
permalink: /translations/chinese/index.html
5+
lang : zh
56
---
67

78
# 前端工作面试问题

src/translations/croatian/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Intervju za posao Front-end Developera
33
layout: layouts/page.njk
44
permalink: /translations/croatian/index.html
5+
lang: hr
56
---
67

78
# Intervju za posao Front-end Developera

src/translations/czech/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Front-end vývojář – otázky k pohovoru
33
layout: layouts/page.njk
44
permalink: /translations/czech/index.html
5+
lang : cs
56
---
67

78
# Front-end vývojář – otázky k pohovoru

src/translations/danish/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Front-end Job Interview Spørgsmål
33
layout: layouts/page.njk
44
permalink: /translations/danish/index.html
5+
lang: da
56
---
67

78
# Front-end Job Interview Spørgsmål

0 commit comments

Comments
 (0)