Back

[SOLVED ]How to change errors text?

  • 0
  • Flutter
Chewbacca
26 Mar, 2023, 12:10

Hi, how can I make a snackbar with a changed error text when registering with catch (e)? I want to translate the error text.

TL;DR
Solution: To change the error text displayed in a snackbar during registration, you can create a function to translate the error message. Firstly, you need to refer to the error type documentation provided (https://appwrite.io/docs/response-codes#errorTypes) to get the specific error types you want to translate. Next, using the example code provided, you can create a function in your code that takes in the error message as a parameter and returns the translated version of the error. Here is an example code snippet in Dart: ```dart String errorToMyLang(String error) { switch (error) { case '
Binyamin
26 Mar, 2023, 13:44

You can do something like this

TypeScript
errorToMyLang(error){
  swtich(error)
    case 'Some errror':
      return 'Translated'
    default:
      return error;
}

You'll compere the server error and then show the user an translated one

Drake
26 Mar, 2023, 16:12

How to change errors text?

Drake
26 Mar, 2023, 16:13

I suggest looking at the error type: https://appwrite.io/docs/response-codes#errorTypes

Chewbacca
26 Mar, 2023, 16:42

Thank you

Chewbacca
26 Mar, 2023, 16:42

[SOLVED ]How to change errors text?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more