Skip to content

Commit

Permalink
Put common strings into B_TRANSLATE_CONTEXT "CommonTerms"
Browse files Browse the repository at this point in the history
Some terms come up again and again and create duplicate work for the
translations. Using B_TRANSLATE_CONTEXT "CommonTerms" for those
makes sure it's only translated once.

Updated en.catkeys
  • Loading branch information
humdingerb committed May 28, 2024
1 parent 90fdefc commit d7c1d91
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 145 deletions.
87 changes: 27 additions & 60 deletions locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 English application/x-vnd.wgp-CapitalBe 2547615332
1 English application/x-vnd.wgp-CapitalBe 248763939
Year ReportWindow Year
None ReportWindow None
Export to QIF file… MainWindow Export to QIF file…
Expand All @@ -8,7 +8,6 @@ Annually BudgetWindow Annually
Report a bug… MainWindow Report a bug…
Category is missing CategoryWindow Category is missing
OK PrefWindow OK
Category CheckView Category
Cancel TransferWindow Cancel
Weekly BudgetWindow Weekly
Enter CheckView Enter
Expand All @@ -19,14 +18,12 @@ Cancel CategoryWindow Cancel
Transfer from '%%PAYEE%%' MainWindow Transfer from '%%PAYEE%%'
You need to enter the date for the statement to 'Quick balance'. ReconcileWindow You need to enter the date for the statement to 'Quick balance'.
Cancel ScheduleAddWindow Cancel
Payee: %s ScheduleAddWindow Payee: %s
Default account settings: PrefWindow Default account settings:
Account total MainWindow Account total
CapitalBe System name CapitalBe
Total: %sum% SplitView Total: %sum%
Import from QIF file… MainWindow Import from QIF file…
Ending date: ReportWindow Ending date:
Split ScheduledTransItem Split
Scheduled transactions MainWindow Scheduled transactions
Separator: PrefWindow Separator:
Help: Report ReportWindow Help: Report
Bank charges ReconcileWindow Bank charges
Expand All @@ -37,42 +34,35 @@ You need to select an account in order to reconcile it. MainWindow You need to
Spending category CategoryWindow Spending category
Add… CategoryWindow Add…
Total NetWorthReport Total
Category SplitView Category
Transactions ReportWindow Transactions
Date ReconcileWindow Date
Income category CategoryWindow Income category
Add item SplitView Add item
This transaction belongs to a closed account and cannot be edited. Please reopen the account if you need to make changes. MainWindow This transaction belongs to a closed account and cannot be edited. Please reopen the account if you need to make changes.
Total BudgetWindow Total
Memo TransactionReport Memo
Edit transaction TransactionEdit Edit transaction
Closed account MainWindow Closed account
Enter SplitView Enter
Category CashFlowReport Category
Reports: ReportWindow Reports:
Subtotal: ReportWindow Subtotal:
Highest BudgetWindow Highest
You need to have at least 2 accounts to perform a transfer. MainWindow You need to have at least 2 accounts to perform a transfer.
Monthly ScheduleListWindow Monthly
Category BudgetWindow Category
Frequency BudgetWindow Frequency
CapitalBe didn't understand the amount for 'Bank charges' ReconcileWindow CapitalBe didn't understand the amount for 'Bank charges'
Subtotal ReportWindow Subtotal
You need to enter a check number or transaction type, such as ATM (for debit card transactions and the like), DEP (for deposits), or your own code for some other kind of expense. CheckView You need to enter a check number or transaction type, such as ATM (for debit card transactions and the like), DEP (for deposits), or your own code for some other kind of expense.
Uncategorized SplitView Uncategorized
Date CommonTerms Date
Frequency ScheduleListWindow Frequency
Split TransactionEdit Split
CapitalBe understands lots of different ways of entering dates. Apparently, this wasn't one of them. You'll need to change how you entered this date. Sorry. TextInput CapitalBe understands lots of different ways of entering dates. Apparently, this wasn't one of them. You'll need to change how you entered this date. Sorry.
Settings PrefWindow Settings
Cancel ReconcileWindow Cancel
Category TransactionReport Category
Amount ScheduleListWindow Amount
Help: Main window CheckView Help: Main window
Spending CategoryWindow Spending
Reconcile… MainWindow Reconcile…
Spending BudgetWindow Spending
Type TransactionReport Type
Reopen MainWindow Reopen
Edit… CategoryWindow Edit…
Annually ScheduleAddWindow Annually
Close MainWindow Close
Split CommonTerms Split
Import MainWindow Import
Interest earned ReconcileWindow Interest earned
Quit Locale Quit
Expand All @@ -81,156 +71,136 @@ Add category CategoryWindow Add category
Could not export your financial data to the file '%%FILENAME%%' MainWindow Could not export your financial data to the file '%%FILENAME%%'
Name: Account Name:
Total deposits: %s ReconcileWindow Total deposits: %s
Memo CommonTerms Memo
Save bugreport Locale Save bugreport
Amount CheckView Amount
Type CommonTerms Type
Indefinitely ScheduleAddWindow Indefinitely
Cancel MainWindow Cancel
<No accounts> MainWindow <No accounts>
There may be a typo or the wrong kind of currency symbol for this account. TextInput There may be a typo or the wrong kind of currency symbol for this account.
Categories ReportWindow Categories
Repeat: ScheduleAddWindow Repeat:
Appears before amount PrefWindow Appears before amount
Unreconciled total: %s ReconcileWindow Unreconciled total: %s
Date TransactionReport Date
Couldn't Quick balance ReconcileWindow Couldn't Quick balance
There may be a typo or the wrong kind of currency symbol for this account. ReconcileWindow There may be a typo or the wrong kind of currency symbol for this account.
Payee CheckView Payee
Really delete account? MainWindow Really delete account?
DEP ReconcileWindow DEP
Income BudgetWindow Income
Remove ScheduleListWindow Remove
Quick balance ReconcileWindow Quick balance
Remove ScheduleListWindow Remove
This happens when the kind of file is not supported, when the file's data is damaged, or when you feed it a recipe for quiche. MainWindow This happens when the kind of file is not supported, when the file's data is damaged, or when you feed it a recipe for quiche.
Payments ScheduleListWindow Payments
Month ReportWindow Month
Payments ScheduleListWindow Payments
No memo TransactionEdit No memo
Closed Account Closed
Memo ScheduleAddWindow Memo
Scheduled transactions… MainWindow Scheduled transactions…
Delete MainWindow Delete
Date format: %s PrefWindow Date format: %s
From account: TransferWindow From account:
Quick balance successful! ReconcileWindow Quick balance successful!
Quarter ReportWindow Quarter
Account interest ReconcileWindow Account interest
Schedule this transaction… MainWindow Schedule this transaction…
Payee ScheduleListWindow Payee
Name: CategoryWindow Name:
Symbol: PrefWindow Symbol:
Transactions TransactionReport Transactions
Spending CommonTerms Spending
CapitalBe didn't understand the amount TextInput CapitalBe didn't understand the amount
Average BudgetWindow Average
Currency PrefWindow Currency
Summary BudgetWindow Summary
You need to enter a payee. TextInput You need to enter a payee.
Ending balance ReconcileWindow Ending balance
Category ScheduleAddWindow Category
Frequency ScheduleAddWindow Frequency
Accounts: ReportWindow Accounts:
Help: Main window MainWindow Help: Main window
Cancel Account Cancel
Options PrefWindow Options
Edit category BudgetWindow Edit category
Reconcile ReconcileWindow Reconcile
CapitalBe uses the words 'Income', 'Spending', and 'Split' for managing categories, so you can't use them as category names. Please choose a different name for your new category. CategoryWindow CapitalBe uses the words 'Income', 'Spending', and 'Split' for managing categories, so you can't use them as category names. Please choose a different name for your new category.
Weekly ScheduleListWindow Weekly
Amount SplitView Amount
Please choose a new category for all transactions currently in the '%%CATEGORY_NAME%%' category. CategoryWindow Please choose a new category for all transactions currently in the '%%CATEGORY_NAME%%' category.
Reset ReconcileWindow Reset
Frequency: ScheduleAddWindow Frequency:
The split total must match the amount box SplitView The split total must match the amount box
About CapitalBe MainWindow About CapitalBe
No memo ScheduledTransItem No memo
Payee SplitView Payee
Can't use this category name CategoryWindow Can't use this category name
Do you want to add this transaction without a category? CategoryWindow Do you want to add this transaction without a category?
Budget BudgetWindow Budget
Monthly BudgetWindow Monthly
OK TransferWindow OK
Total worth NetWorthReport Total worth
Memo CheckView Memo
times ScheduleAddWindow times
Annually ScheduleListWindow Annually
Oops! MainWindow Oops!
Memo: TransferWindow Memo:
Edit… MainWindow Edit…
OK CategoryWindow OK
Spending ReportWindow Spending
Help: Transaction editor SplitView Help: Transaction editor
Total: SplitView Total:
Unlimited ScheduleListWindow Unlimited
Set all to zero BudgetWindow Set all to zero
When the split items are added together, they need to add up to %%ENTERED_AMOUNT%%. Currently, they add up to %%TOTAL_AMOUNT%% SplitView When the split items are added together, they need to add up to %%ENTERED_AMOUNT%%. Currently, they add up to %%TOTAL_AMOUNT%%
Help: Scheduled transaction ScheduleListWindow Help: Scheduled transaction
New… MainWindow New…
Show split SplitView Show split
Transfer BudgetWindow Transfer
Amount: %s ScheduleAddWindow Amount: %s
Starting date: ScheduleAddWindow Starting date:
Account settings Account Account settings
Settings… MainWindow Settings…
Cancel PrefWindow Cancel
Budget category: BudgetWindow Budget category:
Quarterly ScheduleListWindow Quarterly
12 month statistics BudgetWindow 12 month statistics
Not transferring any money TransferWindow Not transferring any money
Split CategoryWindow Split
OK Account OK
Income ReportWindow Income
Memo SplitView Memo
Unknown BudgetWindow Unknown
Numbered transactions cannot be scheduled MainWindow Numbered transactions cannot be scheduled
Total checks: ReconcileWindow Total checks:
Remove item SplitView Remove item
Amount TransactionReport Amount
Transaction MainWindow Transaction
Edit transfer TransferWindow Edit transfer
Amount TransferWindow Amount
Default account settings PrefWindow Default account settings
Reports MainWindow Reports
Categories CategoryWindow Categories
Date CheckView Date
Account MainWindow Account
Uncategorized CategoryWindow Uncategorized
Currency format: %s PrefWindow Currency format: %s
Payee TransactionReport Payee
Total deposits: ReconcileWindow Total deposits:
Categories… MainWindow Categories…
Day, Month, Year PrefWindow Day, Month, Year
Help: Budget BudgetWindow Help: Budget
Payee CommonTerms Payee
If you intend to transfer money, it will need to be an amount that is not zero. TransferWindow If you intend to transfer money, it will need to be an amount that is not zero.
You can schedule transfers, deposits, or ATM transactions. MainWindow You can schedule transfers, deposits, or ATM transactions.
Success! ReconcileWindow Success!
Income CategoryWindow Income
Edit category CategoryWindow Edit category
This account is closed, and the settings cannot be edited. Please reopen the account if you need to make changes. MainWindow This account is closed, and the settings cannot be edited. Please reopen the account if you need to make changes.
QuickTracker RegisterView QuickTracker
Schedule transaction ScheduleAddWindow Schedule transaction
Type: %s ScheduleAddWindow Type: %s
Next payment ScheduleListWindow Next payment
New name: CategoryWindow New name:
Help: Reconcile ReconcileWindow Help: Reconcile
Split SplitFilterView Split
Bank charge ReconcileWindow Bank charge
Budget MainWindow Budget
Date PrefWindow Date
OK ScheduleAddWindow OK
Date SplitView Date
Add CategoryWindow Add
Quit MainWindow Quit
Lowest BudgetWindow Lowest
Previous MainWindow Previous
Transaction type is missing CheckView Transaction type is missing
Accounts RegisterView Accounts
Type CheckView Type
Amount ScheduleAddWindow Amount
Income CommonTerms Income
Balance MainWindow Balance
Categories: ReportWindow Categories:
Budget category: %category% BudgetWindow Budget category: %category%
Export MainWindow Export
Enter a transfer… MainWindow Enter a transfer…
File MainWindow File
Tools MainWindow Tools
Not enough accounts for a transfer MainWindow Not enough accounts for a transfer
Split SplitView Split
Delete… MainWindow Delete…
CapitalBe has run into a bug. This shouldn't happen, but it has.\nWould you like to:\n\n1) Save the bug to a text file for uploading to\nCapitalBe's issue tracker (https://github.com/HaikuArchives/CapitalBe/issues)\n\n2) Just quit and do nothing\n Locale CapitalBe has run into a bug. This shouldn't happen, but it has.\nWould you like to:\n\n1) Save the bug to a text file for uploading to\nCapitalBe's issue tracker (https://github.com/HaikuArchives/CapitalBe/issues)\n\n2) Just quit and do nothing\n
Amount BudgetWindow Amount
New account Account New account
Scheduled transactions ScheduleListWindow Scheduled transactions
Agh! Bug! Locale Agh! Bug!
Starting date: ReportWindow Starting date:
Starting balance ReconcileWindow Starting balance
Amount CashFlowReport Amount
Quarterly ScheduleAddWindow Quarterly
Reconcile: ReconcileWindow Reconcile:
Use default currency settings Account Use default currency settings
Expand All @@ -241,23 +211,20 @@ No transactions TransactionReport No transactions
Date: TransferWindow Date:
To account: TransferWindow To account:
Add account transfer TransferWindow Add account transfer
Amount CommonTerms Amount
Quick balance failed. This doesn't mean that you did something wrong - it's just that 'Quick balance' works on simpler cases in balancing an account than this one. Sorry. ReconcileWindow Quick balance failed. This doesn't mean that you did something wrong - it's just that 'Quick balance' works on simpler cases in balancing an account than this one. Sorry.
You need to have an account created in order to reconcile it. MainWindow You need to have an account created in order to reconcile it.
Payee is missing TextInput Payee is missing
Next Payment ScheduleListWindow Next Payment
CapitalBe didn't understand the date you entered TextInput CapitalBe didn't understand the date you entered
Type SplitView Type
Recalculate all BudgetWindow Recalculate all
Date NetWorthReport Date
Income CashFlowReport Income
Split transaction SplitView Split transaction
Total checks: %s ReconcileWindow Total checks: %s
Quarterly BudgetWindow Quarterly
Remove category CategoryWindow Remove category
You cannot schedule transactions on a closed account. MainWindow You cannot schedule transactions on a closed account.
Decimal: PrefWindow Decimal:
CapitalBe didn't understand the amount for 'Interest earned' ReconcileWindow CapitalBe didn't understand the amount for 'Interest earned'
Month, Day, Year PrefWindow Month, Day, Year
Split ScheduleAddWindow Split
Date is missing ReconcileWindow Date is missing
Unknown ScheduleListWindow Unknown
Category CommonTerms Category
4 changes: 2 additions & 2 deletions src/BudgetReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ReportWindow::ComputeBudget(void)
float maxwidths[count + 1];
maxwidths[0] = be_plain_font->StringWidth("Category") + 20;
fGridView->AddColumn(
new BStringColumn(B_TRANSLATE("Category"), maxwidths[0], 10, 300, B_TRUNCATE_END), 0);
new BStringColumn(B_TRANSLATE_CONTEXT("Category", "CommonTerms"), maxwidths[0], 10, 300, B_TRUNCATE_END), 0);

