Traduire messages d'erreurs en français
Il serait intéressant d'ajouter un méchanisme d'internationalisation des chaines.
This commit is contained in:
parent
660d8826e2
commit
bacd4d737e
3 changed files with 20 additions and 20 deletions
|
@ -47,7 +47,7 @@ func (a *ApiClient) Call(method, route string, requestBody io.Reader, useKey boo
|
|||
|
||||
if useKey {
|
||||
if a.Key == "" {
|
||||
return response, fmt.Errorf("Call to API required a key but none was provided. See --help for instructions on providing an API key.")
|
||||
return response, fmt.Errorf("L'appel au serveur API requiert une clé, mais aucune n'était donnée. Voir --help pour les instructions sur comment fournir une clé API.")
|
||||
}
|
||||
|
||||
request.Header.Add("Authorization", fmt.Sprintf("Bearer %s", a.Key))
|
||||
|
@ -87,7 +87,7 @@ func (a *ApiClient) GetHealth() (string, error) {
|
|||
}
|
||||
|
||||
if response.Message == "" {
|
||||
return response.Message, errors.New("Could not confirm that API server is up, no response message")
|
||||
return response.Message, errors.New("Impossible de confirmer l'état du serveur API.")
|
||||
}
|
||||
|
||||
return response.Message, nil
|
||||
|
|
|
@ -87,7 +87,7 @@ func (d *DataClient) InsertTransactions(transactions []models.Transaction) ([]mo
|
|||
// Check values
|
||||
if transaction.MembreID == "" {
|
||||
tx.Rollback()
|
||||
return rowsInserted, errors.New("Cannot insert transaction with no membre_id")
|
||||
return rowsInserted, errors.New("Impossible d'insérer une transaction sans membre_id")
|
||||
}
|
||||
|
||||
rows, err := tx.NamedQuery("INSERT INTO transactions (membre_id, given_at, is_perpetual) VALUES (:membre_id, current_timestamp, :is_perpetual) RETURNING id, membre_id, is_perpetual;", &transaction)
|
||||
|
@ -126,7 +126,7 @@ func (d *DataClient) GetTransaction(membreID string, is_perpetual bool) (models.
|
|||
}
|
||||
|
||||
if transaction.ID == "" {
|
||||
return transaction, fmt.Errorf("No transaction found")
|
||||
return transaction, fmt.Errorf("Aucune transaction trouvée")
|
||||
}
|
||||
|
||||
return transaction, nil
|
||||
|
|
Reference in a new issue