diff --git a/kanken_online/__init__.py b/kanken_online/__init__.py index 65463e2..284616b 100644 --- a/kanken_online/__init__.py +++ b/kanken_online/__init__.py @@ -74,6 +74,21 @@ def create_app(test_config=None): def kotoba_page(kotoba: str): return render_template("kotoba.html", kotoba=kotoba) + @app.route("/translations", methods=["GET", "POST"]) + def strings_translation(): + if request.method == "GET": + strings = {} + for language, language_data in lang.LANGUAGES.items(): + strings[language] = { + string: translation for string, translation in language_data.items() + } + + return render_template("translations.html", strings=strings) + else: + # TODO + print(request.form) + return redirect("/translations") + from . import database database.initialize_app(app) diff --git a/kanken_online/lang.py b/kanken_online/lang.py index 01f5a72..a9a6e9a 100644 --- a/kanken_online/lang.py +++ b/kanken_online/lang.py @@ -21,7 +21,8 @@ EXISTING_STRINGS = { "incorrect_password" "about", "about-para", - "indices" + "indices", + "translations" } ENGLISH = { @@ -52,7 +53,8 @@ ENGLISH = { "dark_theme": "Dark theme", "light_theme": "Light theme", "language": "Language", - "theme": "Color settings" + "theme": "Color settings", + "translations": "Translations", } JAPANESE = { @@ -83,7 +85,8 @@ JAPANESE = { "dark_theme": "ダークモード", "light_theme": "ライトモード", "language": "言語", - "theme": "色設定" + "theme": "色設定", + "translations": "翻訳", } LANGUAGES = { diff --git a/kanken_online/templates/translations.html b/kanken_online/templates/translations.html new file mode 100644 index 0000000..7d205b3 --- /dev/null +++ b/kanken_online/templates/translations.html @@ -0,0 +1,19 @@ +{% extends 'base.html' %} + +{% block header %} +