Skip to content

fix(i18n): correct zh-TW memory term, recompile stale .mo catalogs; close #41 - #106

Merged
TheWitness merged 2 commits into
developfrom
fix/open-issues-37-41-91
Dec 3, 2026
Merged

TheWitness merged 2 commits into
developfrom
fix/open-issues-37-41-91

Conversation

@TheWitness

@TheWitness TheWitness commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #91
Closes #41

Fixes the remaining items of #91 and closes #41, which develop already covers. #37 stays open (see below).

#91 — i18n defects

Most of #91 was already fixed by #96. Re-checked on current develop:

Finding Status
sv-SE msgfmt --check-format fatal error already fixed (all 42 .po pass)
11 .po missing Plural-Forms already fixed (none missing)
he-IL Rescan VNC mojibake already fixed
orphan ka.mo / hi.mo already removed
zh-CN Processes = 流程 already fixed (进程)
zh-TW 軟件 leak already fixed
zh-TW Memory (MB) = 記憶(MB) fixed here
.mo binaries match active .po fixed here

Changes:

  • zh-TW: Memory (MB), Avg Mem, Avg Memory and Max Memory now use 記憶體 (computer memory) instead of 記憶 (human memory), matching the rest of the catalog (最大記憶體, 記憶體使用率, …).
  • zh-TW fuzzy/mistranslated entries: Collection (was 地點 'location'), Last Run / Last Success / Last Seen (were 最近一次登入 'last login'), System (was 系統名稱 'system name'), Processors (was 處理程序 'processes'), Process CPU and Memory and Nothing has been collected from this Device yet. now have correct translations, and their fuzzy flags are cleared. These are the entries the i18n msgcheck --error-on-fuzzy job flags in zh-TW.
  • All .mo files recompiled from their .po (same msgfmt call as locales/build_gettext.sh, plus --check --check-format). Every compiled catalog was stale. Each one still contained strings removed from the sources (for example Choose an action:) and the old Weblate placeholder headers.

#41 — defense-in-depth audit

No code changes are needed. The audit's own status says "no diff (already on develop)", and the hardening merged since then (#49, #103, …) covers the listed categories. I checked the current tree again:

  • no unserialize/exec/eval/shell calls; selected_items go through sanitize_unserialize_selected_items()
  • all SQL takes bound values or whitelisted identifiers (sort columns use in_array(..., true); the poller purge uses a fixed table list)
  • state-changing endpoints check POST + csrf_check()
  • the OS-type CSV import escapes every echoed value; the header echo only contains whitelisted column names
  • includes use only __DIR__/$config paths

#37 — not addressed here (intentionally)

The bugs are in ss_hmib_sum_apps.php / hmib_sum_apps.xml and their device-level counterparts. Those files only exist inside the signed templates/*.xml.gz packages, so they'll be fixed and re-signed separately before release. #37 stays open to track that.

Validation

  • msgfmt --check --check-format passes for all 42 catalogs
  • msgunfmt of each recompiled .mo matches its .po
  • No PHP or translatable source strings changed, so cacti.pot is unchanged

- zh-TW: translate Memory (MB), Avg Mem, Avg Memory and Max Memory with
  ??? (computer memory) instead of ?? (human memory), matching the
  rest of the catalog.
- Recompile every locales/LC_MESSAGES/*.mo from its .po. The compiled
  catalogs still carried strings removed from the sources (e.g.
  "Choose an action:") and stale Weblate headers.

Fixes #91
Closes #41

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Direct edits to the Weblate-owned zh-TW catalog risk conflicts with translation syncs; the four corrections should be submitted through Weblate and removed from this PR.

1 open issue
What changed in this PR

Addresses remaining localization issues from #91 in Cacti’s Host MIB plugin, without changing PHP behavior.

Changes:

  • Corrects four Traditional Chinese memory labels to use 記憶體.
  • Adds a changelog entry documenting the terminology fixes and catalog recompilation.
File Description
locales/​po/​zh-TW.po Corrects computer-memory terminology in four translations.
CHANGELOG.md Records the translation fixes and compiled-catalog refresh.

Review effort: Balanced

Comment thread locales/po/zh-TW.po Resolved
The zh-TW catalog carried fuzzy guesses merged from unrelated strings
(Collection as "location", Last Run/Last Success/Last Seen as "last
login", Processors as "processes", System as "system name", Process
CPU and Memory as "top processes by memory"). Translate them properly,
clear the fuzzy flags and recompile zh-TW.mo.

Refs #91

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit e2cff3d into develop Dec 3, 2026
8 checks passed
@TheWitness
TheWitness deleted the fix/open-issues-37-41-91 branch December 3, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants