feat(patch):统一清单驱动汉化发布
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-12 01:35:29 +08:00
parent 69b6e36bf0
commit 8a77502272
26 changed files with 2250 additions and 158 deletions
+13 -2
View File
@@ -1306,8 +1306,19 @@ func validateTranslationMemoryConfirmParams(params backendrpc.TranslationMemoryC
func validateLocalizedPublishParams(params backendrpc.LocalizedPublishParams) error {
hasFile := strings.TrimSpace(params.TranslationFile) != ""
if hasFile == params.FromWorker {
return errors.New("localized publish requires exactly one of translation_file or from_worker")
hasManifest := strings.TrimSpace(params.PatchManifest) != ""
inputs := 0
if hasFile {
inputs++
}
if params.FromWorker {
inputs++
}
if hasManifest {
inputs++
}
if inputs != 1 {
return errors.New("localized publish requires exactly one of translation_file, from_worker, or patch_manifest")
}
return nil
}