mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 08:14:55 +08:00
feat(patch):统一清单驱动汉化发布
This commit is contained in:
+13
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user