Skip to content

Commit d03c480

Browse files
author
Aegis Stack
committed
Update i18n
1 parent 79121c5 commit d03c480

12 files changed

Lines changed: 1293 additions & 102 deletions

File tree

aegis/commands/init.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,15 @@ def init_command(
392392
typer.echo(t("init.removing_dir", path=project_path))
393393
import shutil
394394

395-
shutil.rmtree(project_path)
395+
def _ignore_vanished(_func: object, _path: str, exc_info: object) -> None:
396+
# Git pack-refs and similar create transient files like
397+
# bitmap-ref-tips_* that vanish between enumeration and
398+
# unlink. Swallow FileNotFoundError, re-raise everything else.
399+
exc = exc_info[1] if isinstance(exc_info, tuple) else None
400+
if not isinstance(exc, FileNotFoundError):
401+
raise exc # type: ignore[misc]
402+
403+
shutil.rmtree(project_path, onerror=_ignore_vanished)
396404

397405
# Create project using Copier template engine
398406
typer.echo()

aegis/templates/copier-aegis-project/{{ project_slug }}/app/cli/insights.py.jinja

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def collect(
8989
None, help=lazy_t("insights.arg_source")
9090
),
9191
lookback_days: int = typer.Option(
92-
1, "--lookback-days", "-d", help="Days to fetch (for backfill). Default 1 = today only.",
92+
1, "--lookback-days", "-d", help=lazy_t("insights.opt_lookback_days"),
9393
),
9494
) -> None:
9595
asyncio.run(_collect(source, lookback_days))
@@ -276,8 +276,8 @@ async def _reddit_add(url: str) -> None:
276276
def log_event(
277277
event_type: str = typer.Argument(..., help=lazy_t("insights.arg_event_type")),
278278
description: str = typer.Argument(..., help=lazy_t("insights.arg_description")),
279-
date: str | None = typer.Option(None, "--date", help="Event date (YYYY-MM-DD). Defaults to today."),
280-
category: str | None = typer.Option(None, "--category", help="Milestone category (e.g., daily_clones, pypi_daily)."),
279+
date: str | None = typer.Option(None, "--date", help=lazy_t("insights.opt_event_date")),
280+
category: str | None = typer.Option(None, "--category", help=lazy_t("insights.opt_event_category")),
281281
) -> None:
282282
asyncio.run(_log_event(event_type, description, date, category))
283283

@@ -297,7 +297,10 @@ async def _log_event(
297297
try:
298298
event_date = date_type.fromisoformat(date_str)
299299
except ValueError:
300-
typer.secho(f"Invalid date format: {date_str}. Use YYYY-MM-DD.", fg=typer.colors.RED)
300+
typer.secho(
301+
t("insights.invalid_date_format", date=date_str),
302+
fg=typer.colors.RED,
303+
)
301304
raise typer.Exit(1)
302305

303306
metadata = {}
@@ -314,9 +317,14 @@ async def _log_event(
314317
)
315318
await session.commit()
316319

317-
date_display = date_str or "today"
320+
date_display = date_str or t("insights.today")
318321
typer.secho(
319-
t("insights.event_logged", event_type=event_type, description=description) + f" ({date_display})",
322+
t(
323+
"insights.event_logged_with_date",
324+
event_type=event_type,
325+
description=description,
326+
date=date_display,
327+
),
320328
fg=typer.colors.GREEN,
321329
)
322330

0 commit comments

Comments
 (0)