Skip to content

Commit d030686

Browse files
committed
fix: clarify error messages for untranslated metadata in composer.json, fixes #622
1 parent 765b83c commit d030686

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

extension/validator.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,29 +209,29 @@ func runDefaultValidate(vc *ValidationContext) {
209209

210210
metaData := vc.Extension.GetMetaData()
211211
if len([]rune(metaData.Label.German)) == 0 {
212-
vc.AddError("metadata.label", "label is not translated in german")
212+
vc.AddError("metadata.label", "in composer.json, label is not translated in german")
213213
}
214214

215215
if len(metaData.Label.English) == 0 {
216-
vc.AddError("metadata.label", "label is not translated in english")
216+
vc.AddError("metadata.label", "in composer.json, label is not translated in english")
217217
}
218218

219219
// Skip description validation for ShopwareBundle
220220
if vc.Extension.GetType() != TypeShopwareBundle {
221221
if len([]rune(metaData.Description.German)) == 0 {
222-
vc.AddError("metadata.description", "description is not translated in german")
222+
vc.AddError("metadata.description", "in composer.json, description is not translated in german")
223223
}
224224

225225
if len(metaData.Description.English) == 0 {
226-
vc.AddError("metadata.description", "description is not translated in english")
226+
vc.AddError("metadata.description", "in composer.json, description is not translated in english")
227227
}
228228

229229
if len([]rune(metaData.Description.German)) < 150 || len([]rune(metaData.Description.German)) > 185 {
230-
vc.AddError("metadata.description", fmt.Sprintf("the german description with length of %d should have a length from 150 up to 185 characters.", len([]rune(metaData.Description.German))))
230+
vc.AddError("metadata.description", fmt.Sprintf("in composer.json, the german description with length of %d should have a length from 150 up to 185 characters.", len([]rune(metaData.Description.German))))
231231
}
232232

233233
if len(metaData.Description.English) < 150 || len(metaData.Description.English) > 185 {
234-
vc.AddError("metadata.description", fmt.Sprintf("the english description with length of %d should have a length from 150 up to 185 characters.", len(metaData.Description.English)))
234+
vc.AddError("metadata.description", fmt.Sprintf("in composer.json, the english description with length of %d should have a length from 150 up to 185 characters.", len(metaData.Description.English)))
235235
}
236236
}
237237
}

0 commit comments

Comments
 (0)