From d7c1d9126db009d3af296f3741bd8d9439951bee Mon Sep 17 00:00:00 2001 From: Humdinger Date: Tue, 28 May 2024 14:44:32 +0200 Subject: [PATCH] Put common strings into B_TRANSLATE_CONTEXT "CommonTerms" 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 --- locales/en.catkeys | 87 ++++++++++++-------------------------- src/BudgetReport.cpp | 4 +- src/BudgetWindow.cpp | 26 ++++++------ src/CashFlowReport.cpp | 6 +-- src/CategoryWindow.cpp | 34 +++++++-------- src/CheckView.cpp | 12 +++--- src/NetWorthReport.cpp | 2 +- src/ReconcileWindow.cpp | 2 +- src/ReportWindow.cpp | 2 +- src/ScheduleAddWindow.cpp | 16 +++---- src/ScheduleListWindow.cpp | 6 +-- src/ScheduledTransItem.cpp | 4 +- src/SplitView.cpp | 20 ++++----- src/SplitViewFilter.cpp | 2 +- src/TransactionItem.cpp | 4 +- src/TransactionReport.cpp | 22 +++++----- src/TransferWindow.cpp | 2 +- 17 files changed, 106 insertions(+), 145 deletions(-) diff --git a/locales/en.catkeys b/locales/en.catkeys index a10b9b2..69662bb 100644 --- a/locales/en.catkeys +++ b/locales/en.catkeys @@ -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… @@ -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 @@ -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 @@ -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 @@ -81,80 +71,68 @@ 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 MainWindow 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%% @@ -162,75 +140,67 @@ 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 @@ -241,15 +211,13 @@ 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 @@ -257,7 +225,6 @@ 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 diff --git a/src/BudgetReport.cpp b/src/BudgetReport.cpp index 145df06..5fcfddd 100644 --- a/src/BudgetReport.cpp +++ b/src/BudgetReport.cpp @@ -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++) { @@ -126,7 +126,7 @@ ReportWindow::ComputeBudget(void) } default: { - sprintf(columntitle, B_TRANSLATE("Amount")); + sprintf(columntitle, B_TRANSLATE_CONTEXT("Amount", "CommonTerms")); break; } } diff --git a/src/BudgetWindow.cpp b/src/BudgetWindow.cpp index 9a5a7a2..1f35971 100644 --- a/src/BudgetWindow.cpp +++ b/src/BudgetWindow.cpp @@ -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 " @@ -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)); @@ -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(); @@ -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()); @@ -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 @@ -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"), @@ -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); } diff --git a/src/CashFlowReport.cpp b/src/CashFlowReport.cpp index c3be27f..8a1dd1c 100644 --- a/src/CashFlowReport.cpp +++ b/src/CashFlowReport.cpp @@ -159,7 +159,7 @@ ReportWindow::ComputeCashFlow(void) expensegrid.Sort(); // Now that we have all the data, we need to set up the rows and columns for the report grid - BColumn* col = new BStringColumn(B_TRANSLATE("Category"), + BColumn* col = new BStringColumn(B_TRANSLATE_CONTEXT("Category", "CommonTerms"), fGridView->StringWidth(longestname.String()) + 20, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 0); @@ -190,7 +190,7 @@ ReportWindow::ComputeCashFlow(void) } default: { - sprintf(columntitle, B_TRANSLATE("Amount")); + sprintf(columntitle, B_TRANSLATE_CONTEXT("Amount", "CommonTerms")); break; } } @@ -202,7 +202,7 @@ ReportWindow::ComputeCashFlow(void) fGridView->AddRow(new BRow()); BRow* titlerow = new BRow(); fGridView->AddRow(titlerow); - titlerow->SetField(new BStringField(B_TRANSLATE("Income")), 0); + titlerow->SetField(new BStringField(B_TRANSLATE_CONTEXT("Income", "CommonTerms")), 0); fGridView->AddRow(new BRow()); if (!fGridView->IsHidden()) { diff --git a/src/CategoryWindow.cpp b/src/CategoryWindow.cpp index efe4d92..ee1fbea 100644 --- a/src/CategoryWindow.cpp +++ b/src/CategoryWindow.cpp @@ -120,8 +120,8 @@ CategoryView::CategoryView(const char* name, const int32& flags) BScrollView* scrollView = new BScrollView("scrollview", fListView, 0, false, true); fListView->SetSelectionMessage(new BMessage(M_SELECT_ITEM)); - fIncomeItem = new CategoryItem(B_TRANSLATE("Income")); - fSpendingItem = new CategoryItem(B_TRANSLATE("Spending")); + fIncomeItem = new CategoryItem(B_TRANSLATE_CONTEXT("Income", "CommonTerms")); + fSpendingItem = new CategoryItem(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")); RefreshCategoryList(); @@ -214,9 +214,9 @@ CategoryView::MessageReceived(BMessage* msg) msg->FindBool("expense", &expense) != B_OK) break; - if (name.ICompare(B_TRANSLATE("Income")) == 0 || - name.ICompare(B_TRANSLATE("Spending")) == 0 || - name.ICompare(B_TRANSLATE("Split")) == 0) { + if (name.ICompare(B_TRANSLATE_CONTEXT("Income", "CommonTerms")) == 0 || + name.ICompare(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")) == 0 || + name.ICompare(B_TRANSLATE_CONTEXT("Split", "CommonTerms")) == 0) { ShowAlert(B_TRANSLATE("Can't use this category name"), B_TRANSLATE("CapitalBe uses the words 'Income', 'Spending', and 'Split' " "for managing categories, so you can't use them as category names. " @@ -287,12 +287,12 @@ CategoryView::RefreshCategoryList(void) int32 maxchars; float maxlength; - if (strlen(B_TRANSLATE("Income")) > strlen(B_TRANSLATE("Spending"))) { - maxchars = strlen(B_TRANSLATE("Income")); - maxlength = StringWidth(B_TRANSLATE("Income")); + if (strlen(B_TRANSLATE_CONTEXT("Income", "CommonTerms")) > strlen(B_TRANSLATE_CONTEXT("Spending", "CommonTerms"))) { + maxchars = strlen(B_TRANSLATE_CONTEXT("Income", "CommonTerms")); + maxlength = StringWidth(B_TRANSLATE_CONTEXT("Income", "CommonTerms")); } else { - maxchars = strlen(B_TRANSLATE("Spending")); - maxlength = StringWidth(B_TRANSLATE("Spending")); + maxchars = strlen(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")); + maxlength = StringWidth(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")); } CppSQLite3Query query = gDatabase.DBQuery( @@ -469,8 +469,8 @@ CategoryRemoveWindow::CategoryRemoveWindow(const char* from, BView* target) BScrollView* scrollView = new BScrollView("scrollview", fListView, 0, false, true); fListView->SetSelectionMessage(new BMessage(M_SELECT_ITEM)); - fIncomeItem = new CategoryItem(B_TRANSLATE("Income")); - fSpendingItem = new CategoryItem(B_TRANSLATE("Spending")); + fIncomeItem = new CategoryItem(B_TRANSLATE_CONTEXT("Income", "CommonTerms")); + fSpendingItem = new CategoryItem(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")); fListView->AddItem(fIncomeItem); fListView->AddItem(fSpendingItem); @@ -479,12 +479,12 @@ CategoryRemoveWindow::CategoryRemoveWindow(const char* from, BView* target) int32 maxchars; float maxlength; - if (strlen(B_TRANSLATE("Income")) > strlen(B_TRANSLATE("Spending"))) { - maxchars = strlen(B_TRANSLATE("Income")); - maxlength = be_plain_font->StringWidth(B_TRANSLATE("Income")); + if (strlen(B_TRANSLATE_CONTEXT("Income", "CommonTerms")) > strlen(B_TRANSLATE_CONTEXT("Spending", "CommonTerms"))) { + maxchars = strlen(B_TRANSLATE_CONTEXT("Income", "CommonTerms")); + maxlength = be_plain_font->StringWidth(B_TRANSLATE_CONTEXT("Income", "CommonTerms")); } else { - maxchars = strlen(B_TRANSLATE("Spending")); - maxlength = be_plain_font->StringWidth(B_TRANSLATE("Spending")); + maxchars = strlen(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")); + maxlength = be_plain_font->StringWidth(B_TRANSLATE_CONTEXT("Spending", "CommonTerms")); } while (!query.eof()) { diff --git a/src/CheckView.cpp b/src/CheckView.cpp index f19586e..edd5612 100644 --- a/src/CheckView.cpp +++ b/src/CheckView.cpp @@ -33,27 +33,27 @@ enum { CheckView::CheckView(const char* name, int32 flags) : BView(name, flags | B_FRAME_EVENTS) { - BStringView* dateLabel = new BStringView("datelabel", B_TRANSLATE("Date")); + BStringView* dateLabel = new BStringView("datelabel", B_TRANSLATE_CONTEXT("Date", "CommonTerms")); dateLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fDate = new DateBox("dateentry", "", NULL, new BMessage(M_DATE_CHANGED)); - BStringView* typeLabel = new BStringView("typelabel", B_TRANSLATE("Type")); + BStringView* typeLabel = new BStringView("typelabel", B_TRANSLATE_CONTEXT("Type", "CommonTerms")); typeLabel->SetExplicitSize(BSize(StringWidth("ShortType"), B_SIZE_UNSET)); fType = new CheckNumBox("typeentry", "", NULL, new BMessage(M_TYPE_CHANGED)); - BStringView* payeeLabel = new BStringView("payeelabel", B_TRANSLATE("Payee")); + BStringView* payeeLabel = new BStringView("payeelabel", B_TRANSLATE_CONTEXT("Payee", "CommonTerms")); payeeLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fPayee = new PayeeBox("payeeentry", "", NULL, new BMessage(M_PAYEE_CHANGED)); - BStringView* amountLabel = new BStringView("amountlabel", B_TRANSLATE("Amount")); + BStringView* amountLabel = new BStringView("amountlabel", B_TRANSLATE_CONTEXT("Amount", "CommonTerms")); amountLabel->SetExplicitSize(BSize(StringWidth("$10,000,000,000.00"), B_SIZE_UNSET)); fAmount = new CurrencyBox("amountentry", "", "", new BMessage(M_AMOUNT_CHANGED)); - BStringView* categoryLabel = new BStringView("categorylabel", B_TRANSLATE("Category")); + BStringView* categoryLabel = new BStringView("categorylabel", B_TRANSLATE_CONTEXT("Category", "CommonTerms")); categoryLabel->SetExplicitSize(BSize(StringWidth("aVeryLongCategoryName"), B_SIZE_UNSET)); fCategory = new CategoryBox("categoryentry", "", NULL, new BMessage(M_CATEGORY_CHANGED)); - BStringView* memoLabel = new BStringView("memolabel", B_TRANSLATE("Memo")); + BStringView* memoLabel = new BStringView("memolabel", B_TRANSLATE_CONTEXT("Memo", "CommonTerms")); memoLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fMemo = new NavTextBox("memoentry", "", NULL, new BMessage(M_MEMO_CHANGED)); fMemo->TextView()->DisallowChar(B_ESCAPE); diff --git a/src/NetWorthReport.cpp b/src/NetWorthReport.cpp index 0a6d06d..74e025d 100644 --- a/src/NetWorthReport.cpp +++ b/src/NetWorthReport.cpp @@ -92,7 +92,7 @@ ReportWindow::ComputeNetWorth(void) if (fGraphView->IsHidden()) { // Now that we have all the data, we need to set up the rows and columns for the report grid - BColumn* col = new BStringColumn(B_TRANSLATE("Date"), + BColumn* col = new BStringColumn(B_TRANSLATE_CONTEXT("Date", "CommonTerms"), fGridView->StringWidth(longestname.String()) + 20, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 0); col = new BStringColumn(B_TRANSLATE("Total"), 75, 10, 300, B_TRUNCATE_END); diff --git a/src/ReconcileWindow.cpp b/src/ReconcileWindow.cpp index 65f353c..0e7e0e3 100644 --- a/src/ReconcileWindow.cpp +++ b/src/ReconcileWindow.cpp @@ -68,7 +68,7 @@ ReconcileWindow::ReconcileWindow(const BRect frame, Account* account) back->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); BLayoutBuilder::Group<>(this, B_VERTICAL, 0).SetInsets(0).Add(back).End(); - fDateLabel = new BStringView("datelabel", B_TRANSLATE("Date")); + fDateLabel = new BStringView("datelabel", B_TRANSLATE_CONTEXT("Date", "CommonTerms")); BString datestr; gDefaultLocale.DateToString(fCurrentDate, datestr); fDate = new DateBox("dateentry", NULL, datestr.String(), NULL); diff --git a/src/ReportWindow.cpp b/src/ReportWindow.cpp index a4c4fc3..1f2978a 100644 --- a/src/ReportWindow.cpp +++ b/src/ReportWindow.cpp @@ -95,7 +95,7 @@ ReportWindow::ReportWindow(BRect frame) // TODO: Re-enable the Budget report // reportmenu->AddItem(new BMenuItem(B_TRANSLATE("Budget"), new BMessage(M_REPORT_BUDGET))); - temp << B_TRANSLATE("Income") << " / " << B_TRANSLATE("Spending"); + temp << B_TRANSLATE_CONTEXT("Income", "CommonTerms") << " / " << B_TRANSLATE_CONTEXT("Spending", "CommonTerms"); reportmenu->AddItem(new BMenuItem(temp.String(), new BMessage(M_REPORT_CASH_FLOW))); reportmenu->AddItem( new BMenuItem(B_TRANSLATE("Total worth"), new BMessage(M_REPORT_NET_WORTH))); diff --git a/src/ScheduleAddWindow.cpp b/src/ScheduleAddWindow.cpp index e5fe051..ba26b65 100644 --- a/src/ScheduleAddWindow.cpp +++ b/src/ScheduleAddWindow.cpp @@ -44,17 +44,14 @@ ScheduleAddWindow::ScheduleAddWindow(const BRect& frame, const TransactionData& { AddShortcut('W', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); -#undef B_TRANSLATION_CONTEXT -#define B_TRANSLATION_CONTEXT "SplitView" - // Type - BStringView* typeLabel = new BStringView("typelabel", B_TRANSLATE("Type")); + BStringView* typeLabel = new BStringView("typelabel", B_TRANSLATE_CONTEXT("Type", "CommonTerms")); typeLabel->SetExplicitSize(BSize(be_plain_font->StringWidth("ShortType"), B_SIZE_UNSET)); BTextControl* type = new BTextControl("type", NULL, data.Type().Type(), NULL); type->SetEnabled(false); // Payee - BStringView* payeeLabel = new BStringView("payeelabel", B_TRANSLATE("Payee")); + BStringView* payeeLabel = new BStringView("payeelabel", B_TRANSLATE_CONTEXT("Payee", "CommonTerms")); payeeLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); payeeLabel->SetExplicitMinSize( BSize(be_plain_font->StringWidth("anAveragelyLongPayee"), B_SIZE_UNSET)); @@ -71,28 +68,25 @@ ScheduleAddWindow::ScheduleAddWindow(const BRect& frame, const TransactionData& amount->SetEnabled(false); // Category - BStringView* categoryLabel = new BStringView("categorylabel", B_TRANSLATE("Category")); + BStringView* categoryLabel = new BStringView("categorylabel", B_TRANSLATE_CONTEXT("Category", "CommonTerms")); categoryLabel->SetExplicitSize( BSize(be_plain_font->StringWidth("aLongCategoryName"), B_SIZE_UNSET)); BString label; if (data.CountCategories() > 1) - label << B_TRANSLATE("Split"); + label << B_TRANSLATE_CONTEXT("Split", "CommonTerms"); else label << data.NameAt(0); BTextControl* category = new BTextControl("category", NULL, label.String(), NULL); category->SetEnabled(false); // Memo - BStringView* memoLabel = new BStringView("memolabel", B_TRANSLATE("Memo")); + BStringView* memoLabel = new BStringView("memolabel", B_TRANSLATE_CONTEXT("Memo", "CommonTerms")); memoLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); memoLabel->SetExplicitMinSize( BSize(be_plain_font->StringWidth("$10,000,000,000.00"), B_SIZE_UNSET)); BTextControl* memo = new BTextControl("memo", NULL, data.Memo(), NULL); memo->SetEnabled(false); -#undef B_TRANSLATION_CONTEXT -#define B_TRANSLATION_CONTEXT "ScheduleAddWindow" - fIntervalMenu = new BMenu("Frequency"); fIntervalMenu->AddItem( new BMenuItem(B_TRANSLATE("Monthly"), new BMessage(M_SCHEDULED_MONTHLY))); diff --git a/src/ScheduleListWindow.cpp b/src/ScheduleListWindow.cpp index 6ba656b..486c671 100644 --- a/src/ScheduleListWindow.cpp +++ b/src/ScheduleListWindow.cpp @@ -61,11 +61,11 @@ ScheduleListView::ScheduleListView(const char* name, const int32& flags) fListView->SetSortingEnabled(false); fListView->SetEditMode(false); - fListView->AddColumn(new BStringColumn(B_TRANSLATE("Payee"), 100, 25, 300, B_ALIGN_LEFT), 0); + fListView->AddColumn(new BStringColumn(B_TRANSLATE_CONTEXT("Payee", "CommonTerms"), 100, 25, 300, B_ALIGN_LEFT), 0); float amountwidth = StringWidth("$000,000.00"); - float amountlabelwidth = StringWidth(B_TRANSLATE("Amount")); - fListView->AddColumn(new BStringColumn(B_TRANSLATE("Amount"), + float amountlabelwidth = StringWidth(B_TRANSLATE_CONTEXT("Amount", "CommonTerms")); + fListView->AddColumn(new BStringColumn(B_TRANSLATE_CONTEXT("Amount", "CommonTerms"), MAX(amountwidth, amountlabelwidth), 25, 300, B_ALIGN_LEFT), 1); fListView->AddColumn(new BStringColumn(B_TRANSLATE("Payments"), diff --git a/src/ScheduledTransItem.cpp b/src/ScheduledTransItem.cpp index 8675c0d..718fa7c 100644 --- a/src/ScheduledTransItem.cpp +++ b/src/ScheduledTransItem.cpp @@ -33,7 +33,7 @@ ScheduledTransItem::ScheduledTransItem(const ScheduledTransData& data) gDefaultLocale.DateToString(data.Date(), fDate); if (data.CountCategories() > 1) - fCategory = B_TRANSLATE("Split"); + fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms"); else fCategory = data.NameAt(0); } @@ -200,7 +200,7 @@ ScheduledTransItem::SetData(const TransactionData& trans) fPayee = trans.Payee(); locale.CurrencyToString(trans.Amount().AbsoluteValue(), fAmount); if (trans.CountCategories() > 1) - fCategory = B_TRANSLATE("Split"); + fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms"); else fCategory = trans.NameAt(0); fMemo = trans.Memo(); diff --git a/src/SplitView.cpp b/src/SplitView.cpp index f4dff9b..ab2a060 100644 --- a/src/SplitView.cpp +++ b/src/SplitView.cpp @@ -38,7 +38,7 @@ SplitView::SplitView(const char* name, const TransactionData& trans, const int32 fCheckNum = fTransaction.GetAccount()->LastCheckNumber(); // Date - BStringView* dateLabel = new BStringView("datelabel", B_TRANSLATE("Date")); + BStringView* dateLabel = new BStringView("datelabel", B_TRANSLATE_CONTEXT("Date", "CommonTerms")); dateLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fDate = new DateBox("dateentry", "", "text", new BMessage(M_DATE_CHANGED)); @@ -48,21 +48,21 @@ SplitView::SplitView(const char* name, const TransactionData& trans, const int32 fDate->SetText(tempstr.String()); // Type - BStringView* typeLabel = new BStringView("typelabel", B_TRANSLATE("Type")); + BStringView* typeLabel = new BStringView("typelabel", B_TRANSLATE_CONTEXT("Type", "CommonTerms")); typeLabel->SetExplicitSize(BSize(StringWidth("ShortType"), B_SIZE_UNSET)); fType = new CheckNumBox("typeentry", "", NULL, new BMessage(M_TYPE_CHANGED)); fType->SetText(fTransaction.Type().Type()); // Payee - BStringView* payeeLabel = new BStringView("payeelabel", B_TRANSLATE("Payee")); + BStringView* payeeLabel = new BStringView("payeelabel", B_TRANSLATE_CONTEXT("Payee", "CommonTerms")); payeeLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fPayee = new PayeeBox("payeeentry", "", fTransaction.Payee(), new BMessage(M_PAYEE_CHANGED)); fPayee->SetExplicitMinSize(BSize(StringWidth("QuiteLongPayeesName"), B_SIZE_UNSET)); // Amount - BStringView* amountLabel = new BStringView("amountlabel", B_TRANSLATE("Amount")); + BStringView* amountLabel = new BStringView("amountlabel", B_TRANSLATE_CONTEXT("Amount", "CommonTerms")); amountLabel->SetExplicitSize(BSize(StringWidth("$10,000,000,000.00"), B_SIZE_UNSET)); fAmount = new CurrencyBox("amountentry", "", NULL, new BMessage(M_AMOUNT_CHANGED)); @@ -72,14 +72,14 @@ SplitView::SplitView(const char* name, const TransactionData& trans, const int32 fAmount->SetText(tempstr.String()); // Category - BStringView* categoryLabel = new BStringView("categorylabel", B_TRANSLATE("Category")); + BStringView* categoryLabel = new BStringView("categorylabel", B_TRANSLATE_CONTEXT("Category", "CommonTerms")); categoryLabel->SetExplicitSize(BSize(StringWidth("aVeryLongCategoryName"), B_SIZE_UNSET)); fCategory = new CategoryBox( "categoryentry", "", fTransaction.NameAt(0), new BMessage(M_CATEGORY_CHANGED)); // Memo - BStringView* memoLabel = new BStringView("memolabel", B_TRANSLATE("Memo")); + BStringView* memoLabel = new BStringView("memolabel", B_TRANSLATE_CONTEXT("Memo", "CommonTerms")); memoLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fMemo = new NavTextBox("memoentry", "", fTransaction.Memo(), new BMessage(M_MEMO_CHANGED)); @@ -113,17 +113,17 @@ SplitView::SplitView(const char* name, const TransactionData& trans, const int32 #endif // Split category - BStringView* splitCategoryLabel = new BStringView("categorylabel", B_TRANSLATE("Category")); + BStringView* splitCategoryLabel = new BStringView("categorylabel", B_TRANSLATE_CONTEXT("Category", "CommonTerms")); splitCategoryLabel->SetExplicitSize(BSize(StringWidth("aVeryLongCategoryName"), B_SIZE_UNSET)); fSplitCategory = new BTextControl("splitcategory", NULL, NULL, NULL, B_WILL_DRAW); // Split amount - BStringView* splitAmountLabel = new BStringView("amountlabel", B_TRANSLATE("Amount")); + BStringView* splitAmountLabel = new BStringView("amountlabel", B_TRANSLATE_CONTEXT("Amount", "CommonTerms")); splitAmountLabel->SetExplicitSize(BSize(StringWidth("$10,000,000,000.00"), B_SIZE_UNSET)); fSplitAmount = new BTextControl("splitamount", NULL, NULL, NULL, B_WILL_DRAW); // Split memo - BStringView* splitMemoLabel = new BStringView("memolabel", B_TRANSLATE("Memo")); + BStringView* splitMemoLabel = new BStringView("memolabel", B_TRANSLATE_CONTEXT("Memo", "CommonTerms")); splitMemoLabel->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); fSplitMemo = new BTextControl("splitmemo", NULL, NULL, NULL, B_WILL_DRAW); @@ -150,7 +150,7 @@ SplitView::SplitView(const char* name, const TransactionData& trans, const int32 } if (fTransaction.CountCategories() > 1 || - strcmp(fTransaction.NameAt(0), B_TRANSLATE("Split")) == 0) { + strcmp(fTransaction.NameAt(0), B_TRANSLATE_CONTEXT("Split", "CommonTerms")) == 0) { fCategory->SetText(B_TRANSLATE("Split transaction")); fStartExpanded = true; } diff --git a/src/SplitViewFilter.cpp b/src/SplitViewFilter.cpp index 10681c5..8677a1b 100644 --- a/src/SplitViewFilter.cpp +++ b/src/SplitViewFilter.cpp @@ -192,7 +192,7 @@ SplitViewFilter::Filter(BMessage* msg, BHandler** target) BString autocomplete = acc->AutocompleteCategory(string.String()); - if (autocomplete.CountChars() > 0 && autocomplete != B_TRANSLATE("Split")) { + if (autocomplete.CountChars() > 0 && autocomplete != B_TRANSLATE_CONTEXT("Split", "CommonTerms")) { BMessage automsg(M_CATEGORY_AUTOCOMPLETE); automsg.AddInt32("start", strlen(text->Text()) + 1); automsg.AddString("string", autocomplete.String()); diff --git a/src/TransactionItem.cpp b/src/TransactionItem.cpp index baa926a..f70d1a4 100644 --- a/src/TransactionItem.cpp +++ b/src/TransactionItem.cpp @@ -31,7 +31,7 @@ TransactionItem::TransactionItem(const TransactionData& trans) fTimeStamp(trans.GetTimeStamp()) { if (trans.CountCategories() > 1) - fCategory = B_TRANSLATE("Split"); + fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms"); else fCategory = trans.NameAt(0); } @@ -206,7 +206,7 @@ TransactionItem::SetData(const TransactionData& trans) fPayee = trans.Payee(); fAmount = trans.Amount(); if (trans.CountCategories() > 1) - fCategory = B_TRANSLATE("Split"); + fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms"); else fCategory = trans.NameAt(0); fMemo = trans.Memo(); diff --git a/src/TransactionReport.cpp b/src/TransactionReport.cpp index 9da39d7..baf3e2b 100644 --- a/src/TransactionReport.cpp +++ b/src/TransactionReport.cpp @@ -63,22 +63,22 @@ ReportWindow::ComputeTransactions(void) 10, 300, B_TRUNCATE_END, B_ALIGN_RIGHT); fGridView->AddColumn(col, 0); col = new BStringColumn( - B_TRANSLATE("Date"), fGridView->StringWidth("00-00-0000") + 15, 10, 300, B_TRUNCATE_END); + B_TRANSLATE_CONTEXT("Date", "CommonTerms"), fGridView->StringWidth("00-00-0000") + 15, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 1); - col = new BStringColumn(B_TRANSLATE("Type"), fGridView->StringWidth(B_TRANSLATE("Type")) + 20, + col = new BStringColumn(B_TRANSLATE_CONTEXT("Type", "CommonTerms"), fGridView->StringWidth(B_TRANSLATE_CONTEXT("Type", "CommonTerms")) + 20, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 2); - col = new BStringColumn(B_TRANSLATE("Payee"), 75, 10, 300, B_TRUNCATE_END); + col = new BStringColumn(B_TRANSLATE_CONTEXT("Payee", "CommonTerms"), 75, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 3); // The string we use for calculating width here should work well enough for general purposes col = new BStringColumn( - B_TRANSLATE("Amount"), fGridView->StringWidth("$00,000.00") + 15, 10, 300, B_TRUNCATE_END); + B_TRANSLATE_CONTEXT("Amount", "CommonTerms"), fGridView->StringWidth("$00,000.00") + 15, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 4); - col = new BStringColumn(B_TRANSLATE("Category"), fGridView->StringWidth("0000000000") + 20, 10, + col = new BStringColumn(B_TRANSLATE_CONTEXT("Category", "CommonTerms"), fGridView->StringWidth("0000000000") + 20, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 5); - col = new BStringColumn(B_TRANSLATE("Memo"), 75, 10, 300, B_TRUNCATE_END); + col = new BStringColumn(B_TRANSLATE_CONTEXT("Memo", "CommonTerms"), 75, 10, 300, B_TRUNCATE_END); fGridView->AddColumn(col, 6); fGridView->AddRow(new BRow()); @@ -88,11 +88,11 @@ ReportWindow::ComputeTransactions(void) fGridView->AddRow(new BRow()); - int32 payeechars = strlen(B_TRANSLATE("Payee")), memochars = strlen(B_TRANSLATE("Memo")), - categorychars = strlen(B_TRANSLATE("Category")); - float maxpayee = fGridView->StringWidth(B_TRANSLATE("Payee")), - maxmemo = fGridView->StringWidth(B_TRANSLATE("Memo")), - maxcategory = fGridView->StringWidth(B_TRANSLATE("Category")); + int32 payeechars = strlen(B_TRANSLATE_CONTEXT("Payee", "CommonTerms")), memochars = strlen(B_TRANSLATE_CONTEXT("Memo", "CommonTerms")), + categorychars = strlen(B_TRANSLATE_CONTEXT("Category", "CommonTerms")); + float maxpayee = fGridView->StringWidth(B_TRANSLATE_CONTEXT("Payee", "CommonTerms")), + maxmemo = fGridView->StringWidth(B_TRANSLATE_CONTEXT("Memo", "CommonTerms")), + maxcategory = fGridView->StringWidth(B_TRANSLATE_CONTEXT("Category", "CommonTerms")); int32 count = timelist.CountItems() - 1; for (int32 subtotal_index = 0; subtotal_index < count; subtotal_index++) { diff --git a/src/TransferWindow.cpp b/src/TransferWindow.cpp index 2a0c4fb..8582cf4 100644 --- a/src/TransferWindow.cpp +++ b/src/TransferWindow.cpp @@ -64,7 +64,7 @@ TransferWindow::InitObject(Account* src, Account* dest, const Fixed& amount) fMemo = new BTextControl("memobox", B_TRANSLATE("Memo:"), NULL, NULL); BString amt; - BString temp = B_TRANSLATE("Amount"); + BString temp = B_TRANSLATE_CONTEXT("Amount", "CommonTerms"); temp << ":"; gCurrentLocale.CurrencyToString(amount, amt); fAmount = new CurrencyBox("amountbox", temp.String(), amt.String(), NULL);