This video is available to students only

Translations

Adding another bit of customization to the query builder -- a Spanish translation

Let's take our configuration to the next level. First, we'll add a Spanish translation to the query builder.

Spanish translation#

Create a file called types.ts that exports the type Language, which consists of the two strings "en" and "es" (English and Spanish, respectively).

Add a state variable to the App component to track the language. Default the value to "en" to represent English.

Next, add a language selector at the top of the return statement.

 

Start a new discussion. All notification go to the author.