From 5d6ededd57a205b0ecf22e63ef86f9ba6077c0db Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Mon, 14 Oct 2024 16:34:31 +0100 Subject: [PATCH] Add kanji indices --- kanken_online/__init__.py | 3 ++- kanken_online/indices.py | 19 +++++++++++++++++++ kanken_online/lang.py | 16 ++++++++++++---- kanken_online/templates/base.html | 1 + kanken_online/templates/indices/indices.html | 13 +++++++++++++ .../templates/indices/indivisible.html | 0 .../templates/indices/phonetic_series.html | 0 kanken_online/templates/indices/radicals.html | 0 8 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 kanken_online/indices.py create mode 100644 kanken_online/templates/indices/indices.html create mode 100644 kanken_online/templates/indices/indivisible.html create mode 100644 kanken_online/templates/indices/phonetic_series.html create mode 100644 kanken_online/templates/indices/radicals.html diff --git a/kanken_online/__init__.py b/kanken_online/__init__.py index d07614c..82f40b2 100644 --- a/kanken_online/__init__.py +++ b/kanken_online/__init__.py @@ -69,11 +69,12 @@ def create_app(test_config=None): from . import database database.initialize_app(app) - from . import auth, api, forum, search + from . import auth, api, forum, search, indices app.register_blueprint(auth.blueprint) app.register_blueprint(api.blueprint) app.register_blueprint(forum.blueprint) app.register_blueprint(search.blueprint) + app.register_blueprint(indices.blueprint) from . import lang diff --git a/kanken_online/indices.py b/kanken_online/indices.py new file mode 100644 index 0000000..0b235e0 --- /dev/null +++ b/kanken_online/indices.py @@ -0,0 +1,19 @@ +from flask import Blueprint, render_template + +blueprint = Blueprint("indices", __name__, url_prefix="/indices") + +@blueprint.route("/") +def indices_page(): + return render_template("indices/indices.html") + +@blueprint.route("/indivisible") +def indivisible_kanji(): + return render_template("indices/indivisible.html") + +@blueprint.route("/radicals") +def kanji_radicals(): + return render_template("indices/radicals.html") + +@blueprint.route("/phonetic_series") +def phonetic_series(): + return render_template("indices/phonetic_series.html") \ No newline at end of file diff --git a/kanken_online/lang.py b/kanken_online/lang.py index a8d7ff2..94bf30a 100644 --- a/kanken_online/lang.py +++ b/kanken_online/lang.py @@ -18,7 +18,8 @@ EXISTING_STRINGS = { "incorrect_username", "incorrect_password" "about", - "about-para" + "about-para", + "indices" } ENGLISH = { @@ -41,8 +42,11 @@ ENGLISH = { "incorrect_username": "Incorrect username.", "incorrect_password": "Incorrect password.", "about": "About KankenOnline", - "about-para": "KankenOnline is a website seeking to provide resources to pass the Kanji Kentei level 1 exam. You can search through the approximately 6,300 characters included in Kanken, as well as generate a number of study materials automatically. For example, you can generate a PDF-format exam resembling the Kanken level 1 exam, which has the goal of mirroring the real thing as closely as possible for your preparation. Additionally, a variety of information about kanji is provided, among which phonetic series, rimes/kanji phonology, radicals, inseparable kanji, character origins and etymologies." - + "about-para": "KankenOnline is a website seeking to provide resources to pass the Kanji Kentei level 1 exam. You can search through the approximately 6,300 characters included in Kanken, as well as generate a number of study materials automatically. For example, you can generate a PDF-format exam resembling the Kanken level 1 exam, which has the goal of mirroring the real thing as closely as possible for your preparation. Additionally, a variety of information about kanji is provided, among which phonetic series, rimes/kanji phonology, radicals, inseparable kanji, character origins and etymologies.", + "indices": "Indices", + "radical_index": "Radical index", + "indivisible_index": "Indivisible kanji index", + "phonetic_series": "Phonetic series", } JAPANESE = { @@ -65,7 +69,11 @@ JAPANESE = { "incorrect_username": "ユーザー名が違います", "incorrect_password": "パスワードが違います", "about": "漢検オンラインとは", - "about-para": "漢検オンラインとは、漢検一級合格を目当てにした資料を供用しているサイトです。ここで漢検のやく6300字を検索でき、いろんな勉強材を自動的に作ることができます。たとえば、漢検一級模様の試験PDFを作ることができて、本物の漢検試験に大抵該当することが目的です。さらに、色々漢字についての情報を取り集めております。諧声域(かいせいいき)・音韻学・部首・不可分漢字・字源・語源などがその内です。" + "about-para": "漢検オンラインとは、漢検一級合格を目当てにした資料を供用しているサイトです。ここで漢検のやく6300字を検索でき、いろんな勉強材を自動的に作ることができます。たとえば、漢検一級模様の試験PDFを作ることができて、本物の漢検試験に大抵該当することが目的です。さらに、色々漢字についての情報を取り集めております。諧声域(かいせいいき)・音韻学・部首・不可分漢字・字源・語源などがその内です。", + "indices": "索引", + "radical_index": "部首索引", + "indivisible_index": "不可分漢字索引", + "phonetic_series": "諧声域索引", } LANGUAGES = [ diff --git a/kanken_online/templates/base.html b/kanken_online/templates/base.html index f076be9..d6b3c0b 100644 --- a/kanken_online/templates/base.html +++ b/kanken_online/templates/base.html @@ -20,6 +20,7 @@
  • {{ localize("log_in") }} {% endif %}
  • {{ localize("about") }}
  • +
  • {{ localize("indices") }}
  • diff --git a/kanken_online/templates/indices/indices.html b/kanken_online/templates/indices/indices.html new file mode 100644 index 0000000..6b7d512 --- /dev/null +++ b/kanken_online/templates/indices/indices.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} + +{% block header %} +

    {% block title %}{{ localize("indices") }}{% endblock %}

    +{% endblock %} + +{% block content %} + +{% endblock %} \ No newline at end of file diff --git a/kanken_online/templates/indices/indivisible.html b/kanken_online/templates/indices/indivisible.html new file mode 100644 index 0000000..e69de29 diff --git a/kanken_online/templates/indices/phonetic_series.html b/kanken_online/templates/indices/phonetic_series.html new file mode 100644 index 0000000..e69de29 diff --git a/kanken_online/templates/indices/radicals.html b/kanken_online/templates/indices/radicals.html new file mode 100644 index 0000000..e69de29