mirror of https://github.com/smithy-lang/smithy-rs
Add Japanese flavor text to the example pokemon service (#1480)
This commit is contained in:
parent
424d736768
commit
a183204493
|
@ -98,6 +98,11 @@ structure FlavorText {
|
|||
value: "it",
|
||||
documentation: "Italiano.",
|
||||
},
|
||||
{
|
||||
name: "JAPANESE",
|
||||
value: "jp",
|
||||
documentation: "日本語。",
|
||||
},
|
||||
])
|
||||
string Language
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ const PIKACHU_SPANISH_FLAVOR_TEXT: &str =
|
|||
"Cuando varios de estos Pokémon se juntan, su energía puede causar fuertes tormentas.";
|
||||
const PIKACHU_ITALIAN_FLAVOR_TEXT: &str =
|
||||
"Quando vari Pokémon di questo tipo si radunano, la loro energia può causare forti tempeste.";
|
||||
const PIKACHU_JAPANESE_FLAVOR_TEXT: &str =
|
||||
"ほっぺたの りょうがわに ちいさい でんきぶくろを もつ。ピンチのときに ほうでんする。";
|
||||
|
||||
/// Setup `tracing::subscriber` to read the log level from RUST_LOG environment variable.
|
||||
pub fn setup_tracing() {
|
||||
|
@ -42,6 +44,7 @@ struct PokemonTranslations {
|
|||
en: String,
|
||||
es: String,
|
||||
it: String,
|
||||
jp: String,
|
||||
}
|
||||
|
||||
/// PokémonService shared state.
|
||||
|
@ -115,6 +118,7 @@ impl Default for State {
|
|||
en: String::from(PIKACHU_ENGLISH_FLAVOR_TEXT),
|
||||
es: String::from(PIKACHU_SPANISH_FLAVOR_TEXT),
|
||||
it: String::from(PIKACHU_ITALIAN_FLAVOR_TEXT),
|
||||
jp: String::from(PIKACHU_JAPANESE_FLAVOR_TEXT),
|
||||
},
|
||||
);
|
||||
Self {
|
||||
|
@ -148,6 +152,10 @@ pub async fn get_pokemon_species(
|
|||
flavor_text: pokemon.it.to_owned(),
|
||||
language: model::Language::Italian,
|
||||
},
|
||||
model::FlavorText {
|
||||
flavor_text: pokemon.jp.to_owned(),
|
||||
language: model::Language::Japanese,
|
||||
},
|
||||
];
|
||||
let output = output::GetPokemonSpeciesOutput {
|
||||
name: String::from("pikachu"),
|
||||
|
|
Loading…
Reference in New Issue