5 Commits

Author SHA1 Message Date
jack
44d6445bdf
Fix swift build on Xcode 27 and clear its Swift 6.4 warnings (#1795)
* Drop letterless string catalog keys so swift build works on Xcode 27
* Test that every manual catalog key can become a Swift symbol
* Silence Xcode 27's new import and capture warnings
* Drop the try markers Xcode 27 flags as unnecessary in tests
* Drop the try on the ECDH call that stopped throwing in #1782
* Tag the group hashtag with the app language and format the header count

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:17:42 +02:00
Taksh Kothari
711318787c
test(l10n): per-catalog attribution and file:line output for the coverage guard (#1679)
* test(l10n): report file and line for an untranslated key

The catalog guard named only the file a missing key was written in, so
finding it in a 900-line view meant grepping. Collect each literal
`String(localized:)` reference with its repo-relative path and line, and
print one `path:line key` per line instead of a comma-joined blob.

* test(l10n): check each target against the catalog it bundles

The guard accepted a key found in either catalog. The share extension
bundles only its own, so a key it references that lives solely in the app
catalog ships English there just as surely as one that exists nowhere -
which is the gap that let the share-extension strings drift.

Check `bitchat/` against the app catalog and `bitchatShareExtension/`
against the extension catalog, and say in the failure which of the two
cases it is.

* test: check shared sources against the extension catalog too

bitchat/Services/SharedContentHandoff.swift and bitchat/Services/
TransportConfig.swift are compiled into bitchatShareExtension as well
(project.pbxproj membership exceptions), so a key they reference has to
resolve in both catalogs -- each target bundles only its own.

The exception list is read from project.pbxproj rather than hardcoded,
so the check follows the set when it changes.
2026-09-24 09:34:58 +02:00
jack
eca147191c
Add 26 code-referenced keys to the catalog + a test that closes the gap (#1654)
LocalizationCoverageTests validated the catalog but never the code: a
String(localized:) whose key is missing from every catalog compiles
fine and silently ships its English defaultValue to all 29 non-source
locales. That blind spot let 26 keys go untranslated while CI stayed
green: the entire notices/board composer (10), the private-media
encryption warnings and delivery-failure reasons (9), both
courier-header strings, two delivery states, two media failure
reasons, and the [? people] channel row.

- All 26 keys added with full 30-locale coverage.
- New everyCodeReferencedKeyExistsInACatalog scans the source for
  literal String(localized:) keys and fails on any key absent from
  both catalogs. (The audit's original count of 17 was itself an
  undercount — its scan missed multi-line String( localized: calls;
  the test's regex does not.)

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 20:03:23 +02:00
jack
ef848857b7
Remove dead code found by full Periphery audit; add scan config + advisory CI (#1410)
Periphery 3.7.4 audit of both schemes (macOS + iOS, intersected so
platform-specific code is never touched), with test targets indexed and
the share extension built. 277 dead declarations removed or demoted:
dead forwarding wrappers (ChatViewModel+Nostr/+PrivateChat), removed-
feature remnants (autocomplete command suggestions, back-swipe tuning,
MediaSendError, GeohashParticipantTracker), unused Tor dormancy
bindings, assign-only properties, unused parameters (renamed to _), and
redundant public accessibility. 13 orphaned localization keys deleted
across all 29 locales (old pre-#1392 location-notes UI, app_info
warnings).

Two real tests were flagged as unused because they never ran: Swift
Testing methods missing @Test (NostrProtocolTests.
testAckRoundTripNIP44V2_Delivered, NotificationStreamAssemblerTests.
testAssemblesCompressedLargeFrame). Re-armed both; they pass.

Deliberately kept, now recorded in .periphery.baseline.json: iOS-only
code invisible to the CI macOS scan, C FFI signatures, keep-alive
NWPathMonitor reference, InboundEventKey.eventID (dedup semantics),
wifiBulk capability bit (reserved for Wi-Fi bulk work, used by
BitFoundation package tests), and the String secureClear cluster
(exercised by package tests).

New: .periphery.yml config and an advisory Dead Code CI job (mirrors
the SwiftLint precedent from #1361) that fails on findings not in the
committed baseline.

Verified: full macOS app suite, BitFoundation (119) and BitLogger (13)
package tests green; periphery scan --strict exits clean.

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 11:24:19 +02:00
jack
28ffc53f3f
i18n: fill all locale gaps so no string falls back to English (#1393)
Follow-up to #1391 — the Codex review flagged that the new feature-string
batch stopped at vi, omitting fil, pt-BR, zh-Hans, and zh-Hant.

- Translate the 137 feature strings into fil, pt-BR, zh-Hans, zh-Hant (548 entries)
- Translate fingerprint.message.vouched_by (plural) into the 16 locales it
  was missing, with CLDR-correct plural categories per language
- Add the 13 locales missing from the share extension catalog (78 entries),
  bringing it to the same 29 locales as the main app
- Mark the '#%@' channel-hashtag format as shouldTranslate=false like '%@'
- Add LocalizationCoverageTests: fails if any translatable key in either
  catalog is missing any supported locale, or if the share extension
  supports fewer locales than the main app

Machine translations marked needs_review, matching #1391. Verified no
existing translation was altered; full suite (1348 tests) green.

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 17:57:05 +02:00