fix(storage): allow S3 without public_url, auto-construct path-style URL from endpoint
This commit is contained in:
@@ -120,7 +120,9 @@ class S3Storage:
|
|||||||
k = _strip_prefix(key)
|
k = _strip_prefix(key)
|
||||||
if self.public_url:
|
if self.public_url:
|
||||||
return f"{self.public_url}/{k}"
|
return f"{self.public_url}/{k}"
|
||||||
return k
|
# fallback: path-style URL from endpoint + bucket
|
||||||
|
ep = self._client._endpoint.host
|
||||||
|
return f"{ep}/{self.bucket}/{k}"
|
||||||
|
|
||||||
|
|
||||||
# ── Helpers ────────────────────────────────────────────────────────
|
# ── Helpers ────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
"""One-time export: convert i18n.py translations to JSON files."""
|
|
||||||
import json
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from app.i18n import _translations
|
|
||||||
|
|
||||||
locales_dir = Path(__file__).resolve().parent / "app" / "locales"
|
|
||||||
locales_dir.mkdir(exist_ok=True)
|
|
||||||
|
|
||||||
langs: dict[str, dict[str, str]] = {}
|
|
||||||
for key, values in _translations.items():
|
|
||||||
for lang, text in values.items():
|
|
||||||
langs.setdefault(lang, {})[key] = text
|
|
||||||
|
|
||||||
for lang, data in sorted(langs.items()):
|
|
||||||
out = locales_dir / f"{lang}.json"
|
|
||||||
with open(out, "w", encoding="utf-8") as f:
|
|
||||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
|
||||||
print(f"Exported {len(data)} keys -> {out.name}")
|
|
||||||
|
|
||||||
print("Done!")
|
|
||||||
Reference in New Issue
Block a user