multilanguage implemented

This commit is contained in:
tom5079
2019-05-15 19:32:38 +09:00
parent 4d67bbc76e
commit f9a2f9bd11
6 changed files with 95 additions and 12 deletions

View File

@@ -5,8 +5,23 @@ description: Hitomi.la viewer for Android
baseurl: "/Pupil" baseurl: "/Pupil"
show_downloads: true show_downloads: true
google_analytics: UA-119938781-2
github: github:
app_url: https://github.com/tom5079/Pupil-issue/releases/download/1.3/Pupil-v1.3.apk app_url: https://github.com/tom5079/Pupil-issue/releases/download/1.3/Pupil-v1.3.apk
issue_url: https://github.com/tom5079/Pupil-issue/issues/new/choose issue_url: https://github.com/tom5079/Pupil-issue/issues/new/choose
t:
en:
header:
description: Hitomi.la viewer for Android
download: "Download app"
issue: "Having a problem?"
or: "or…"
email: "Send an E-mail"
ko:
header:
description: 안드로이드 Hitomi.la 뷰어
download: "앱 다운로드"
issue: "문제가 있으세요?"
or: "또는…"
email: "이메일 보내기"

View File

@@ -25,8 +25,10 @@
<h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1> <h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
<h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2> <h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
{% if site.show_downloads %} {% if site.show_downloads %}
<a href="{{ site.github.app_url }}" class="btn">Download app (v1.3)</a> <a href="{{ site.github.app_url }}" class="btn">{{ site.t[page.lang].header.download }}</a>
<a href="{{ site.github.issue_url }}" target="_blank" class="btn">Having a problem?</a> <a href="{{ site.github.issue_url }}" target="_blank" class="btn">{{ site.t[page.lang].header.issue }}</a>
{{ site.t[page.lang].header.or }}
<a href="mailto:pupil.hentai@gmail.com" class="btn">{{ site.t[page.lang].header.email }}</a>
{% endif %} {% endif %}
</header> </header>
@@ -41,4 +43,4 @@
</footer> </footer>
</main> </main>
</body> </body>
</html> </html>

View File

@@ -0,0 +1,9 @@
---
layout: default
lang: ko
title: "테스트"
date: 2019-05-15 18:51:00 +0900
---
# 테스트입니당
이게 보인다구요? 야호~~~~~

26
en/index.html Normal file
View File

@@ -0,0 +1,26 @@
---
layout: default
lang: en
---
<div id="home">
<h1>Blog posts</h1>
{% assign posts=site.posts | where:"lang", page.lang %}
<ul class="posts">
{% for post in posts %}
<li>
<span>
{{ post.date | date_to_string }}
</span>
&raquo;
<a href="{{ post.url }}">
{{ post.title }}
</a>
{{ post.excerpt }}
</li>
{% endfor %}
</ul>
</div>

View File

@@ -1,7 +1,12 @@
--- <script>
layout: default var lang = navigator.language || navigator.userLanguage;
---
switch (lang) {
<div id="home"> case "ko-KR":
<h1>Blog Posts</h1> window.location.href = "ko/";
</div> break;
default:
window.location.href = "en/";
break;
}
</script>

26
ko/index.html Normal file
View File

@@ -0,0 +1,26 @@
---
layout: default
lang: ko
---
<div id="home">
<h1>글 목록</h1>
{% assign posts=site.posts | where:"lang", page.lang %}
<ul class="posts">
{% for post in posts %}
<li>
<span>
{{ post.date | date_to_string }}
</span>
&raquo;
<a href="{{ post.url }}">
{{ post.title }}
</a>
{{ post.excerpt }}
</li>
{% endfor %}
</ul>
</div>