int32 i;
for (i = 0; i < timelist.CountItems() - 1; i++) {
Expand Down Expand Up @@ -126,7 +126,7 @@ ReportWindow::ComputeBudget(void)
}
default:
{
sprintf(columntitle, B_TRANSLATE("Amount"));
sprintf(columntitle, B_TRANSLATE_CONTEXT("Amount", "CommonTerms"));
break;
}
}
Expand Down
26 changes: 13 additions & 13 deletions src/BudgetWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ BudgetWindow::RefreshCategories(void)
fCategoryList->AddRow(fIncomeRow);
fSpendingRow = new BRow();
fCategoryList->AddRow(fSpendingRow);
fIncomeRow->SetField(new BStringField(B_TRANSLATE("Income")), 0);
fSpendingRow->SetField(new BStringField(B_TRANSLATE("Spending")), 0);
fIncomeRow->SetField(new BStringField(B_TRANSLATE_CONTEXT("Income", "CommonTerms")), 0);
fSpendingRow->SetField(new BStringField(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")), 0);

CppSQLite3Query query = gDatabase.DBQuery(
"select category,amount,period,isexpense from "
Expand Down Expand Up @@ -473,7 +473,7 @@ BudgetWindow::GenerateBudget(const bool& zero)
if (query.eof())
return;

float maxwidth = fCategoryList->StringWidth(B_TRANSLATE("Category"));
float maxwidth = fCategoryList->StringWidth(B_TRANSLATE_CONTEXT("Category", "CommonTerms"));
while (!query.eof()) {
BString catname = DeescapeIllegalCharacters(query.getStringField(0));

Expand Down Expand Up @@ -700,7 +700,7 @@ BudgetWindow::BuildStatsAndEditor(void)
new BStringColumn(B_TRANSLATE("12 month statistics"), statwidth, 10, 300, B_TRUNCATE_END),
0);
fCatStat->AddColumn(
new BStringColumn(B_TRANSLATE("Amount"), amountwidth, 10, 300, B_TRUNCATE_END), 1);
new BStringColumn(B_TRANSLATE_CONTEXT("Amount", "CommonTerms"), amountwidth, 10, 300, B_TRUNCATE_END), 1);
fCatStat->SetSortingEnabled(false);
fCatStat->SetColumnFlags(B_ALLOW_COLUMN_RESIZE);
fStatAverageRow = new BRow();
Expand Down Expand Up @@ -729,7 +729,7 @@ BudgetWindow::BuildStatsAndEditor(void)

fMonthly->SetValue(B_CONTROL_ON);

temp = B_TRANSLATE("Amount");
temp = B_TRANSLATE_CONTEXT("Amount", "CommonTerms");
temp << ":";
fAmountLabel = new BStringView("amountlabel", temp.String());

Expand All @@ -748,15 +748,15 @@ BudgetWindow::BuildBudgetSummary(void)
fBudgetSummary->SetSortingEnabled(false);
fBudgetSummary->AddColumn(
new BStringColumn(B_TRANSLATE("Summary"),
fBudgetSummary->StringWidth(B_TRANSLATE("Spending")) + 20, 10, 300, B_TRUNCATE_END),
fBudgetSummary->StringWidth(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")) + 20, 10, 300, B_TRUNCATE_END),
0);
fBudgetSummary->AddRow(fSummaryIncomeRow);
fBudgetSummary->AddRow(fSummarySpendingRow);
fBudgetSummary->AddRow(fSummaryTotalRow);
fBudgetSummary->SetColumnFlags(B_ALLOW_COLUMN_RESIZE);

fSummaryIncomeRow->SetField(new BStringField(B_TRANSLATE("Income")), 0);
fSummarySpendingRow->SetField(new BStringField(B_TRANSLATE("Spending")), 0);
fSummaryIncomeRow->SetField(new BStringField(B_TRANSLATE_CONTEXT("Income", "CommonTerms")), 0);
fSummarySpendingRow->SetField(new BStringField(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")), 0);
fSummaryTotalRow->SetField(new BStringField(B_TRANSLATE("Total")), 0);

// Add all the calendar stuff
Expand Down Expand Up @@ -797,11 +797,11 @@ BudgetWindow::BuildCategoryList(void)
fCategoryList->SetSortingEnabled(false);
fCategoryList->SetSelectionMessage(new BMessage(M_SELECT_CATEGORY));
fCategoryList->AddColumn(
new BStringColumn(B_TRANSLATE("Category"),
fCategoryList->StringWidth(B_TRANSLATE("Category")) + 20, 40, 300, B_TRUNCATE_END),
new BStringColumn(B_TRANSLATE_CONTEXT("Category", "CommonTerms"),
fCategoryList->StringWidth(B_TRANSLATE_CONTEXT("Category", "CommonTerms")) + 20, 40, 300, B_TRUNCATE_END),
0);
fCategoryList->AddColumn(new BStringColumn(B_TRANSLATE("Amount"),
fCategoryList->StringWidth(B_TRANSLATE("Amount")) + 20, 40, 300,
fCategoryList->AddColumn(new BStringColumn(B_TRANSLATE_CONTEXT("Amount", "CommonTerms"),
fCategoryList->StringWidth(B_TRANSLATE_CONTEXT("Amount", "CommonTerms")) + 20, 40, 300,
B_TRUNCATE_END, B_ALIGN_RIGHT),
1);
fCategoryList->AddColumn(new BStringColumn(B_TRANSLATE("Frequency"),
Expand All @@ -814,6 +814,6 @@ BudgetWindow::BuildCategoryList(void)
fCategoryList->AddRow(fIncomeRow);
fSpendingRow = new BRow();
fCategoryList->AddRow(fSpendingRow);
fIncomeRow->SetField(new BStringField(B_TRANSLATE("Income")), 0);
fIncomeRow->SetField(new BStringField(B_TRANSLATE_CONTEXT("Income", "CommonTerms")), 0);
fSpendingRow->SetField(new BStringField(B_TRANSLATE("Spending")), 0);
}
Loading

0 comments on commit d7c1d91

Please sign in to comment.