@@ -19,10 +19,9 @@ const VENDORS_DIR = path.join(MANIFESTS_DIR, 'vendors')
1919interface VendorData {
2020 name: string
2121 websiteUrl: string | null
22- docsUrl: string | null
2322 verified: boolean
2423 communityUrls: CommunityUrls | null
25- i18n : Record < string , { description ?: string } > | null
24+ translations : Record < string , { description ?: string } > | null
2625}
2726
2827interface CommunityUrls {
@@ -39,10 +38,9 @@ interface VendorObject {
3938 id: string
4039 name: string
4140 description: string
42- i18n: Record < string , { description ?: string } >
43- websiteUrl : string | null
44- docsUrl: string | null
41+ translations: Record < string , { description ?: string } >
4542 verified : boolean
43+ websiteUrl: string | null
4644 communityUrls: CommunityUrls
4745}
4846
@@ -164,29 +162,25 @@ function mergeVendorData(existing: VendorData, newData: VendorData): VendorData
164162 merged . websiteUrl = newData . websiteUrl
165163 }
166164
167- if ( ! merged . docsUrl && newData . docsUrl ) {
168- merged . docsUrl = newData . docsUrl
169- }
170-
171165 if ( merged . verified === undefined && newData . verified !== undefined ) {
172166 merged . verified = newData . verified
173167 }
174168
175169 // Merge communityUrls
176170 merged . communityUrls = mergeCommunityUrls ( merged . communityUrls , newData . communityUrls )
177171
178- // Merge i18n if both exist
179- if ( newData . i18n ) {
180- if ( ! merged . i18n ) {
181- merged . i18n = { }
172+ // Merge translations if both exist
173+ if ( newData . translations ) {
174+ if ( ! merged . translations ) {
175+ merged . translations = { }
182176 }
183- // Merge i18n descriptions for each locale
184- for ( const locale of Object . keys ( newData . i18n ) ) {
185- if ( ! merged . i18n [ locale ] ) {
186- merged . i18n [ locale ] = { }
177+ // Merge translations descriptions for each locale
178+ for ( const locale of Object . keys ( newData . translations ) ) {
179+ if ( ! merged . translations [ locale ] ) {
180+ merged . translations [ locale ] = { }
187181 }
188- if ( ! merged . i18n [ locale ] . description && newData . i18n [ locale ] ?. description ) {
189- merged . i18n [ locale ] . description = newData . i18n [ locale ] . description
182+ if ( ! merged . translations [ locale ] . description && newData . translations [ locale ] ?. description ) {
183+ merged . translations [ locale ] . description = newData . translations [ locale ] . description
190184 }
191185 }
192186 }
@@ -207,13 +201,13 @@ function extractVendorData(manifest: Record<string, unknown>): VendorData | null
207201 const vendorData : VendorData = {
208202 name : manifest . vendor as string ,
209203 websiteUrl : ( manifest . websiteUrl as string | null ) || null ,
210- docsUrl : ( manifest . docsUrl as string | null ) || null ,
211204 verified :
212205 ( manifest . verified as boolean | undefined ) !== undefined
213206 ? ( manifest . verified as boolean )
214207 : false ,
215208 communityUrls : ( manifest . communityUrls as CommunityUrls | null ) || null ,
216- i18n : ( manifest . i18n as Record < string , { description ?: string } > | null ) || null ,
209+ translations :
210+ ( manifest . translations as Record < string , { description ?: string } > | null ) || null ,
217211 }
218212
219213 return vendorData
@@ -233,10 +227,9 @@ function createVendorObject(vendorId: string, vendorData: VendorData): VendorObj
233227 id: vendorId,
234228 name: vendorData.name,
235229 description: (vendorData as { description?: string }).description || defaultDescription,
236- i18n: vendorData.i18n || {},
237- websiteUrl: vendorData.websiteUrl || null,
238- docsUrl: vendorData.docsUrl || null,
230+ translations: vendorData.translations || {},
239231 verified: vendorData.verified !== undefined ? vendorData.verified : false,
232+ websiteUrl: vendorData.websiteUrl || null,
240233 communityUrls: mergeCommunityUrls(null, vendorData.communityUrls),
241234 }
242235
0 commit comments