Translate the whole site to English: English routes with 301 redirects from the Dutch paths, English UI, docs, seeds and captions, one-time live content migration
This commit is contained in:
+12
-12
@@ -36,7 +36,7 @@ def prepare():
|
||||
def _user(username):
|
||||
user = get_user_by_username(username)
|
||||
if user is None:
|
||||
raise SystemExit(f"Onbekende gebruiker: {username}")
|
||||
raise SystemExit(f"Unknown user: {username}")
|
||||
return user
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ def apikey_backfill(args):
|
||||
if not user.get("api_key"):
|
||||
update_user(user["uid"], api_key=generate_uid())
|
||||
changed += 1
|
||||
print(f"{changed} sleutels aangevuld")
|
||||
print(f"{changed} keys filled in")
|
||||
|
||||
|
||||
def posts_list(args):
|
||||
@@ -89,12 +89,12 @@ def read_source(path):
|
||||
def posts_import(args):
|
||||
path = Path(args.path)
|
||||
if not path.is_file():
|
||||
raise SystemExit(f"Bestand niet gevonden: {path}")
|
||||
raise SystemExit(f"File not found: {path}")
|
||||
body = read_source(path)
|
||||
title = args.title or path.stem.replace("-", " ").replace("_", " ").strip().capitalize()
|
||||
author = bootstrap_admin() or _user(config.ADMIN_USERNAME)
|
||||
post = create_post(author, title, body, args.topic, "published" if args.publish else "draft")
|
||||
print(f"Geimporteerd: {post['uid']} {post['title']}")
|
||||
print(f"Imported: {post['uid']} {post['title']}")
|
||||
|
||||
|
||||
def joins_list(args):
|
||||
@@ -110,43 +110,43 @@ def backups_list(args):
|
||||
def backups_run(args):
|
||||
row = enqueue_backup(args.target, None)
|
||||
ok = process_backup(row, args.codec)
|
||||
print("klaar" if ok else "mislukt")
|
||||
print("done" if ok else "failed")
|
||||
return 0 if ok else 1
|
||||
|
||||
|
||||
def backups_prune(args):
|
||||
count = prune_backups(args.keep, dry_run=args.dry_run)
|
||||
print(f"{count} archieven {'zouden worden verwijderd' if args.dry_run else 'verwijderd'}")
|
||||
print(f"{count} archives {'would be removed' if args.dry_run else 'removed'}")
|
||||
|
||||
|
||||
def backups_clear(args):
|
||||
count = clear_backups(dry_run=args.dry_run)
|
||||
print(f"{count} archieven {'zouden worden verwijderd' if args.dry_run else 'verwijderd'}")
|
||||
print(f"{count} archives {'would be removed' if args.dry_run else 'removed'}")
|
||||
|
||||
|
||||
def sessions_prune(args):
|
||||
print(f"{prune_expired_sessions(dry_run=args.dry_run)} verlopen sessies")
|
||||
print(f"{prune_expired_sessions(dry_run=args.dry_run)} expired sessions")
|
||||
|
||||
|
||||
def audit_prune(args):
|
||||
cutoff = (datetime.now(timezone.utc) - timedelta(days=args.days)).isoformat()
|
||||
print(f"{prune_audit(cutoff, dry_run=args.dry_run)} auditregels ouder dan {args.days} dagen")
|
||||
print(f"{prune_audit(cutoff, dry_run=args.dry_run)} audit rows older than {args.days} days")
|
||||
|
||||
|
||||
def system_prune(args):
|
||||
orphans = orphan_blobs()
|
||||
for path in orphans:
|
||||
print(("zou verwijderen: " if args.dry_run else "verwijderd: ") + str(path))
|
||||
print(("would remove: " if args.dry_run else "removed: ") + str(path))
|
||||
if not args.dry_run:
|
||||
path.unlink(missing_ok=True)
|
||||
print(f"{len(orphans)} wees-blobs")
|
||||
print(f"{len(orphans)} orphan blobs")
|
||||
|
||||
|
||||
def system_sql_lint(args):
|
||||
problems = lint()
|
||||
for problem in problems:
|
||||
print(problem)
|
||||
print(f"{len(problems)} problemen")
|
||||
print(f"{len(problems)} problems")
|
||||
return 1 if problems else 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user