$forall (path, _) <- jfiles j
@@ -15,8 +15,8 @@
#{path}
- Edit
+ _{HMsg "Edit"}
- Upload
+ _{HMsg "Upload"}
- Download
+ _{HMsg "Download"}
diff --git a/hledger-web/templates/register.hamlet b/hledger-web/templates/register.hamlet
index e8f3fe49347..f463a859172 100644
--- a/hledger-web/templates/register.hamlet
+++ b/hledger-web/templates/register.hamlet
@@ -2,18 +2,18 @@
#{header}
- ^{registerChartHtml qparam balancelabel $ accountTransactionsReportByCommodity items}
+ ^{registerChartHtml qparam (T.unpack balancelabel) $ accountTransactionsReportByCommodity items}
|
- Date
+ _{HMsgc "column heading" "Date"}
- | Description
- | To/From Account(s)
- | Amount Out/In
+ | _{HMsgc "column heading" "Description"}
+ | _{HMsgc "column heading" "To/From Account(s)"}
+ | _{HMsgc "column heading" "Amount Out/In"}
|
#{balancelabel}
diff --git a/hledger-web/templates/upload-form.hamlet b/hledger-web/templates/upload-form.hamlet
index 1c36f8833bc..fd71a90537e 100644
--- a/hledger-web/templates/upload-form.hamlet
+++ b/hledger-web/templates/upload-form.hamlet
@@ -1,13 +1,13 @@
- Upload to file #
+ _{HMsg "Upload to file"} #
#{f}
- Are you sure? This will overwrite your journal!
+ _{HMsg "Are you sure? This will overwrite your journal!"}
"
+
yit "keeps the period parameter off the other pages' search forms" $ do
request $ do
setMethod "GET"
diff --git a/hledger-web/Hledger/Web/Widget/Common.hs b/hledger-web/Hledger/Web/Widget/Common.hs
index 6e17ce419bb..5a0f8b902c0 100644
--- a/hledger-web/Hledger/Web/Widget/Common.hs
+++ b/hledger-web/Hledger/Web/Widget/Common.hs
@@ -93,21 +93,24 @@ balanceReportAsHtml (journalR, registerR) here hideEmpty trs j qparam qopts (ite
-- | Links to the balance report page, single-period and for each
-- interval, carrying the current search and date span; the report being
-- shown, identified by the interval it was built with, is marked.
-balanceReportLinks :: r -> Text -> DateSpan -> Interval -> HtmlUrl r
-balanceReportLinks balanceR qparam spn current =
+balanceReportLinks :: r -> Translations -> Text -> DateSpan -> Interval -> HtmlUrl r
+balanceReportLinks balanceR trs qparam spn current =
$(hamletFile "templates/balance-links.hamlet")
where
+ -- TRANSLATORS: the label before the balance page's report links.
+ reportlabel = tr trs "Report:"
-- Each link's label and title is a whole phrase, not a word slotted
-- into a sentence: an adjective that fits one language's sentence does
-- not fit another's, so a translation cannot be assembled from parts.
+ -- TRANSLATORS: the balance page's report links: each link's text, and its tooltip.
reports :: [(Text, Text, Maybe Text, Interval)]
reports =
- [ ("Balance", "Show the balance report", Nothing, NoInterval)
- , ("Yearly", "Show the yearly balance report", Just "yearly", Years 1)
- , ("Quarterly", "Show the quarterly balance report", Just "quarterly", Quarters 1)
- , ("Monthly", "Show the monthly balance report", Just "monthly", Months 1)
- , ("Weekly", "Show the weekly balance report", Just "weekly", Weeks 1)
- , ("Daily", "Show the daily balance report", Just "daily", Days 1)
+ [ (tr trs "Balance", tr trs "Show the balance report", Nothing, NoInterval)
+ , (tr trs "Yearly", tr trs "Show the yearly balance report", Just "yearly", Years 1)
+ , (tr trs "Quarterly", tr trs "Show the quarterly balance report", Just "quarterly", Quarters 1)
+ , (tr trs "Monthly", tr trs "Show the monthly balance report", Just "monthly", Months 1)
+ , (tr trs "Weekly", tr trs "Show the weekly balance report", Just "weekly", Weeks 1)
+ , (tr trs "Daily", tr trs "Show the daily balance report", Just "daily", Days 1)
]
-- Each link keeps the period's date span, so that changing the
-- interval does not silently widen the report to the whole journal.
diff --git a/hledger-web/templates/balance-links.hamlet b/hledger-web/templates/balance-links.hamlet
index 21c6cc077ea..6b7fc4b6da3 100644
--- a/hledger-web/templates/balance-links.hamlet
+++ b/hledger-web/templates/balance-links.hamlet
@@ -1,4 +1,4 @@
- Report:
+ #{reportlabel}
$forall (label, title, mperiod, interval) <- reports
#{label}
From 051bbf657db1b519a1ef92d585a5df87a4efdc38 Mon Sep 17 00:00:00 2001
From: Arthur Cinader <700572+acinader@users.noreply.github.com>
Date: Tue, 29 Sep 2026 10:51:34 -0700
Subject: [PATCH 13/13] cln: cli: local tr helpers, and doc when to use i18n
rather than tr
The report renderers now bind tr, trc and trf to the report options once,
in a where clause, and import Hledger.Utils.I18n qualified, so call sites
read `tr "Balance Sheet"` rather than `tr translations_ "Balance Sheet"`
(suggested in the #2736 review). The module docs now say when to mark a
literal with i18n instead of translating it with tr: only for text stored
in data, such as a report spec, before any catalog is at hand.
AI usage: Claude Fable 5.1, ~2k output tokens.
---
hledger-lib/Hledger/Utils/I18n.hs | 15 ++++-
hledger/Hledger/Cli/Commands/Balance.hs | 60 ++++++++++---------
.../Hledger/Cli/Commands/Balance/Internal.hs | 9 +--
hledger/Hledger/Cli/Commands/Register.hs | 4 +-
hledger/Hledger/Cli/CompoundBalanceCommand.hs | 40 +++++++------
5 files changed, 73 insertions(+), 55 deletions(-)
diff --git a/hledger-lib/Hledger/Utils/I18n.hs b/hledger-lib/Hledger/Utils/I18n.hs
index 3a2abe6df6c..5136cd7076e 100644
--- a/hledger-lib/Hledger/Utils/I18n.hs
+++ b/hledger-lib/Hledger/Utils/I18n.hs
@@ -20,6 +20,13 @@ Conventions:
- Short words used in more than one sense carry a context ('trc').
+- Use 'tr' (or 'trc', 'trf') where text is displayed and a 'Translations'
+ value is at hand, usually from the report options. Use 'i18n' (or
+ 'i18nc') only to mark a literal that is stored earlier, in data such as
+ a report spec or a menu item, before any catalog is available; it is
+ then translated with 'tr' at display time. Both forms are what the
+ catalog extraction tool looks for.
+
- A malformed catalog is reported as a warning and ignored.
This module is experimental and its API may change.
@@ -152,9 +159,11 @@ trn t n singular plural = substitutePlaceholders [("n", T.pack (show n))] form
if T.null f then Nothing else Just f
english = if n == 1 then singular else plural
--- | Mark an English literal that will be translated later, by 'tr', at the
--- point where it is displayed. This is the identity; the catalog
--- extraction tool looks for it. (Like gettext's N_.)
+-- | Mark an English literal that is stored now, in data such as a report
+-- spec or a menu item, and translated later by 'tr' at the point where it
+-- is displayed. This is the identity; its purpose is to make the catalog
+-- extraction tool collect the literal. (Like gettext's N_.) Where a
+-- 'Translations' value is already at hand, use 'tr' directly instead.
i18n :: Text -> Text
i18n = id
diff --git a/hledger/Hledger/Cli/Commands/Balance.hs b/hledger/Hledger/Cli/Commands/Balance.hs
index e52228f0511..04aa625c8af 100644
--- a/hledger/Hledger/Cli/Commands/Balance.hs
+++ b/hledger/Hledger/Cli/Commands/Balance.hs
@@ -301,7 +301,7 @@ import Text.Tabular.AsciiWide
import System.IO qualified as IO
-import Hledger.Utils.I18n (tr, trc, trf)
+import Hledger.Utils.I18n qualified as I18n
import Hledger
import Hledger.Cli.CliOptions
import Hledger.Cli.Utils
@@ -404,7 +404,7 @@ balance opts@CliOpts{reportspec_=rspec} j = case balancecalc_ ropts of
"tsv" -> printTSV . budgetReportAsCsv ropts
"html" -> (<>"\n") . htmlAsLazyText . budgetReportAsHtml ropts
"fods" -> printFods IO.localeEncoding .
- Map.singleton (tr (translations_ ropts) "Budget Report") . budgetReportAsSpreadsheet oneLineNoCostFmt ropts
+ Map.singleton (tr "Budget Report") . budgetReportAsSpreadsheet oneLineNoCostFmt ropts
_ -> error' $ unsupportedOutputFormatError fmt
writeOutputLazyText opts $ render budgetreport
@@ -418,7 +418,7 @@ balance opts@CliOpts{reportspec_=rspec} j = case balancecalc_ ropts of
"html" -> (<>"\n") . htmlAsLazyText . multiBalanceReportAsHtml ropts
"json" -> (<>"\n") . toJsonText
"fods" -> printFods IO.localeEncoding .
- Map.singleton (tr (translations_ ropts) "Multi-period Balance Report") . multiBalanceReportAsSpreadsheet ropts
+ Map.singleton (tr "Multi-period Balance Report") . multiBalanceReportAsSpreadsheet ropts
_ -> const $ error' $ unsupportedOutputFormatError fmt -- PARTIAL:
writeOutputLazyText opts $ render report
@@ -430,11 +430,12 @@ balance opts@CliOpts{reportspec_=rspec} j = case balancecalc_ ropts of
"tsv" -> printTSV . balanceReportAsCsv ropts
"html" -> (<>"\n") . htmlAsLazyText . balanceReportAsHtml ropts
"json" -> (<>"\n") . toJsonText
- "fods" -> printFods IO.localeEncoding . Map.singleton (tr (translations_ ropts) "Balance Report") . (,) (1,0) . balanceReportAsSpreadsheet oneLineNoCostFmt ropts
+ "fods" -> printFods IO.localeEncoding . Map.singleton (tr "Balance Report") . (,) (1,0) . balanceReportAsSpreadsheet oneLineNoCostFmt ropts
_ -> error' $ unsupportedOutputFormatError fmt -- PARTIAL:
writeOutputLazyText opts $ render report
where
styles = journalCommodityStylesWith HardRounding j
+ tr = I18n.tr (translations_ ropts)
ropts =
let ropts0 = _rsReportOpts rspec in
ropts0 {
@@ -789,29 +790,31 @@ multiBalanceReportAsText ropts r = TB.toLazyText $
multiBalanceReportTitle :: ReportOpts -> MultiBalanceReport -> Text
multiBalanceReportTitle ropts@ReportOpts{..} r = effectiveTitle ropts defaultTitle
where
+ tr = I18n.tr translations_
+ trf = I18n.trf translations_
-- TRANSLATORS: the multi-period balance report title, eg "Balance changes in 2024, valued at period ends:".
- defaultTitle = trf translations_ "{report} in {dates}{valuation}:"
+ defaultTitle = trf "{report} in {dates}{valuation}:"
[ ("report", mtitle), ("dates", showDateSpan (periodicReportSpan r)), ("valuation", valuationdesc) ]
mtitle = case (balancecalc_, balanceaccum_) of
- (CalcValueChange, PerPeriod ) -> tr translations_ "Period-end value changes"
- (CalcValueChange, Cumulative ) -> tr translations_ "Cumulative period-end value changes"
- (CalcGain, PerPeriod ) -> tr translations_ "Incremental gain"
- (CalcGain, Cumulative ) -> tr translations_ "Cumulative gain"
- (CalcGain, Historical ) -> tr translations_ "Historical gain"
- (_, PerPeriod ) -> tr translations_ "Balance changes"
- (_, Cumulative ) -> tr translations_ "Ending balances (cumulative)"
- (_, Historical) -> tr translations_ "Ending balances (historical)"
+ (CalcValueChange, PerPeriod ) -> tr "Period-end value changes"
+ (CalcValueChange, Cumulative ) -> tr "Cumulative period-end value changes"
+ (CalcGain, PerPeriod ) -> tr "Incremental gain"
+ (CalcGain, Cumulative ) -> tr "Cumulative gain"
+ (CalcGain, Historical ) -> tr "Historical gain"
+ (_, PerPeriod ) -> tr "Balance changes"
+ (_, Cumulative ) -> tr "Ending balances (cumulative)"
+ (_, Historical) -> tr "Ending balances (historical)"
valuationdesc =
(case conversionop_ of
- Just ToCost -> tr translations_ ", converted to cost"
+ Just ToCost -> tr ", converted to cost"
_ -> "")
<> (case value_ of
- Just (AtThen _mc) -> tr translations_ ", valued at posting date"
+ Just (AtThen _mc) -> tr ", valued at posting date"
Just (AtEnd _mc) | changingValuation -> ""
- Just (AtEnd _mc) -> tr translations_ ", valued at period ends"
- Just (AtNow _mc) -> tr translations_ ", current value"
- Just (AtDate d _mc) -> trf translations_ ", valued at {date}" [("date", showDate d)]
+ Just (AtEnd _mc) -> tr ", valued at period ends"
+ Just (AtNow _mc) -> tr ", current value"
+ Just (AtDate d _mc) -> trf ", valued at {date}" [("date", showDate d)]
Nothing -> "")
changingValuation = case (balancecalc_, balanceaccum_) of
@@ -883,18 +886,20 @@ budgetReportAsText ropts budgetr = TB.toLazyText $
budgetReportTitle :: ReportOpts -> BudgetReport -> Text
budgetReportTitle ropts@ReportOpts{..} budgetr = effectiveTitle ropts defaultTitle
where
+ tr = I18n.tr translations_
+ trf = I18n.trf translations_
-- TRANSLATORS: the budget report title, eg "Budget performance in 2024, valued at period ends:".
- defaultTitle = trf translations_ "Budget performance in {dates}{valuation}:"
+ defaultTitle = trf "Budget performance in {dates}{valuation}:"
[ ("dates", showDateSpan (periodicReportSpan budgetr)), ("valuation", valuationdesc) ]
valuationdesc =
(case conversionop_ of
- Just ToCost -> tr translations_ ", converted to cost"
+ Just ToCost -> tr ", converted to cost"
_ -> "")
<> (case value_ of
- Just (AtThen _mc) -> tr translations_ ", valued at posting date"
- Just (AtEnd _mc) -> tr translations_ ", valued at period ends"
- Just (AtNow _mc) -> tr translations_ ", current value"
- Just (AtDate d _mc) -> trf translations_ ", valued at {date}" [("date", showDate d)]
+ Just (AtThen _mc) -> tr ", valued at posting date"
+ Just (AtEnd _mc) -> tr ", valued at period ends"
+ Just (AtNow _mc) -> tr ", current value"
+ Just (AtDate d _mc) -> trf ", valued at {date}" [("date", showDate d)]
Nothing -> "")
-- | Build a 'Table' from a multi-column balance report.
@@ -912,6 +917,7 @@ budgetReportAsTable ropts@ReportOpts{..} (PeriodicReport spans items totrow) =
(Group budgetTableInterColumnBorder $ map Header colheadings)
rows
where
+ trc = I18n.trc translations_
budgetTableInterRowBorder = NoLine
budgetTableInterColumnBorder = if pretty_ then SingleLine else NoLine
@@ -928,10 +934,10 @@ budgetReportAsTable ropts@ReportOpts{..} (PeriodicReport spans items totrow) =
in
(flip (concatTables SingleLine) $ Table rowhdrs colhdrs totalrows) -- XXX ?
- colheadings = [trc translations_ "column heading" "Commodity" | layout_ == LayoutBare]
+ colheadings = [trc "column heading" "Commodity" | layout_ == LayoutBare]
++ (if not summary_only_ then map (reportPeriodName ropts spans) spans else [])
- ++ [" " <> trc translations_ "column heading" "Total" | row_total_]
- ++ [trc translations_ "column heading" "Average" | average_]
+ ++ [" " <> trc "column heading" "Total" | row_total_]
+ ++ [trc "column heading" "Average" | average_]
(accts, rows, totalrows) =
(accts'
diff --git a/hledger/Hledger/Cli/Commands/Balance/Internal.hs b/hledger/Hledger/Cli/Commands/Balance/Internal.hs
index f2a6ccbccea..a1a642695c8 100644
--- a/hledger/Hledger/Cli/Commands/Balance/Internal.hs
+++ b/hledger/Hledger/Cli/Commands/Balance/Internal.hs
@@ -12,7 +12,7 @@ import Data.Text qualified as T
import Data.Time (addDays)
import Text.Tabular.AsciiWide (Header(..), Properties(..), Table(..), concatTables)
-import Hledger.Utils.I18n (trc)
+import Hledger.Utils.I18n qualified as I18n
import Hledger
import Hledger.Cli.Anchor (setAccountAnchor, dateSpanCell, headerDateSpanCell, renderPeriodHeading)
import Hledger.Write.Spreadsheet (rawTableContent, headerCell,
@@ -117,8 +117,9 @@ multiBalanceReportAsPartTable
(Group multiColumnTableInterColumnBorder $ map Header colheadings)
(concat rows)
where
+ trc = I18n.trc (translations_ opts)
colheadings =
- [trc (translations_ opts) "column heading" "Commodity" | layout_ opts == LayoutBare]
+ [trc "column heading" "Commodity" | layout_ opts == LayoutBare]
++
case layout_ opts of
LayoutBareWide ->
@@ -128,8 +129,8 @@ multiBalanceReportAsPartTable
spanNames =
(guard (not summary_only_) >>
map (reportPeriodName opts spans) spans)
- ++ [" " <> trc (translations_ opts) "column heading" "Total" | multiBalanceHasTotalsColumn opts]
- ++ [trc (translations_ opts) "column heading" "Average" | average_]
+ ++ [" " <> trc "column heading" "Total" | multiBalanceHasTotalsColumn opts]
+ ++ [trc "column heading" "Average" | average_]
(accts, rows) = unzip $ fmap fullRowAsTexts items'
where
isLeaf rs row = not $ any (\r -> T.isPrefixOf (displayFull (prrName row) <> ":") (displayFull (prrName r))) rs
diff --git a/hledger/Hledger/Cli/Commands/Register.hs b/hledger/Hledger/Cli/Commands/Register.hs
index 0f96dfc1bd4..c6dc479b612 100644
--- a/hledger/Hledger/Cli/Commands/Register.hs
+++ b/hledger/Hledger/Cli/Commands/Register.hs
@@ -29,7 +29,7 @@ import Data.Text.Lazy.Builder qualified as TB
import Safe (readMay)
import System.Console.CmdArgs.Explicit (flagNone, flagReq)
-import Hledger.Utils.I18n (tr)
+import Hledger.Utils.I18n qualified as I18n
import Hledger hiding (per)
import Hledger.Write.Csv (CSV, printCSV, printTSV)
import Hledger.Write.Ods (printFods)
@@ -111,7 +111,7 @@ register opts@CliOpts{rawopts_=rawopts, reportspec_=rspec} j
map (map (fmap toHtml)) .
postingsReportAsSpreadsheet opts oneLineNoCostFmt baseUrl query
| fmt=="fods" =
- printFods IO.localeEncoding . Map.singleton (tr (translations_ (_rsReportOpts rspec)) "Register") .
+ printFods IO.localeEncoding . Map.singleton (I18n.tr (translations_ (_rsReportOpts rspec)) "Register") .
(,) (1,0) .
postingsReportAsSpreadsheet opts oneLineNoCostFmt baseUrl query
| otherwise = error' $ unsupportedOutputFormatError fmt -- PARTIAL:
diff --git a/hledger/Hledger/Cli/CompoundBalanceCommand.hs b/hledger/Hledger/Cli/CompoundBalanceCommand.hs
index 14f334703d5..4606c326f1b 100644
--- a/hledger/Hledger/Cli/CompoundBalanceCommand.hs
+++ b/hledger/Hledger/Cli/CompoundBalanceCommand.hs
@@ -36,7 +36,7 @@ import Text.Blaze.Html5 qualified as H
import Text.Blaze.Html5.Attributes qualified as A
import Text.Tabular.AsciiWide as Tabular hiding (render)
-import Hledger.Utils.I18n (noTranslations, tr, trf)
+import Hledger.Utils.I18n qualified as I18n
import Hledger
import Hledger.Cli.Commands.Balance
import Hledger.Cli.CliOptions
@@ -149,11 +149,13 @@ compoundBalanceCommand CompoundBalanceCommandSpec{..} opts@CliOpts{reportspec_=r
balanceaccumulation = fromMaybe cbcaccum mbalanceAccumulationOverride
-- Set balance type in the report options.
ropts' = ropts{balanceaccum_=balanceaccumulation}
+ tr = I18n.tr translations_
+ trf = I18n.trf translations_
-- TRANSLATORS: the report title, eg "Monthly Balance Sheet 2024 (Historical Ending Balances), valued at period ends".
-- {clarification} brings its own leading space when present.
- title = trf translations_ "{report} {dates}{clarification}{valuation}"
- [ ("report", tr translations_ $ cbctitle $ titleInterval interval_)
+ title = trf "{report} {dates}{clarification}{valuation}"
+ [ ("report", tr $ cbctitle $ titleInterval interval_)
, ("dates", titledatestr)
, ("clarification", maybe "" (" " <>) mtitleclarification)
, ("valuation", valuationdesc)
@@ -175,26 +177,26 @@ compoundBalanceCommand CompoundBalanceCommandSpec{..} opts@CliOpts{reportspec_=r
-- when user overrides, add an indication to the report title
-- Do we need to deal with overridden BalanceCalculation?
mtitleclarification = case (balancecalc_, balanceaccumulation, mbalanceAccumulationOverride) of
- (CalcValueChange, PerPeriod, _ ) -> Just $ tr translations_ "(Period-End Value Changes)"
- (CalcValueChange, Cumulative, _ ) -> Just $ tr translations_ "(Cumulative Period-End Value Changes)"
- (CalcGain, PerPeriod, _ ) -> Just $ tr translations_ "(Incremental Gain)"
- (CalcGain, Cumulative, _ ) -> Just $ tr translations_ "(Cumulative Gain)"
- (CalcGain, Historical, _ ) -> Just $ tr translations_ "(Historical Gain)"
- (_, _, Just PerPeriod ) -> Just $ tr translations_ "(Balance Changes)"
- (_, _, Just Cumulative) -> Just $ tr translations_ "(Cumulative Ending Balances)"
- (_, _, Just Historical) -> Just $ tr translations_ "(Historical Ending Balances)"
+ (CalcValueChange, PerPeriod, _ ) -> Just $ tr "(Period-End Value Changes)"
+ (CalcValueChange, Cumulative, _ ) -> Just $ tr "(Cumulative Period-End Value Changes)"
+ (CalcGain, PerPeriod, _ ) -> Just $ tr "(Incremental Gain)"
+ (CalcGain, Cumulative, _ ) -> Just $ tr "(Cumulative Gain)"
+ (CalcGain, Historical, _ ) -> Just $ tr "(Historical Gain)"
+ (_, _, Just PerPeriod ) -> Just $ tr "(Balance Changes)"
+ (_, _, Just Cumulative) -> Just $ tr "(Cumulative Ending Balances)"
+ (_, _, Just Historical) -> Just $ tr "(Historical Ending Balances)"
_ -> Nothing
valuationdesc =
(case conversionop_ of
- Just ToCost -> tr translations_ ", converted to cost"
+ Just ToCost -> tr ", converted to cost"
_ -> "")
<> (case value_ of
- Just (AtThen _mc) -> tr translations_ ", valued at posting date"
+ Just (AtThen _mc) -> tr ", valued at posting date"
Just (AtEnd _mc) | changingValuation -> ""
- Just (AtEnd _mc) -> tr translations_ ", valued at period ends"
- Just (AtNow _mc) -> tr translations_ ", current value"
- Just (AtDate today _mc) -> trf translations_ ", valued at {date}" [("date", showDate today)]
+ Just (AtEnd _mc) -> tr ", valued at period ends"
+ Just (AtNow _mc) -> tr ", current value"
+ Just (AtDate today _mc) -> trf ", valued at {date}" [("date", showDate today)]
Nothing -> "")
changingValuation = case (balancecalc_, balanceaccum_) of
@@ -208,7 +210,7 @@ compoundBalanceCommand CompoundBalanceCommandSpec{..} opts@CliOpts{reportspec_=r
cbr' = compoundBalanceReport rspec{_rsReportOpts=ropts'} j cbcqueries
cbr = applySubreportTitles ropts' $
cbr'{cbrTitle = effectiveTitle ropts' title
- ,cbrSubreports = [ (tr translations_ t, r, b) | (t, r, b) <- cbrSubreports cbr' ]}
+ ,cbrSubreports = [ (tr t, r, b) | (t, r, b) <- cbrSubreports cbr' ]}
-- render appropriately
render = case outputFormatFromOpts opts of
@@ -309,7 +311,7 @@ compoundBalanceReportAsText ropts (CompoundPeriodicReport title _colspans subrep
-- ]
coltotalslines = multiBalanceRowAsText ropts allCommodities totalsrow
totalstable = Table
- (Group NoLine $ map Header $ tr (translations_ ropts) "Net:" : replicate (length coltotalslines - 1) "") -- row headers
+ (Group NoLine $ map Header $ I18n.tr (translations_ ropts) "Net:" : replicate (length coltotalslines - 1) "") -- row headers
(Header []) -- column headers, concatTables will discard these
coltotalslines -- cell values
@@ -389,7 +391,7 @@ compoundBalanceReportAsSpreadsheet fmt accountLabel maybeBlank ropts cbr =
(guard (layout_ ropts /= LayoutTidy) >>) $
map
-- column headings stay English in these formats, month names included
- (reportPeriodName ropts{translations_ = noTranslations} colspans)
+ (reportPeriodName ropts{translations_ = I18n.noTranslations} colspans)
(if not (summary_only_ ropts) then colspans else []) ++
(guard (multiBalanceHasTotalsColumn ropts) >> ["Total"]) ++
(guard (average_ ropts) >> ["Average"])
| |