Add kanji indices

This commit is contained in:
Kiril Kovachev 2024-10-14 16:34:31 +01:00
parent 3b09ea2dda
commit 5d6ededd57
8 changed files with 47 additions and 5 deletions

View File

@ -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

19
kanken_online/indices.py Normal file
View File

@ -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")

View File

@ -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": "漢検オンラインとは、漢検一級合格を目当てにした資料を供用しているサイトです。ここで漢検のやく字を検索でき、いろんな勉強材を自動的に作ることができます。たとえば、漢検一級模様の試験PDFを作ることができて、本物の漢検試験に大抵該当することが目的です。さらに、色々漢字についての情報を取り集めております。諧声域かいせいいき・音韻学・部首・不可分漢字・字源・語源などがその内です。"
"about-para": "漢検オンラインとは、漢検一級合格を目当てにした資料を供用しているサイトです。ここで漢検のやく字を検索でき、いろんな勉強材を自動的に作ることができます。たとえば、漢検一級模様の試験PDFを作ることができて、本物の漢検試験に大抵該当することが目的です。さらに、色々漢字についての情報を取り集めております。諧声域かいせいいき・音韻学・部首・不可分漢字・字源・語源などがその内です。",
"indices": "索引",
"radical_index": "部首索引",
"indivisible_index": "不可分漢字索引",
"phonetic_series": "諧声域索引",
}
LANGUAGES = [

View File

@ -20,6 +20,7 @@
<li><a href="{{ url_for('auth.login') }}">{{ localize("log_in") }}</a>
{% endif %}
<li><a href="{{ url_for('about_page') }}">{{ localize("about") }}</a></li>
<li><a href="{{ url_for('indices.indices_page') }}">{{ localize("indices") }}</a></li>
</ul>
</nav>
<section class="content">

View File

@ -0,0 +1,13 @@
{% extends 'base.html' %}
{% block header %}
<h1>{% block title %}{{ localize("indices") }}{% endblock %}</h1>
{% endblock %}
{% block content %}
<ul id="index-list">
<li id="radicals"><a href="{{ url_for('indices.kanji_radicals') }}">{{ localize("radical_index") }}</a></li>
<li id="radicals"><a href="{{ url_for('indices.indivisible_kanji') }}">{{ localize("indivisible_index") }}</a></li>
<li id="radicals"><a href="{{ url_for('indices.phonetic_series') }}">{{ localize("phonetic_series") }}</a></li>
</ul>
{% endblock %}