platzky 1.3.0__tar.gz → 1.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {platzky-1.3.0 → platzky-1.3.1}/PKG-INFO +1 -1
- {platzky-1.3.0 → platzky-1.3.1}/platzky/config.py +0 -2
- {platzky-1.3.0 → platzky-1.3.1}/platzky/engine.py +4 -10
- {platzky-1.3.0 → platzky-1.3.1}/pyproject.toml +1 -1
- {platzky-1.3.0 → platzky-1.3.1}/LICENSE +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/README.md +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/__init__.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/admin.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/fake_login.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/templates/admin.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/templates/login.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/admin/templates/module.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/__init__.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/constants.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/core.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/attachment/mime_validation.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/blog/__init__.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/blog/blog.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/blog/comment_form.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/README.md +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/__init__.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/db_loader.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/github_json_db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/google_json_db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/graph_ql_db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/json_db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/json_file_db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/db/mongodb_db.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/locale/en/LC_MESSAGES/messages.po +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/locale/pl/LC_MESSAGES/messages.po +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/models.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/notifier.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/platzky.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/plugin/plugin.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/plugin/plugin_loader.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/seo/seo.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/static/blog.css +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/static/styles.css +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/telemetry.py +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/404.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/base.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/blog.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/body_meta.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/dynamic_css.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/feed.xml +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/head_meta.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/page.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/post.html +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/robots.txt +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/templates/sitemap.xml +0 -0
- {platzky-1.3.0 → platzky-1.3.1}/platzky/www_handler.py +0 -0
|
@@ -231,7 +231,6 @@ class Config(StrictBaseModel):
|
|
|
231
231
|
seo_prefix: URL prefix for SEO routes
|
|
232
232
|
blog_prefix: URL prefix for blog routes
|
|
233
233
|
languages: Supported languages configuration
|
|
234
|
-
domain_to_lang: Domain to language mapping
|
|
235
234
|
translation_directories: Additional translation directories
|
|
236
235
|
debug: Enable debug mode
|
|
237
236
|
testing: Enable testing mode
|
|
@@ -247,7 +246,6 @@ class Config(StrictBaseModel):
|
|
|
247
246
|
seo_prefix: str = Field(default="/", alias="SEO_PREFIX")
|
|
248
247
|
blog_prefix: str = Field(default="/", alias="BLOG_PREFIX")
|
|
249
248
|
languages: Languages = Field(default_factory=dict, alias="LANGUAGES")
|
|
250
|
-
domain_to_lang: dict[str, str] = Field(default_factory=dict, alias="DOMAIN_TO_LANG")
|
|
251
249
|
translation_directories: list[str] = Field(
|
|
252
250
|
default_factory=list,
|
|
253
251
|
alias="TRANSLATION_DIRECTORIES",
|
|
@@ -102,19 +102,13 @@ class Engine(Flask):
|
|
|
102
102
|
self.dynamic_head += body
|
|
103
103
|
|
|
104
104
|
def get_locale(self) -> str:
|
|
105
|
-
domain = request.headers.get("Host", "localhost")
|
|
106
|
-
domain_to_lang = self.config.get("DOMAIN_TO_LANG")
|
|
107
|
-
|
|
108
105
|
languages = self.config.get("LANGUAGES", {}).keys()
|
|
109
|
-
backup_lang = session.get(
|
|
110
|
-
"language",
|
|
111
|
-
request.accept_languages.best_match(languages, "en"),
|
|
112
|
-
)
|
|
113
106
|
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
session_lang = session.get("language")
|
|
108
|
+
if isinstance(session_lang, str) and session_lang in languages:
|
|
109
|
+
lang = session_lang
|
|
116
110
|
else:
|
|
117
|
-
lang =
|
|
111
|
+
lang = request.accept_languages.best_match(languages) or "en"
|
|
118
112
|
|
|
119
113
|
session["language"] = lang
|
|
120
114
|
return lang
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|