Skip to content

Commit

Permalink
Enable Japanese (#690)
Browse files Browse the repository at this point in the history
* Enable Japanese

* Fix some Spanish base errors

* Fix language switcher on mobile

* Add Japanese ToC

* Add Japanese home page

* Add contributors for Japanese and Spanish
  • Loading branch information
tunetheweb authored Mar 18, 2020
1 parent 99de3f0 commit 15ae07f
Show file tree
Hide file tree
Showing 16 changed files with 409 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/static/css/2019.css
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ p.copyright a {
display: flex;
align-items: center;
justify-content: space-evenly;
margin-bottom: 2rem;
margin-top: 20px;
}

/* Footer */
Expand Down
18 changes: 9 additions & 9 deletions src/templates/base/2019/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@
<li><a href="{{ url_for('table_of_contents', year=year, lang=lang) }}">{{ self.table_of_contents_title() }}</a></li>
<li><a href="{{ url_for('contributors', year=year, lang=lang) }}">{{ self.contributors_title() }}</a></li>
<li><a href="{{ url_for('methodology', year=year, lang=lang) }}">{{ self.methodology_title() }}</a></li>
<li>
{% if supported_years | length > 1 %}
<li>
{{ year_switcher() }}
</li>
{% endif %}
<li>
{{ language_switcher() }}
</li>
<li class="misc">
<ul class="misc">
<li>
Expand All @@ -150,15 +159,6 @@
</li>
</ul>
</li>
<li>
{% if supported_years | length > 1 %}
<li>
{{ year_switcher() }}
</li>
{% endif %}
<li>
{{ language_switcher() }}
</li>
</ul>
</nav>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/templates/base/2019/contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
</style>
{% endblock %}

{% block contributors %}{{ config.contributors.keys() | length }} {% endblock %}
{% block contributors %}{{ config.contributors.keys() | length }}{% endblock %}

{% block main %}
<main id="maincontent" class="main">
Expand Down Expand Up @@ -292,7 +292,7 @@ <h1 class="title title-lg">

<div class="contributor-teams">
{% for id in contributor.teams | sort() %}
<span class="contributor-team team-{{ id }}">{{ config.teams[id].name }}</span>
<span class="contributor-team team-{{ id }}">{{ localizedTeamNames[id] if localizedTeamNames[id]|length else team.name }}</span>
{% endfor %}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/templates/base/2019/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<link rel="stylesheet" href="/static/css/index.css">
{% endblock %}

{% block contributors %}{{ config.contributors.keys() | length }} {% endblock %}
{% block contributors %}{{ config.contributors.keys() | length }}{% endblock %}

{% block main %}
<main id="maincontent">
Expand Down
2 changes: 1 addition & 1 deletion src/templates/en/2019/contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block date_published %}2019-11-04T12:00:00+00:00:00{% endblock %}
{% block date_modified %}2019-11-04T12:00:00+00:00:00{% endblock %}

{% block breadcrumb_name_2 %}{{ year }} Contributors){% endblock %}
{% block breadcrumb_name_2 %}{{ year }} Contributors{% endblock %}

{% block filter_by_team %}Filter by team: <span id="filtered-contributors">{{ self.contributors() }}</span> contributors{% endblock %}

Expand Down
9 changes: 7 additions & 2 deletions src/templates/es/2019/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@
{% block open_the_menu %}Abre el menu{% endblock %}
{% block close_the_menu %}Cierra el menú{% endblock %}

{% block index_nav_title %}Tabla de contenido del capítulo{% endblock %}
{% block index_title %}Índice{% endblock %}
{% block open_the_index %}Abrir la tabla de contenido{% endblock %}
{% block close_the_index %}Cerrar la tabla de contenido{% endblock %}

{% block open %}Abre{% endblock %}
{% block close %}Cierra{% endblock %}

{% macro on_twitter(twitterHandle) %}@{{twitterHandle}} en Twitter{% endmacro %}
{% macro on_github(gitHubHandle) %}{{gitHubHandle}} en GitHub{% endmacro %}
{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} en Twitter{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} en GitHub{% endmacro %}
{% macro website(authorName) %}{{authorName}} sitio web{% endmacro %}

{% macro edition(year) %}Edición {{ year }}{% endmacro %}
Expand Down
15 changes: 15 additions & 0 deletions src/templates/es/2019/contributors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% extends "base/2019/contributors.html" %}

{% block title %}2019 Contribuidores | Web Almanac por HTTP Archive{% endblock %}

{% block description %}El {{ config.contributors.items() | length }} personas que contribuyeron al 2019 Web Almanac commo Analistas, Autores, Pensadores, Diseñadores, Desarrolladores, Editores, Revisores y Traductores.{% endblock %}

{% block date_published %}2019-11-04T12:00:00+00:00:00{% endblock %}
{% block date_modified %}2019-11-04T12:00:00+00:00:00{% endblock %}

{% block breadcrumb_name_2 %}{{ year }} Contribuidores{% endblock %}

{% block filter_by_team %}Filtrar por equipo: <span id="filtered-contributors">{{ self.contributors() }}</span> contributors{% endblock %}

{% block join_the_team_title%}Únete al equipo de Web Almanac{% endblock %}
{% block join_the_team_text%}¡Únete al equipo!{% endblock %}
98 changes: 98 additions & 0 deletions src/templates/ja/2019/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{% extends "base/2019/base.html" %}

{% block description %}The Web Almanac is an annual state of the web report combining the expertise of the web community with the data and trends of the HTTP Archive.{% endblock %}

{% block twitter_image_alt %}{{ year }} Web年鑑{% endblock %}

{% block date_published %}2019-11-04T12:00:00+00:00:00{% endblock %}
{% block date_modified %}2019-11-04T12:00:00+00:00:00{% endblock %}

