Enable Melay translation

This commit is contained in:
rubenwardy 2022-01-08 02:34:19 +00:00
parent cf0a69a702
commit b2a72da219
2 changed files with 13 additions and 18 deletions

View File

@ -34,8 +34,9 @@ app.config["FLATPAGES_MARKDOWN_EXTENSIONS"] = MARKDOWN_EXTENSIONS
app.config["FLATPAGES_EXTENSION_CONFIG"] = MARKDOWN_EXTENSION_CONFIG app.config["FLATPAGES_EXTENSION_CONFIG"] = MARKDOWN_EXTENSION_CONFIG
app.config["BABEL_TRANSLATION_DIRECTORIES"] = "../translations" app.config["BABEL_TRANSLATION_DIRECTORIES"] = "../translations"
app.config["LANGUAGES"] = { app.config["LANGUAGES"] = {
"en": "English", "en": "English",
"fr": "Français", "fr": "Français",
"ms": "Bahasa Melayu",
} }
app.config.from_pyfile(os.environ["FLASK_CONFIG"]) app.config.from_pyfile(os.environ["FLASK_CONFIG"])

View File

@ -173,22 +173,16 @@
<i class="fas fa-language"></i> <i class="fas fa-language"></i>
</a> </a>
<ul class="dropdown-menu dropdown-menu-right" role="menu"> <ul class="dropdown-menu dropdown-menu-right" role="menu">
<li class="nav-item"> {% for locale, locale_name in config["LANGUAGES"].items() %}
<form method="POST" action="{{ url_for('set_locale') }}"> <li class="nav-item">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <form method="POST" action="{{ url_for('set_locale') }}">
<input type="hidden" name="locale" value="en" /> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="r" value="{{ url_set_query() }}" /> <input type="hidden" name="locale" value="{{ locale }}" />
<input type="submit" class="btn btn-link nav-link" value="English (en)"> <input type="hidden" name="r" value="{{ url_set_query() }}" />
</form> <input type="submit" class="btn btn-link nav-link" value="{{ locale_name }} ({{ locale }})">
</li> </form>
<li> </li>
<form method="POST" action="{{ url_for('set_locale') }}"> {% endfor %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="hidden" name="locale" value="fr" />
<input type="hidden" name="r" value="{{ url_set_query() }}" />
<input type="submit" class="btn btn-link nav-link" value="Français (fr)">
</form>
</li>
<li class="dropdown-divider"></li> <li class="dropdown-divider"></li>
<li class="nav-item "> <li class="nav-item ">
<a class="nav-link" href="https://hosted.weblate.org/projects/minetest/contentdb/"> <a class="nav-link" href="https://hosted.weblate.org/projects/minetest/contentdb/">