16 Commits

Author SHA1 Message Date
novgorodschi catalin 41e0fd6313 Some fix
Some fix
2026-06-22 10:41:25 +03:00
Ferywir f581add125 feature(rally-point): mark incoming attacks + show per-troop travel time [#245] (#248) 2026-06-22 06:54:41 +03:00
Ferywir 1b978470c6 fix(session): refresh the 30s user-cache after a player's own changes (#239) 2026-06-18 14:59:44 +03:00
Ferywir cdc736839e i18n(alliance): render alliance news-feed notices in each reader's language (EN/FR/RO) (#238) 2026-06-18 10:22:15 +03:00
Ferywir d008261678 i18n: render system in-game messages in each reader's language (EN/FR/RO) (#237) 2026-06-17 18:19:24 +03:00
Ferywir 51c9cc5b2c i18n: render battle reports in each reader's language (EN/FR/RO) (#236) 2026-06-17 16:24:37 +03:00
Ferywir 827354a622 feat(admin): add transparent debug error-log mode
Add an admin-controlled debug mode that captures PHP errors of all
players into var/log/debug-players.log, to hunt remaining PHP 8.3 bugs
from real play sessions. Fully transparent to players: no redirect, no
gameplay change, errors are never displayed.

- DB: new debug_log table (one row), mirroring the maintenance pattern.
- Database: getDebugMode()/setDebugMode()/setDebugSettings(), defensive
  when the table is absent (no blank page).
- Session: register a custom error + shutdown handler when enabled; the
  handler runs even when php.ini error_reporting masks warnings/notices,
  so capture is complete without a Docker rebuild. Auto-disables after a
  configurable window.
- DebugErrorLogger: size-capped file with a single .log.1 rotation,
  honours the @ operator, never throws.
- Admin: new "Debug Error Log" page (levels, size cap, auto-off, on-page
  viewer, clear, download) + debugLog action mod.
- Menu: admin-only quick on/off widget (TZ_DEBUG_ON/OFF, EN/FR/RO).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 17:18:39 +03:00
Ferywir 63c94fa961 feat(preferences): apply time preference (timezone + date format) [#198]
Implement the "Time Preference" section of the player preferences (issue
#198), which until now was stored in DB but never applied in-game.

procMtime() — the central date/time formatter used across reports, messages,
notices and troop movements — now honours the per-user settings:
  - timezone: the stored value is mapped to a DateTimeZone, either a named
    DST-aware region (Europe, UK, Turkey, Kolkata, Bangkok, New York,
    Chicago, New Zealand) or a fixed UTC offset (general zones); timestamps
    are converted before formatting.
  - tformat: drives the date layout and 12h/24h clock (0=EU dd.mm.yy 24h,
    1=US mm/dd/yy 12h, 2=UK dd/mm/yy 12h, 3=ISO yy/mm/dd 24h). tformat 0
    keeps the previous EU output unchanged.

The today/yesterday sentinels are preserved (callers compare them) and are
computed in the player's timezone. The time-only path (mode 9) stays 24h
H:i:s because it feeds the live JS clock counters (unx.js), which parse
"H:i:s" by splitting on ":". A few alliance/report/farm-list rows that
combined procMtime's day part with a raw date('H:i') now take the time from
the same procMtime result, to avoid mixing timezones.

A second "local time" clock is shown next to the server-time one: a small
vanilla-JS snippet emitted once from menu.tpl finds the visible #tp1 clock
and appends a row ticking in the player's timezone (Date.now() + UTC offset),
independent of the browser timezone and of the unx.js counters. It aligns the
value under the server time, is skipped when the player's timezone matches
the server's, and lets the clock box grow so the extra row fits the frame.

Adds the LOCAL_TIME string (EN/FR/RO). When no player session is available
(admin / pre-login) procMtime falls back to the server timezone and EU
layout, i.e. the previous behaviour. Removes the last "not coded yet" tag
from the preferences form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 16:46:33 +03:00
Ferywir 524b9e7edd fix(i18n): localize statistics page and troops Hero label [#197]
On a fresh install several strings were still hardcoded in English
(reported on the live server, RO locale):

- statistiken.php: the page <title>, the <h1> and the tab bar
  (Player / Alliances / Villages / Heroes / General) were literal English.
- Templates/Ranking/ranksearch.tpl: the "back | forward" pagination links.
- Templates/troops.tpl: the "Hero" troop-row label.

Wire them to language constants. Reuse existing ones
(STATISTICS, PLAYER, PLAYERS, VILLAGES, BACK, FORWARD, U0) and add three
new constants (ALLIANCES, HEROES, GENERAL) to en/fr/ro. WW is kept as-is
(universal acronym).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 18:37:22 +03:00
TravianZ Patcher c91ae5e486 feat(l10n): translate manual new-features pages (FR/RO)
Localize the 17 "new features" manual pages (Templates/Manual/1111-1126.tpl
and the 1331.tpl index, typ=11/13) so they render in the player's language
instead of hardcoded English.

- Replace hardcoded page titles, descriptions and nav tooltips with constants.
- The 1331 index reuses the per-page title constants and gains
  MANUAL_NF_ENABLED / MANUAL_NF_DISABLED for the on/off status labels.
- Add 33 constants each to GameEngine/Lang/{en,fr,ro}.php
  (2 status labels + 15 page titles + 16 descriptions).
- en.php uses tz_def() as the English fallback; fr/ro use define().
- Reuse existing constants where they already exist: VACATION_MODE (page 19),
  NEW_FEATURES, FORWARD, BACK, OVERVIEW.

it/zh fall back to English. RO strings pending native review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 15:45:47 +03:00
TravianZ Patcher 48dde68baa feat(l10n): translate manual unit pages (FR/RO)
Localize the 51 in-game manual unit detail pages (Templates/Manual/1*.tpl,
typ=1) so they render in the player's language instead of English, continuing
the manual l10n started in the building pages PR.

What changed:
- 51 unit pages (Romans/Teutons/Gauls/Nature/Natars) now use translation
  constants for every hardcoded string: tribe tags -> TRIBE1..5, the stat
  labels (attack value, defence vs infantry/cavalry, Velocity, fields/hour,
  Can carry, Duration of training), the unit descriptions, the NPC reference
  notes and the "forward" nav.
- 48 new constants added to en/fr/ro:
  * 7 shared stat labels (MANUAL_ATTACK_VALUE, MANUAL_DEF_INFANTRY,
    MANUAL_DEF_CAVALRY, MANUAL_VELOCITY, MANUAL_FIELDS_HOUR, MANUAL_CAN_CARRY,
    MANUAL_TRAINING_DURATION)
  * 2 NPC reference notes (MANUAL_NPC_NATARS, MANUAL_NPC_NATURE)
  * 1 templated Nature-animal blurb (MANUAL_UDESC_ANIMAL_EXP, used via
    printf with the animal name + xp value, so the 10 animal pages share it)
  * 38 unit descriptions (MANUAL_UDESC_*). Identical descriptions are shared:
    settlers (110/120/130) and rams (117/127) reuse one constant each.
- Reuses constants already present upstream and in the building pages branch:
  TRIBE1..5, LEVEL, FORWARD, CROP_CONSUMPTION, PREREQUISITES, UPKEEP, DURATION,
  RESOURCES, U1..U50.

English render is unchanged: the English constant values are the existing page
text extracted verbatim (whitespace-collapsed). it/zh are intentionally left to
fall back to English via the en.php fallback wired up earlier.

Scope note: this builds on the manual building-pages l10n branch (reuses
CROP_CONSUMPTION). The 17 "new features" pages (typ=11/13) are out of scope and
will be a follow-up PR. RO strings are functional but would benefit from a
native review.
2026-06-10 13:48:02 +02:00
Ferywir 66a07c6819 feat(l10n): translate manual building pages (FR/RO) (#192) 2026-06-09 19:00:08 +03:00
Ferywir e498563555 fix: blank in-game help + untranslated profile after l10n (#189) (#191) 2026-06-09 17:48:16 +03:00
Ferywir dad574be1a feat: reports for settling - new village founded & valley occupied (#178) (#190) 2026-06-09 16:47:29 +03:00
Ferywir 5d366284e6 l10n: full interface translation (FR/RO/IT/ZH) + EN fallback hardening (#186) 2026-06-09 10:28:59 +03:00
novgorodschi catalin 11ce6e6052 Added Romanian Language
Added Romanian Language
2026-06-04 09:39:44 +03:00