From 8ca95a0215b00d31019d2a5b917d59aa5193df71 Mon Sep 17 00:00:00 2001 From: wadeking98 Date: Tue, 18 Oct 2022 13:34:00 -0700 Subject: [PATCH 1/2] added initial lear database entries Signed-off-by: wadeking98 --- src/i18n/en.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/i18n/en.json b/src/i18n/en.json index 5136bea..2e84cc8 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -55,6 +55,36 @@ "HIS": "Historical" }, "reason_description": { + "filing_type": "filing_type", + "alteration": "alteration", + "amalgamation": "amalgamation", + "amalgamationApplication": "amalgamationApplication", + "amendedAGM": "amendedAGM", + "amendedAnnualReport": "amendedAnnualReport", + "amendedChangeOfDirectors": "amendedChangeOfDirectors", + "annualReport": "annualReport", + "changeOfAddress": "changeOfAddress", + "changeOfDirectors": "changeOfDirectors", + "changeOfName": "changeOfName", + "changeOfRegistration": "changeOfRegistration", + "conversion": "conversion", + "correction": "correction", + "courtOrder": "courtOrder", + "dissolution": "dissolution", + "dissolved": "dissolved", + "F.18": "F.18", + "incorporationApplication": "incorporationApplication", + "Involuntary Dissolution": "Involuntary Dissolution", + "lear_epoch": "lear_epoch", + "putBackOn": "putBackOn", + "registrarsNotation": "registrarsNotation", + "registrarsOrder": "registrarsOrder", + "registration": "registration", + "restorationApplication": "restorationApplication", + "specialResolution": "specialResolution", + "transition": "transition", + "voluntaryDissolution": "voluntaryDissolution", + "voluntaryLiquidation": "voluntaryLiquidation", "Event:ADCOMM": "Administer Comments", "Event:ADCORP": "Administer Corporation", "Event:ADDLEDGR": "Update Ledger", From 527afbc5bc750732fb8897e1963fa9d6c6ab93d4 Mon Sep 17 00:00:00 2001 From: wadeking98 Date: Fri, 21 Oct 2022 16:41:08 -0700 Subject: [PATCH 2/2] LEAR translations working Signed-off-by: wadeking98 --- src/components/entity/CredentialItem.vue | 29 +++- src/components/entity/EntityResult.vue | 24 +++- .../entity/filter/EntityFilterFacetPanel.vue | 3 +- .../entity/filter/EntityFilterFacetPanels.vue | 4 +- .../entity/filter/EntityFilterFacets.vue | 10 +- src/i18n/en.json | 130 ++++++++++++++---- src/i18n/translate.ts | 37 +++++ src/utils/entity.ts | 12 ++ 8 files changed, 206 insertions(+), 43 deletions(-) create mode 100644 src/i18n/translate.ts diff --git a/src/components/entity/CredentialItem.vue b/src/components/entity/CredentialItem.vue index a87daa9..afc2657 100644 --- a/src/components/entity/CredentialItem.vue +++ b/src/components/entity/CredentialItem.vue @@ -17,7 +17,13 @@

{{ credTitle["key"] }}: - {{ translateValue(credTitle["accessor"], credTitle["value"]) }} + {{ + translateValue( + credTitle["accessor"], + credTitle["value"], + entityType + ) + }}

@@ -51,7 +57,7 @@ >
{{ attr["key"] }}
- {{ translateValue(attr["accessor"], attr["value"]) }} + {{ translateValue(attr["accessor"], attr["value"], entityType) }}
@@ -87,11 +93,12 @@ import { mapGetters } from "vuex"; import { ICredentialDisplayType } from "@/interfaces/api/v4/credential.interface"; import { selectFirstAttrItem } from "@/utils/attribute"; import i18n from "@/i18n/index"; +import { $translate } from "@/i18n/translate"; import { dateFilter } from "@/filters/date.filter"; import { IFormattedTopic } from "@/interfaces/api/v2/topic.interface"; import { ICredentialType } from "@/interfaces/api/v2/credential-type.interface"; import { TranslateResult } from "vue-i18n"; -import { isExpired } from "@/utils/entity"; +import { isExpired, toTranslationFormat } from "@/utils/entity"; @Component({ computed: { @@ -106,6 +113,7 @@ import { isExpired } from "@/utils/entity"; export default class CredentialItem extends Vue { @Prop({}) cred!: ICredentialDisplayType; + @Prop({ default: "" }) entityType!: string; @Prop({ default: "" }) authority!: string; @Prop({ default: "" }) authorityLink!: string; @Prop({ default: "" }) effectiveDate!: string; @@ -120,6 +128,8 @@ export default class CredentialItem extends Vue { credentialTypes!: ICredentialType[]; isExpired = isExpired; + toTranslationFormate = toTranslationFormat; + $translate = $translate; get getAuthorityLink(): string | URL { return this.cred ? this.cred.authorityLink : this.authorityLink; @@ -175,9 +185,16 @@ export default class CredentialItem extends Vue { } } - translateValue(accessor: string, val: string): string | TranslateResult { - const res = this.$t(accessor + "." + val); - if (res != accessor + "." + val) { + translateValue( + accessor: string, + val: string, + entityType: string + ): string | TranslateResult { + // need entity type to properly translate due to LEAR entries + const res = $translate( + toTranslationFormat(accessor + "." + val, entityType) + ); + if (res != toTranslationFormat(accessor + "." + val, entityType)) { return res; } return val; diff --git a/src/components/entity/EntityResult.vue b/src/components/entity/EntityResult.vue index e4bc0d7..536fc23 100644 --- a/src/components/entity/EntityResult.vue +++ b/src/components/entity/EntityResult.vue @@ -38,6 +38,7 @@