feat(i18n): add English and Simplified Chinese
This commit is contained in:
1 parent
38c4c8b781
commit
1e9e0678ee
149 files changed
+5356
-1144
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package api
|
||||
|
||||
import "net/http"
|
||||
import "rawmark/internal/i18n"
|
||||
|
||||
func (s *Server) cleanupImages(w http.ResponseWriter, r *http.Request) {
|
||||
var body struct {
|
||||
@@ -10,7 +11,7 @@ func (s *Server) cleanupImages(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if len(body.Paths) == 0 || len(body.Paths) > 1000 {
|
||||
writeError(w, 400, "请选择 1~1000 张待清理图片")
|
||||
writeError(w, 400, message(w, "select_between_and_images_to_338e4e"))
|
||||
return
|
||||
}
|
||||
result, err := s.vault.CleanupImages(body.Paths)
|
||||
@@ -18,5 +19,8 @@ func (s *Server) cleanupImages(w http.ResponseWriter, r *http.Request) {
|
||||
vaultError(w, r, err)
|
||||
return
|
||||
}
|
||||
for i := range result.Skipped {
|
||||
result.Skipped[i].Reason = i18n.RenderError(result.Skipped[i].Cause, responseLocale(w))
|
||||
}
|
||||
writeJSON(w, 200, result)
|
||||
}
|
||||
Reference in new issue
Block a user