Skip to content

Commit

Permalink
Update language strings
Browse files Browse the repository at this point in the history
  • Loading branch information
dospuntos committed Jul 11, 2024
1 parent 00f8f24 commit ba62ef0
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 13 deletions.
4 changes: 3 additions & 1 deletion locales/en.catkeys
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 English application/x-vnd.wgp-CapitalBe 575229969
1 English application/x-vnd.wgp-CapitalBe 1682388248
Year ReportWindow Year
None ReportWindow None
Export to QIF file… MainWindow Export to QIF file…
Expand Down Expand Up @@ -153,6 +153,7 @@ Starting date: ScheduleAddWindow Starting date:
Account settings Account Account settings
Color for negative amounts PrefWindow Color for negative amounts
Settings… MainWindow Settings…
Split CommonTerms The verb 'split', as in 'to split into different categories' Split
Cancel PrefWindow Cancel
Budget category: BudgetWindow Budget category:
Quarterly ScheduleListWindow Quarterly
Expand Down Expand Up @@ -225,6 +226,7 @@ Date: TransferWindow Date:
To account: TransferWindow To account:
Add account transfer TransferWindow Add account transfer
Amount CommonTerms Amount
Split CommonTerms The noun 'split', as in 'a split-category' Split
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
Expand Down
10 changes: 8 additions & 2 deletions src/Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,14 @@ Account::AutocompleteCategory(const char* input)
// TODO: Add language support here
if (toupper(input[0]) == (int)'S') {
int32 inputlength = strlen(input);
if (strncasecmp(input, B_TRANSLATE_CONTEXT("Split", "CommonTerms"), inputlength) == 0)
return B_TRANSLATE_CONTEXT("Split", "CommonTerms");
if (strncasecmp(input,
B_TRANSLATE_ALL("Split", "CommonTerms",
"The verb 'split', as in 'to split into different categories'"),
inputlength)
== 0) {
return B_TRANSLATE_ALL("Split", "CommonTerms",
"The verb 'split', as in 'to split into different categories'");
}
}
CppSQLite3Buffer bufSQL;
BString searchString;
Expand Down
5 changes: 4 additions & 1 deletion src/CategoryBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ CategoryBox::SetTypeFromCategory(BString category)

bool success = true;
if (!categoryExists
&& category.ICompare(B_TRANSLATE_CONTEXT("Split", "CommonTerms")) != 0)
&& category.ICompare(B_TRANSLATE_ALL("Split", "CommonTerms",
"The noun 'split', as in 'a split-category'"))
!= 0) {
bool success = AddNewCategory(category);
}

return success;
}
Expand Down
5 changes: 4 additions & 1 deletion src/CheckView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,10 @@ CheckView::DoNextField(void)
} else if (fCategory->ChildAt(0)->IsFocus()) {
// TODO: don't force entering a transaction when going to the
// split window via key editing
if (strcmp(fCategory->Text(), B_TRANSLATE_CONTEXT("Split", "CommonTerms")) == 0) {
if (strcmp(fCategory->Text(),
B_TRANSLATE_ALL("Split", "CommonTerms",
"The noun 'split', as in 'a split-category'"))
== 0) {
Window()->PostMessage(M_ENTER_TRANSACTION, this);
Window()->PostMessage(M_EDIT_TRANSACTION);
return;
Expand Down
5 changes: 4 additions & 1 deletion src/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,8 +1159,11 @@ Database::AddCategory(const char* name, const bool& isexpense)
if (!name || HasCategory(name))
return;

if (strcasecmp(name, B_TRANSLATE_CONTEXT("Split", "CommonTerms")) == 0)
if (strcasecmp(name,
B_TRANSLATE_ALL("Split", "CommonTerms", "The noun 'split', as in 'a split-category'"))
== 0) {
return;
}

CppSQLite3Buffer bufSQL;
bufSQL.format("INSERT INTO categorylist VALUES(%Q, %i)", name, (isexpense ? 0 : 1));
Expand Down
3 changes: 2 additions & 1 deletion src/ScheduledTransItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ ScheduledTransItem::ScheduledTransItem(const ScheduledTransData& data)
gDefaultLocale.DateToString(data.Date(), fDate);

if (data.CountCategories() > 1)
fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms");
fCategory
= B_TRANSLATE_ALL("Split", "CommonTerms", "The noun 'split', as in 'a split-category'");
else
fCategory = data.NameAt(0);
}
Expand Down
11 changes: 8 additions & 3 deletions src/SplitView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,12 @@ SplitView::SplitView(const char* name, const TransactionData& trans, const int32
}

if (fTransaction.CountCategories() > 1
|| strcmp(fTransaction.NameAt(0), B_TRANSLATE_CONTEXT("Split", "CommonTerms")) == 0) {
fCategory->SetText(B_TRANSLATE_CONTEXT("Split", "CommonTerms"));
|| strcmp(fTransaction.NameAt(0),
B_TRANSLATE_ALL("Split", "CommonTerms",
"The noun 'split', as in 'a split-category'"))
== 0) {
fCategory->SetText(
B_TRANSLATE_ALL("Split", "CommonTerms", "The noun 'split', as in 'a split-category'"));
fStartExpanded = true;
}

Expand Down Expand Up @@ -761,7 +765,8 @@ SplitView::ToggleSplit(void)

fSplitContainer->Show();
fCategory->SetEnabled(false);
fCategory->SetText(B_TRANSLATE_CONTEXT("Split", "CommonTerms"));
fCategory->SetText(
B_TRANSLATE_ALL("Split", "CommonTerms", "The noun 'split', as in 'a split-category'"));
fCategoryButton->SetEnabled(false);
fMemo->SetEnabled(false);
if (fCategory->ChildAt(0)->IsFocus())
Expand Down
4 changes: 3 additions & 1 deletion src/SplitViewFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ SplitViewFilter::Filter(BMessage* msg, BHandler** target)
BString autocomplete = acc->AutocompleteCategory(string.String());

if (autocomplete.CountChars() > 0
&& autocomplete != B_TRANSLATE_CONTEXT("Split", "CommonTerms")) {
&& autocomplete
!= B_TRANSLATE_ALL("Split", "CommonTerms",
"The noun 'split', as in 'a split-category'")) {
BMessage automsg(M_CATEGORY_AUTOCOMPLETE);
automsg.AddInt32("start", strlen(text->Text()) + 1);
automsg.AddString("string", autocomplete.String());
Expand Down
6 changes: 4 additions & 2 deletions src/TransactionItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ TransactionItem::TransactionItem(const TransactionData& trans)
fTimeStamp(trans.GetTimeStamp())
{
if (trans.CountCategories() > 1)
fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms");
fCategory
= B_TRANSLATE_ALL("Split", "CommonTerms", "The noun 'split', as in 'a split-category'");
else
fCategory = trans.NameAt(0);
}
Expand Down Expand Up @@ -229,7 +230,8 @@ TransactionItem::SetData(const TransactionData& trans)
fPayee = trans.Payee();
fAmount = trans.Amount();
if (trans.CountCategories() > 1)
fCategory = B_TRANSLATE_CONTEXT("Split", "CommonTerms");
fCategory
= B_TRANSLATE_ALL("Split", "CommonTerms", "The noun 'split', as in 'a split-category'");
else
fCategory = trans.NameAt(0);
fMemo = trans.MemoAt(0);
Expand Down

0 comments on commit ba62ef0

Please sign in to comment.