mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 14:54:23 +08:00
feat(i18n): default to English, localize runtime text and add Russian (#52)
This commit is contained in:
@@ -363,9 +363,9 @@ func RequestForceSync(ctx context.Context, id uint) (*View, error) {
|
||||
activeConfig, err := repository.GetActiveConfigVersion(ctx)
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, fmt.Errorf("无法获取当前激活的配置版本:%s", errNoActiveConfigVersion)
|
||||
return nil, fmt.Errorf("unable to get the currently active configuration version: %s", errNoActiveConfigVersion)
|
||||
}
|
||||
return nil, fmt.Errorf("无法获取当前激活的配置版本:%w", err)
|
||||
return nil, fmt.Errorf("unable to get the currently active configuration version: %w", err)
|
||||
}
|
||||
if !ofws.SendForceSyncConfig(node.NodeID, forceSyncConfigPayload{
|
||||
Version: activeConfig.Version,
|
||||
@@ -418,14 +418,14 @@ type forceSyncConfigPayload struct {
|
||||
func ValidateDiscoveryToken(ctx context.Context, token string) error {
|
||||
token = strings.TrimSpace(token)
|
||||
if token == "" {
|
||||
return errors.New("缺少 Discovery Token")
|
||||
return errors.New("missing discovery token")
|
||||
}
|
||||
discoveryToken, err := ensureGlobalDiscoveryToken(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !tokenEqual(token, discoveryToken) {
|
||||
return errors.New("discovery Token 无效") // error 消息首字母小写
|
||||
return errors.New("invalid discovery token") // error 消息首字母小写
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user