TypeChat
TypeChat copied to clipboard
How to handle multiple languages?
From the restaurant example, we find this type in the schema:
export type Pizza = {
itemType: "pizza";
// default: large
size?: "small" | "medium" | "large" | "extra large";
// toppings requested (examples: pepperoni, arugula)
addedToppings?: string[];
// toppings requested to be removed (examples: fresh garlic, anchovies)
removedToppings?: string[];
// default: 1
quantity?: number;
// used if the requester references a pizza by name
name?: "Hawaiian" | "Yeti" | "Pig In a Forest" | "Cherry Bomb";
};
It appears that values in strings and comments (in English) are used to help construct the response JSON.
Would there need to be one schema file per language where all strings and comments are in a given language?
- foodOrderViewShema.en-US.ts
- foodOrderViewShema.en-GB.ts
- foodOrderViewShema.pt-BR.ts