Skip to content

Commit b95b5f5

Browse files
authored
[ENG-10752] Clean up and optimize en.json to improve initial load performance (#942)
- Ticket: https://openscience.atlassian.net/browse/ENG-10752 - Feature flag: n/a ## Purpose Improve initial load performance and translations structure. ## Summary of Changes 1. Clean up translations. 2. Removed unused translations. 3. Updated format of some translations.
1 parent 47c377d commit b95b5f5

133 files changed

Lines changed: 2918 additions & 3180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/app/core/components/osf-banners/cookie-consent-banner/cookie-consent-banner.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<div class="grid flex-column w-full">
66
<div class="flex items-center align-items-start gap-2 font-medium">
77
<osf-icon iconClass="fas fa-triangle-exclamation"></osf-icon>
8-
{{ 'toast.cookie-consent.message' | translate }}
8+
{{ 'toast.cookieConsent.message' | translate }}
99
</div>
1010
<div class="row-fixed flex justify-content-end">
1111
<p-button
1212
class="btn-link-dark-blue"
1313
link
14-
[label]="'toast.cookie-consent.accept' | translate"
14+
[label]="'toast.cookieConsent.accept' | translate"
1515
(onClick)="acceptCookies()"
1616
/>
1717
</div>

src/app/core/components/osf-banners/tos-consent-banner/tos-consent-banner.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<osf-icon iconClass="fas fa-triangle-exclamation"></osf-icon>
88

99
<span class="font-medium">
10-
{{ 'toast.tos-consent.message' | translate }}
10+
{{ 'toast.tosConsent.message' | translate }}
1111
<a class="font-bold" [routerLink]="['/terms-of-use']" target="_blank">
12-
{{ 'toast.tos-consent.termsOfUse' | translate }}
12+
{{ 'toast.tosConsent.termsOfUse' | translate }}
1313
</a>
14-
{{ 'toast.tos-consent.and' | translate }}
14+
{{ 'toast.tosConsent.and' | translate }}
1515
<a class="font-bold" [routerLink]="['/privacy-policy']" target="_blank">
16-
{{ 'toast.tos-consent.privacyPolicy' | translate }}
16+
{{ 'toast.tosConsent.privacyPolicy' | translate }}
1717
</a>
1818
</span>
1919
</div>
@@ -29,13 +29,13 @@
2929
</p-checkbox>
3030

3131
<label for="terms" class="m-0 cursor-pointer">
32-
{{ 'toast.tos-consent.haveReadAndAgree' | translate }}
32+
{{ 'toast.tosConsent.haveReadAndAgree' | translate }}
3333
</label>
3434
</div>
3535

3636
<p-button
3737
link
38-
[label]="'toast.tos-consent.continue' | translate"
38+
[label]="'common.buttons.continue' | translate"
3939
[disabled]="!acceptedTermsOfService()"
4040
(onClick)="onContinue()"
4141
>

src/app/features/admin-institutions/constants/preprints-table-columns.constant.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const defaultDateFormat = 'MMM d, y';
55
export const preprintsTableColumns: TableColumn[] = [
66
{
77
field: 'title',
8-
header: 'adminInstitutions.projects.title',
8+
header: 'common.labels.title',
99
isLink: true,
1010
linkTarget: '_blank',
1111
},
@@ -17,13 +17,13 @@ export const preprintsTableColumns: TableColumn[] = [
1717
},
1818
{
1919
field: 'dateCreated',
20-
header: 'adminInstitutions.projects.dateCreated',
20+
header: 'common.labels.dateCreated',
2121
sortable: true,
2222
dateFormat: defaultDateFormat,
2323
},
2424
{
2525
field: 'dateModified',
26-
header: 'adminInstitutions.projects.dateModified',
26+
header: 'common.labels.dateModified',
2727
sortable: true,
2828
dateFormat: defaultDateFormat,
2929
},
@@ -35,7 +35,7 @@ export const preprintsTableColumns: TableColumn[] = [
3535
},
3636
{
3737
field: 'license',
38-
header: 'adminInstitutions.projects.license',
38+
header: 'common.labels.license',
3939
},
4040
{
4141
field: 'creator',

src/app/features/admin-institutions/constants/project-table-columns.constant.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const defaultDateFormat = 'MMM d, y';
55
export const projectTableColumns: TableColumn[] = [
66
{
77
field: 'title',
8-
header: 'adminInstitutions.projects.title',
8+
header: 'common.labels.title',
99
isLink: true,
1010
linkTarget: '_blank',
1111
},
@@ -17,13 +17,13 @@ export const projectTableColumns: TableColumn[] = [
1717
},
1818
{
1919
field: 'dateCreated',
20-
header: 'adminInstitutions.projects.dateCreated',
20+
header: 'common.labels.dateCreated',
2121
sortable: true,
2222
dateFormat: defaultDateFormat,
2323
},
2424
{
2525
field: 'dateModified',
26-
header: 'adminInstitutions.projects.dateModified',
26+
header: 'common.labels.dateModified',
2727
sortable: true,
2828
dateFormat: defaultDateFormat,
2929
},
@@ -67,7 +67,7 @@ export const projectTableColumns: TableColumn[] = [
6767
},
6868
{
6969
field: 'license',
70-
header: 'adminInstitutions.projects.license',
70+
header: 'common.labels.license',
7171
sortable: false,
7272
},
7373
{

src/app/features/admin-institutions/constants/registration-table-columns.constant.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const defaultDateFormat = 'MMM d, y';
55
export const registrationTableColumns: TableColumn[] = [
66
{
77
field: 'title',
8-
header: 'adminInstitutions.projects.title',
8+
header: 'common.labels.title',
99
isLink: true,
1010
linkTarget: '_blank',
1111
},
@@ -17,13 +17,13 @@ export const registrationTableColumns: TableColumn[] = [
1717
},
1818
{
1919
field: 'dateCreated',
20-
header: 'adminInstitutions.projects.dateCreated',
20+
header: 'common.labels.dateCreated',
2121
sortable: true,
2222
dateFormat: defaultDateFormat,
2323
},
2424
{
2525
field: 'dateModified',
26-
header: 'adminInstitutions.projects.dateModified',
26+
header: 'common.labels.dateModified',
2727
sortable: true,
2828
dateFormat: defaultDateFormat,
2929
},
@@ -62,7 +62,7 @@ export const registrationTableColumns: TableColumn[] = [
6262
},
6363
{
6464
field: 'license',
65-
header: 'adminInstitutions.projects.license',
65+
header: 'common.labels.license',
6666
},
6767
{
6868
field: 'funderName',

src/app/features/admin-institutions/mappers/creators.mapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function mapCreators(project: ResourceModel, currentInstitutionId: string
2121
?.filter((creator) => creator.affiliationsAbsoluteUrl.includes(currentInstitutionId))
2222
?.map((creator) => {
2323
const name = creator.name.trim();
24-
const role = creatorsRoles.find((cr) => cr.id === creator.absoluteUrl)!.role;
24+
const role = creatorsRoles.find((cr) => cr.id === creator.absoluteUrl)?.role;
2525
return {
2626
text: `${name} (${role})`,
2727
url: creator.absoluteUrl,

src/app/features/analytics/components/view-duplicates/view-duplicates.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class ViewDuplicatesComponent {
9494
resourceId,
9595
},
9696
{
97-
label: 'project.overview.actions.delete',
97+
label: 'common.labels.delete',
9898
action: 'delete',
9999
resourceId,
100100
},

src/app/features/auth/pages/forgot-password/forgot-password.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ <h2 class="text-center">{{ 'auth.forgotPassword.title' | translate }}</h2>
66
<form [formGroup]="forgotPasswordForm" (ngSubmit)="onSubmit()">
77
<osf-text-input
88
[control]="forgotPasswordForm.controls['email']"
9-
[label]="'auth.common.email'"
10-
[placeholder]="'auth.common.emailPlaceholder'"
9+
[label]="'common.labels.email'"
10+
[placeholder]="'common.labels.emailPlaceholder'"
1111
type="email"
1212
[maxLength]="emailLimit"
1313
></osf-text-input>
1414

1515
<p-button
1616
class="btn-full-width block mt-6"
1717
type="submit"
18-
[label]="'auth.forgotPassword.submit' | translate"
18+
[label]="'auth.common.resetPassword' | translate"
1919
[disabled]="!forgotPasswordForm.valid"
2020
></p-button>
2121
</form>

src/app/features/auth/pages/reset-password/reset-password.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h2 class="text-center">{{ 'auth.resetPassword.title' | translate }}</h2>
3737
<p-button
3838
class="btn-full-width block mt-6"
3939
type="submit"
40-
[label]="'auth.resetPassword.submit' | translate"
40+
[label]="'auth.common.resetPassword' | translate"
4141
[disabled]="resetPasswordForm.invalid"
4242
></p-button>
4343
</form>

src/app/features/auth/pages/sign-up/sign-up.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ <h2 class="text-center">{{ 'auth.signUp.title' | translate }}</h2>
6060
<div class="flex flex-column">
6161
<osf-text-input
6262
[control]="signUpForm.controls['email1']"
63-
[label]="'auth.common.email'"
64-
[placeholder]="'auth.common.emailPlaceholder'"
63+
[label]="'common.labels.email'"
64+
[placeholder]="'common.labels.emailPlaceholder'"
6565
type="email"
6666
[maxLength]="inputLimits.email.maxLength"
6767
></osf-text-input>
@@ -71,7 +71,7 @@ <h2 class="text-center">{{ 'auth.signUp.title' | translate }}</h2>
7171
<osf-text-input
7272
[control]="signUpForm.controls['email2']"
7373
[label]="'auth.common.confirmEmail'"
74-
[placeholder]="'auth.common.emailPlaceholder'"
74+
[placeholder]="'common.labels.emailPlaceholder'"
7575
type="email"
7676
[maxLength]="inputLimits.email.maxLength"
7777
></osf-text-input>

0 commit comments

Comments
 (0)