{% block breadcrumb_name_1 %}{{ year }} Home{% endblock %}
{% block breadcrumb_name_2 %}{% endblock %}

{% block skip_navigation %}Skip navigation{% endblock %}

{% block organization %}HTTP ArchiveによるWeb年鑑{% endblock %}

{% block http_archive_link %}HTTP ArchiveによるWeb年鑑{% endblock %}

{% block page_navigation %}Page navigation{% endblock %}

{% block help_translate %}Help Translate{% endblock %}
{% block translation_not_available %}英語-日本語では使用できません{% endblock %}

{% block table_of_contents_title %}目次{% endblock %}
{% block contributors_title %}貢献者{% endblock %}
{% block methodology_title %}方法論{% endblock %}

{% block part %}部{% endblock %}
{% block chapter %}章{% endblock %}

{% block start_exploring %}Start exploring{% endblock %}

{% block menu_title %}Page menu{% endblock %}
{% block open_the_menu %}Open the menu{% endblock %}
{% block close_the_menu %}Close the menu{% endblock %}

{% block index_nav_title %}Chapter table of contents{% endblock %}
{% block index_title %}Index{% endblock %}
{% block open_the_index %}Open the Table of Contents{% endblock %}
{% block close_the_index %}Close the Table of Contents{% endblock %}

{% block open %}Open{% endblock %}
{% block close %}Close{% endblock %}

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} on Twitter{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} on GitHub{% endmacro %}
{% macro website(authorName) %}{{authorName}} website{% endmacro %}

{% macro edition(year) %}{{ year }} Edition{% endmacro %}

{% block footer_title %}Footer navigation{% endblock %}
{% block copyright %}© 2019 Web Almanac. Licensed under <a href="https://github.com/HTTPArchive/almanac.httparchive.org/blob/master/LICENSE">Apache 2.0</a>.{% endblock %}
{% block accessibility_statement %}Accessibility Statement{% endblock %}

{%
set localizedPartTitles = {
"I. Page Content": "I. Page Content",
"II. User Experience": "II. User Experience",
"III. Content Publishing": "III. Content Publishing",
"IV. Content Distribution": "IV. Content Distribution"
}
%}
{%
set localizedChapterTitles = {
"JavaScript": "JavaScript",
"CSS": "CSS",
"Markup": "マークアップ",
"Media": "Media",
"Third Parties": "Third Parties",
"Fonts": "Fonts",
"Performance": "パフォーマンス",
"Security": "セキュリティ",
"Accessibility": "アクセシビリティ",
"SEO": "SEO",
"PWA": "PWA",
"Mobile Web": "Mobile Web",
"Ecommerce": "Ecommerce",
"CMS": "CMS",
"Compression": "Compression",
"Caching": "Caching",
"CDN": "CDN",
"Page Weight": "Page Weight",
"Resource Hints": "Resource Hints",
"HTTP/2": "HTTP/2"
}
%}

{% set localizedTeamNames = {
"analysts": "Analysts",
"authors": "Authors",
"brainstormers": "Brainstormers",
"designers": "Designers",
"developers": "Developers",
"editors": "Editors",
"reviewers": "Reviewers",
"translators": "Translators",
}
%}
26 changes: 26 additions & 0 deletions src/templates/ja/2019/base_chapter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% extends "base/2019/base_chapter.html" %}

{% block title %}{{ metadata.get('title') }} | 2019 | HTTP ArchiveによるWeb年鑑{% endblock %}

{% block description %}{{ metadata.get('description',metadata.get('title') + ' chapter of the ' + year + ' Web Almanac probing into the use of ' + metadata.get('description',metadata.get('title')) + ' on the web.') }}{% endblock %}

{% block twitter_image_alt %}Chapter image for the {{ metadata.get('title') }} chapter of the {{ year }} Web Almanac{% endblock %}

{% block breadcrumb_name_2 %}{{ metadata.get('title') }}{% endblock %}

{% block unedited %}[Unedited]{% endblock %}

{% block prev_next_title %}Previous and next chapter navigation{% endblock %}

{% block discuss_this_chapter %}Discuss this chapter{% endblock %}
{% block comment %}comment{% endblock %}
{% block comments %}comments{% endblock %}
{% block written_by %}Written by{% endblock %}
{% block reviewed_by %}Reviewed by{% endblock %}
{% block translated_by %}Translated by{% endblock %}

{% block author %}Author{% endblock %}
{% block authors %}Authors{% endblock %}

{% block previous %}Previous Chapter (press 'p' or ','){% endblock %}
{% block next %}Next Chapter (press 'n' or '.'){% endblock %}
15 changes: 15 additions & 0 deletions src/templates/ja/2019/contributors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% extends "base/2019/contributors.html" %}

{% block title %}2019 貢献者 | HTTP ArchiveによるWeb年鑑{% endblock %}

{% block description %}The {{ config.contributors.items() | length }} people who contributed to the 2019 Web Almanac as Analysts, Authors, Brainstormers, Designers, Developers, Editors, Reviewers and Translators.{% endblock %}

{% block date_published %}2019-11-04T12:00:00+00:00:00{% endblock %}
{% block date_modified %}2019-11-04T12:00:00+00:00:00{% endblock %}

{% block breadcrumb_name_2 %}{{ year }} 貢献者{% endblock %}

{% block filter_by_team %}Filter by team: <span id="filtered-contributors">{{ self.contributors() }}</span> contributors{% endblock %}

{% block join_the_team_title%}Join the Web Almanac team{% endblock %}
{% block join_the_team_text%}Join the team!{% endblock %}
Loading

0 comments on commit 15ae07f

Please sign in to comment.