Browse Source

Feature/tag template literal strings (#1152)

* Tagged template literal strings

* Update changelog
pull/1153/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
335553e891
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/access-table/access-table.component.ts
  3. 4
      apps/client/src/app/components/accounts-table/accounts-table.component.ts
  4. 16
      apps/client/src/app/components/admin-overview/admin-overview.component.ts
  5. 4
      apps/client/src/app/components/admin-users/admin-users.component.ts
  6. 2
      apps/client/src/app/components/header/header.component.ts
  7. 2
      apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts
  8. 12
      apps/client/src/app/core/http-response.interceptor.ts
  9. 18
      apps/client/src/app/pages/account/account-page.component.ts
  10. 2
      apps/client/src/app/pages/demo/demo-page.component.ts
  11. 4
      apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts
  12. 184
      apps/client/src/locales/messages.de.xlf
  13. 161
      apps/client/src/locales/messages.xlf
  14. 4
      libs/ui/src/lib/activities-table/activities-table.component.ts

4
CHANGELOG.md

@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Set up `ng-extract-i18n-merge` to improve the i18n extraction and merge workflow
### Changed
- Tagged template literal strings in components for localization with `$localize`
## 1.179.5 - 15.08.2022
### Added

2
apps/client/src/app/components/access-table/access-table.component.ts

@ -46,7 +46,7 @@ export class AccessTableComponent implements OnChanges, OnInit {
public onDeleteAccess(aId: string) {
const confirmation = confirm(
'Do you really want to revoke this granted access?'
$localize`Do you really want to revoke this granted access?`
);
if (confirmation) {

4
apps/client/src/app/components/accounts-table/accounts-table.component.ts

@ -69,7 +69,9 @@ export class AccountsTableComponent implements OnChanges, OnDestroy, OnInit {
}
public onDeleteAccount(aId: string) {
const confirmation = confirm('Do you really want to delete this account?');
const confirmation = confirm(
$localize`Do you really want to delete this account?`
);
if (confirmation) {
this.accountDeleted.emit(aId);

16
apps/client/src/app/components/admin-overview/admin-overview.component.ts

@ -103,7 +103,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
}
public onAddCurrency() {
const currency = prompt('Please add a currency:');
const currency = prompt($localize`Please add a currency:`);
if (currency) {
const currencies = uniq([...this.customCurrencies, currency]);
@ -116,7 +116,9 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
}
public onDeleteCoupon(aCouponCode: string) {
const confirmation = confirm('Do you really want to delete this coupon?');
const confirmation = confirm(
$localize`Do you really want to delete this coupon?`
);
if (confirmation === true) {
const coupons = this.coupons.filter((coupon) => {
@ -127,7 +129,9 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
}
public onDeleteCurrency(aCurrency: string) {
const confirmation = confirm('Do you really want to delete this currency?');
const confirmation = confirm(
$localize`Do you really want to delete this currency?`
);
if (confirmation === true) {
const currencies = this.customCurrencies.filter((currency) => {
@ -142,7 +146,9 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
}
public onFlushCache() {
const confirmation = confirm('Do you really want to flush the cache?');
const confirmation = confirm(
$localize`Do you really want to flush the cache?`
);
if (confirmation === true) {
this.cacheService
@ -190,7 +196,7 @@ export class AdminOverviewComponent implements OnDestroy, OnInit {
}
public onSetSystemMessage() {
const systemMessage = prompt('Please set your system message:');
const systemMessage = prompt($localize`Please set your system message:`);
if (systemMessage) {
this.putSystemMessage(systemMessage);

4
apps/client/src/app/components/admin-users/admin-users.component.ts

@ -55,7 +55,9 @@ export class AdminUsersComponent implements OnDestroy, OnInit {
}
public onDeleteUser(aId: string) {
const confirmation = confirm('Do you really want to delete this user?');
const confirmation = confirm(
$localize`Do you really want to delete this user?`
);
if (confirmation) {
this.dataService

2
apps/client/src/app/components/header/header.component.ts

@ -123,7 +123,7 @@ export class HeaderComponent implements OnChanges {
.loginAnonymous(data?.accessToken)
.pipe(
catchError(() => {
alert('Oops! Incorrect Security Token.');
alert($localize`Oops! Incorrect Security Token.`);
return EMPTY;
}),

2
apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts

@ -45,7 +45,7 @@ export class PortfolioSummaryComponent implements OnChanges, OnInit {
public onEditEmergencyFund() {
const emergencyFundInput = prompt(
'Please enter the amount of your emergency fund:',
$localize`Please enter the amount of your emergency fund:`,
this.summary.emergencyFund.toString()
);
const emergencyFund = parseFloat(emergencyFundInput?.trim());

12
apps/client/src/app/core/http-response.interceptor.ts

@ -56,14 +56,16 @@ export class HttpResponseInterceptor implements HttpInterceptor {
if (!this.snackBarRef) {
if (this.info.isReadOnlyMode) {
this.snackBarRef = this.snackBar.open(
'This feature is currently unavailable. Please try again later.',
$localize`This feature is currently unavailable. Please try again later.`,
undefined,
{ duration: 6000 }
);
} else {
this.snackBarRef = this.snackBar.open(
'This feature requires a subscription.',
this.hasPermissionForSubscription ? 'Upgrade Plan' : undefined,
$localize`This feature requires a subscription.`,
this.hasPermissionForSubscription
? $localize`Upgrade Plan`
: undefined,
{ duration: 6000 }
);
}
@ -79,8 +81,8 @@ export class HttpResponseInterceptor implements HttpInterceptor {
} else if (error.status === StatusCodes.INTERNAL_SERVER_ERROR) {
if (!this.snackBarRef) {
this.snackBarRef = this.snackBar.open(
'Oops! Something went wrong. Please try again later.',
'Okay',
$localize`Oops! Something went wrong. Please try again later.`,
$localize`Okay`,
{ duration: 6000 }
);

18
apps/client/src/app/pages/account/account-page.component.ts

@ -218,7 +218,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
}
public onRedeemCoupon() {
let couponCode = prompt('Please enter your coupon code:');
let couponCode = prompt($localize`Please enter your coupon code:`);
couponCode = couponCode?.trim();
if (couponCode) {
@ -227,17 +227,21 @@ export class AccountPageComponent implements OnDestroy, OnInit {
.pipe(
takeUntil(this.unsubscribeSubject),
catchError(() => {
this.snackBar.open('😞 Could not redeem coupon code', undefined, {
duration: 3000
});
this.snackBar.open(
'😞 ' + $localize`Could not redeem coupon code`,
undefined,
{
duration: 3000
}
);
return EMPTY;
})
)
.subscribe(() => {
this.snackBarRef = this.snackBar.open(
'✅ Coupon code has been redeemed',
'Reload',
'✅' + $localize`Coupon code has been redeemed`,
$localize`Reload`,
{
duration: 3000
}
@ -283,7 +287,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
this.registerDevice();
} else {
const confirmation = confirm(
'Do you really want to remove this sign in method?'
$localize`Do you really want to remove this sign in method?`
);
if (confirmation) {

2
apps/client/src/app/pages/demo/demo-page.component.ts

@ -28,7 +28,7 @@ export class DemoPageComponent implements OnDestroy {
if (hasToken) {
alert(
'As you are already logged in, you cannot access the demo account.'
$localize`As you are already logged in, you cannot access the demo account.`
);
} else {
this.tokenStorageService.saveToken(this.info.demoAuthToken, true);

4
apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts

@ -188,7 +188,7 @@ export class TransactionsPageComponent implements OnDestroy, OnInit {
input.type = 'file';
input.onchange = (event) => {
this.snackBar.open('⏳ Importing data...');
this.snackBar.open('⏳' + $localize`Importing data...`);
// Getting the file reference
const file = (event.target as HTMLInputElement).files[0];
@ -334,7 +334,7 @@ export class TransactionsPageComponent implements OnDestroy, OnInit {
private handleImportSuccess() {
this.fetchActivities();
this.snackBar.open('✅ Import has been completed', undefined, {
this.snackBar.open('✅' + $localize`Import has been completed`, undefined, {
duration: 3000
});
}

184
apps/client/src/locales/messages.de.xlf

@ -2256,6 +2256,190 @@
<context context-type="linenumber">126</context>
</context-group>
</trans-unit>
<trans-unit id="8264698726451826067" datatype="html">
<source>Do you really want to revoke this granted access?</source>
<target state="new">Do you really want to revoke this granted access?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/access-table/access-table.component.ts</context>
<context context-type="linenumber">49</context>
</context-group>
</trans-unit>
<trans-unit id="8280212421112607879" datatype="html">
<source>Do you really want to delete this account?</source>
<target state="new">Do you really want to delete this account?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/accounts-table/accounts-table.component.ts</context>
<context context-type="linenumber">73</context>
</context-group>
</trans-unit>
<trans-unit id="912825160188860007" datatype="html">
<source>Please add a currency:</source>
<target state="new">Please add a currency:</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">106</context>
</context-group>
</trans-unit>
<trans-unit id="8122024350760043460" datatype="html">
<source>Do you really want to delete this coupon?</source>
<target state="new">Do you really want to delete this coupon?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">120</context>
</context-group>
</trans-unit>
<trans-unit id="1110981355132746478" datatype="html">
<source>Do you really want to delete this currency?</source>
<target state="new">Do you really want to delete this currency?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">133</context>
</context-group>
</trans-unit>
<trans-unit id="6470890277760887814" datatype="html">
<source>Do you really want to flush the cache?</source>
<target state="new">Do you really want to flush the cache?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">150</context>
</context-group>
</trans-unit>
<trans-unit id="2712770700065625080" datatype="html">
<source>Please set your system message:</source>
<target state="new">Please set your system message:</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">199</context>
</context-group>
</trans-unit>
<trans-unit id="2817099043823177227" datatype="html">
<source>Do you really want to delete this user?</source>
<target state="new">Do you really want to delete this user?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-users/admin-users.component.ts</context>
<context context-type="linenumber">59</context>
</context-group>
</trans-unit>
<trans-unit id="6785405835169448749" datatype="html">
<source>Please enter the amount of your emergency fund:</source>
<target state="new">Please enter the amount of your emergency fund:</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts</context>
<context context-type="linenumber">48</context>
</context-group>
</trans-unit>
<trans-unit id="9125861665818782838" datatype="html">
<source>This feature is currently unavailable. Please try again later.</source>
<target state="new">This feature is currently unavailable. Please try again later.</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">59</context>
</context-group>
</trans-unit>
<trans-unit id="3041670542776846470" datatype="html">
<source>This feature requires a subscription.</source>
<target state="new">This feature requires a subscription.</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">65</context>
</context-group>
</trans-unit>
<trans-unit id="5499742151525073097" datatype="html">
<source>Upgrade Plan</source>
<target state="new">Upgrade Plan</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">67</context>
</context-group>
</trans-unit>
<trans-unit id="5185931223939324051" datatype="html">
<source>Oops! Something went wrong. Please try again later.</source>
<target state="new">Oops! Something went wrong. Please try again later.</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">84</context>
</context-group>
</trans-unit>
<trans-unit id="1579692722565712588" datatype="html">
<source>Okay</source>
<target state="new">Okay</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">85</context>
</context-group>
</trans-unit>
<trans-unit id="5196970976032945030" datatype="html">
<source>Please enter your coupon code:</source>
<target state="new">Please enter your coupon code:</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">221</context>
</context-group>
</trans-unit>
<trans-unit id="4420880039966769543" datatype="html">
<source>Could not redeem coupon code</source>
<target state="new">Could not redeem coupon code</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">231</context>
</context-group>
</trans-unit>
<trans-unit id="4819099731531004979" datatype="html">
<source>Coupon code has been redeemed</source>
<target state="new">Coupon code has been redeemed</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">243</context>
</context-group>
</trans-unit>
<trans-unit id="7967484035994732534" datatype="html">
<source>Reload</source>
<target state="new">Reload</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">244</context>
</context-group>
</trans-unit>
<trans-unit id="7963559562180316948" datatype="html">
<source>Do you really want to remove this sign in method?</source>
<target state="new">Do you really want to remove this sign in method?</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">290</context>
</context-group>
</trans-unit>
<trans-unit id="7407412980480383749" datatype="html">
<source>As you are already logged in, you cannot access the demo account.</source>
<target state="new">As you are already logged in, you cannot access the demo account.</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/demo/demo-page.component.ts</context>
<context context-type="linenumber">31</context>
</context-group>
</trans-unit>
<trans-unit id="848497846891931418" datatype="html">
<source>Importing data...</source>
<target state="new">Importing data...</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts</context>
<context context-type="linenumber">191</context>
</context-group>
</trans-unit>
<trans-unit id="7500216440144530775" datatype="html">
<source>Import has been completed</source>
<target state="new">Import has been completed</target>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts</context>
<context context-type="linenumber">337</context>
</context-group>
</trans-unit>
<trans-unit id="670983159637074283" datatype="html">
<source>Do you really want to delete this activity?</source>
<target state="new">Do you really want to delete this activity?</target>
<context-group purpose="location">
<context context-type="sourcefile">libs/ui/src/lib/activities-table/activities-table.component.ts</context>
<context context-type="linenumber">136</context>
</context-group>
</trans-unit>
</body>
</file>
</xliff>

161
apps/client/src/locales/messages.xlf

@ -2255,6 +2255,167 @@
<context context-type="linenumber">126</context>
</context-group>
</trans-unit>
<trans-unit id="1110981355132746478" datatype="html">
<source>Do you really want to delete this currency?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">133</context>
</context-group>
</trans-unit>
<trans-unit id="1579692722565712588" datatype="html">
<source>Okay</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">85</context>
</context-group>
</trans-unit>
<trans-unit id="2712770700065625080" datatype="html">
<source>Please set your system message:</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">199</context>
</context-group>
</trans-unit>
<trans-unit id="2817099043823177227" datatype="html">
<source>Do you really want to delete this user?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-users/admin-users.component.ts</context>
<context context-type="linenumber">59</context>
</context-group>
</trans-unit>
<trans-unit id="3041670542776846470" datatype="html">
<source>This feature requires a subscription.</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">65</context>
</context-group>
</trans-unit>
<trans-unit id="4420880039966769543" datatype="html">
<source>Could not redeem coupon code</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">231</context>
</context-group>
</trans-unit>
<trans-unit id="4819099731531004979" datatype="html">
<source>Coupon code has been redeemed</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">243</context>
</context-group>
</trans-unit>
<trans-unit id="5185931223939324051" datatype="html">
<source>Oops! Something went wrong. Please try again later.</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">84</context>
</context-group>
</trans-unit>
<trans-unit id="5196970976032945030" datatype="html">
<source>Please enter your coupon code:</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">221</context>
</context-group>
</trans-unit>
<trans-unit id="5499742151525073097" datatype="html">
<source>Upgrade Plan</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">67</context>
</context-group>
</trans-unit>
<trans-unit id="6470890277760887814" datatype="html">
<source>Do you really want to flush the cache?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">150</context>
</context-group>
</trans-unit>
<trans-unit id="670983159637074283" datatype="html">
<source>Do you really want to delete this activity?</source>
<context-group purpose="location">
<context context-type="sourcefile">libs/ui/src/lib/activities-table/activities-table.component.ts</context>
<context context-type="linenumber">136</context>
</context-group>
</trans-unit>
<trans-unit id="6785405835169448749" datatype="html">
<source>Please enter the amount of your emergency fund:</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/portfolio-summary/portfolio-summary.component.ts</context>
<context context-type="linenumber">48</context>
</context-group>
</trans-unit>
<trans-unit id="7407412980480383749" datatype="html">
<source>As you are already logged in, you cannot access the demo account.</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/demo/demo-page.component.ts</context>
<context context-type="linenumber">31</context>
</context-group>
</trans-unit>
<trans-unit id="7500216440144530775" datatype="html">
<source>Import has been completed</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts</context>
<context context-type="linenumber">337</context>
</context-group>
</trans-unit>
<trans-unit id="7963559562180316948" datatype="html">
<source>Do you really want to remove this sign in method?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">290</context>
</context-group>
</trans-unit>
<trans-unit id="7967484035994732534" datatype="html">
<source>Reload</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/account/account-page.component.ts</context>
<context context-type="linenumber">244</context>
</context-group>
</trans-unit>
<trans-unit id="8122024350760043460" datatype="html">
<source>Do you really want to delete this coupon?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">120</context>
</context-group>
</trans-unit>
<trans-unit id="8264698726451826067" datatype="html">
<source>Do you really want to revoke this granted access?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/access-table/access-table.component.ts</context>
<context context-type="linenumber">49</context>
</context-group>
</trans-unit>
<trans-unit id="8280212421112607879" datatype="html">
<source>Do you really want to delete this account?</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/accounts-table/accounts-table.component.ts</context>
<context context-type="linenumber">73</context>
</context-group>
</trans-unit>
<trans-unit id="848497846891931418" datatype="html">
<source>Importing data...</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/pages/portfolio/transactions/transactions-page.component.ts</context>
<context context-type="linenumber">191</context>
</context-group>
</trans-unit>
<trans-unit id="9125861665818782838" datatype="html">
<source>This feature is currently unavailable. Please try again later.</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/core/http-response.interceptor.ts</context>
<context context-type="linenumber">59</context>
</context-group>
</trans-unit>
<trans-unit id="912825160188860007" datatype="html">
<source>Please add a currency:</source>
<context-group purpose="location">
<context context-type="sourcefile">apps/client/src/app/components/admin-overview/admin-overview.component.ts</context>
<context context-type="linenumber">106</context>
</context-group>
</trans-unit>
</body>
</file>
</xliff>

4
libs/ui/src/lib/activities-table/activities-table.component.ts

@ -132,7 +132,9 @@ export class ActivitiesTableComponent implements OnChanges, OnDestroy {
}
public onDeleteActivity(aId: string) {
const confirmation = confirm('Do you really want to delete this activity?');
const confirmation = confirm(
$localize`Do you really want to delete this activity?`
);
if (confirmation) {
this.activityDeleted.emit(aId);

Loading…
Cancel
Save