Add support for French Trade Republic statements
FP
7mo ago+62+62+01234567890123456789-8-8-0123456789
Summary
Trade Republic France delivers account statements in French (Relevé de compte). The current parser handles German, Italian, and English but fails on French PDFs with "Aucune transaction trouvée – veuillez vérifier le PDF."
This PR adds French support to the cash transaction parser.
Changes (single file: js/parser.js)
- French detection: persistent flag set on the first page that contains markers like
SYNTHÈSE DU RELEVÉ DE COMPTE,APERÇU DU SOLDE,REMARQUES SUR LE RELEVÉ DE COMPTE, orENTRÉE D'ARGENT. - Section markers:
- cash start:
TRANSACTIONS(only whenisFrench, to avoid conflicting with the English interest section marker which uses the same word) - cash end:
APERÇU DU SOLDE/REMARQUES SUR LE RELEVÉ
- cash start:
- Cash header keywords: added
ENTRÉE,SORTIE,D'ARGENT,SOLDE. - New
findStackedHeaderhelper for vertically-stacked French headers (ENTRÉEaboveD'ARGENT,SORTIEaboveD'ARGENT). Picks the bottom candidate with the smallest|x - top.x|soSORTIEdoesn't pair with theD'ARGENTunderENTRÉEwhen multipleD'ARGENTitems exist (which would shift the column boundary and misclassify all sells). - SALDO matcher now accepts
SOLDE. - Both ASCII
'and curly’apostrophes supported.
Test plan
- Tested on a 111-page Trade Republic France statement (1765 transactions over ~3 years)
- All cash-flow sanity checks pass (
prev_saldo + entrée − sortie ≈ saldowithin 0.02 €) - Sells (entries with money flowing into cash account) correctly land in
zahlungseingang - Buys, gifts, fees correctly land in
zahlungsausgang - Multi-line transaction layouts (date split as
01 mai/2023) correctly grouped into single rows - German / English / Italian behaviour unchanged (no regressions)
Limitations / not in scope
- Interest section (
TRANSAKTIONSÜBERSICHT) is not localized to French — French statements inline interest asIntérêtsrows in the mainTRANSACTIONStable, which this PR already handles correctly. - Portfolio (
POSITIONEN) and crypto sections are not localized to French. The French equivalents (COMPTES ESPÈCES,FONDS MONÉTAIRE) could be added in a follow-up if needed.