use crate::models::{title_case, EvolutionCondition, EvolutionTrigger, StatKind};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Language {
English,
Turkish,
German,
French,
Spanish,
Italian,
}
impl Language {
pub const ALL: [Language; 6] = [
Language::English,
Language::Turkish,
Language::German,
Language::French,
Language::Spanish,
Language::Italian,
];
pub fn index(self) -> usize {
Language::ALL.iter().position(|&l| l == self).unwrap_or(0)
}
pub fn label(self) -> &'static str {
match self {
Language::English => "English",
Language::Turkish => "Tรผrkรงe",
Language::German => "Deutsch",
Language::French => "Franรงais",
Language::Spanish => "Espaรฑol",
Language::Italian => "Italiano",
}
}
pub fn flavor_code(self) -> &'static str {
match self {
Language::English => "en",
Language::Turkish => "tr",
Language::German => "de",
Language::French => "fr",
Language::Spanish => "es",
Language::Italian => "it",
}
}
pub fn from_code(code: &str) -> Option<Language> {
Language::ALL
.into_iter()
.find(|language| language.flavor_code() == code)
}
pub fn tag(self) -> &'static str {
match self {
Language::English => "EN",
Language::Turkish => "TR",
Language::German => "DE",
Language::French => "FR",
Language::Spanish => "ES",
Language::Italian => "IT",
}
}
pub fn strings(self) -> Strings {
match self {
Language::English => Strings::english(),
Language::Turkish => Strings::turkish(),
Language::German => Strings::german(),
Language::French => Strings::french(),
Language::Spanish => Strings::spanish(),
Language::Italian => Strings::italian(),
}
}
pub fn stat_label(self, kind: StatKind) -> &'static str {
let s = self.strings();
match kind {
StatKind::Hp => s.stat_hp,
StatKind::Attack => s.stat_attack,
StatKind::Defense => s.stat_defense,
StatKind::SpecialAttack => s.stat_sp_attack,
StatKind::SpecialDefense => s.stat_sp_defense,
StatKind::Speed => s.stat_speed,
}
}
}
#[derive(Debug, Clone, Copy)]
pub struct Strings {
pub app_title: &'static str,
pub sidebar_title: &'static str,
pub search_title: &'static str,
pub details_title: &'static str,
pub evolution_title: &'static str,
pub loading: &'static str,
pub loading_list: &'static str,
pub no_selection: &'static str,
pub no_results: &'static str,
pub no_evolution: &'static str,
pub types_label: &'static str,
pub height_label: &'static str,
pub weight_label: &'static str,
pub total_label: &'static str,
pub egg_groups_label: &'static str,
pub genderless: &'static str,
pub catch_rate_label: &'static str,
pub catch_hard: &'static str,
pub catch_average: &'static str,
pub catch_easy: &'static str,
pub growth_label: &'static str,
pub happiness_label: &'static str,
pub habitat_label: &'static str,
pub error_prefix: &'static str,
pub stat_hp: &'static str,
pub stat_attack: &'static str,
pub stat_defense: &'static str,
pub stat_sp_attack: &'static str,
pub stat_sp_defense: &'static str,
pub stat_speed: &'static str,
pub help: &'static str,
pub search_hint: &'static str,
pub sort_dex: &'static str,
pub sort_name: &'static str,
pub loading_filter: &'static str,
pub team_title: &'static str,
pub team_empty: &'static str,
pub team_shared_weak: &'static str,
pub team_unresisted: &'static str,
pub team_offense_gaps: &'static str,
pub team_all_clear: &'static str,
pub immune_by_ability: &'static str,
pub immunity_maybe: &'static str,
pub team_close_hint: &'static str,
pub abilities_label: &'static str,
pub abilities_title: &'static str,
pub ability_hidden: &'static str,
pub ability_close_hint: &'static str,
pub moves_title: &'static str,
pub moves_empty: &'static str,
pub moves_close_hint: &'static str,
pub forms_label: &'static str,
pub forms_title: &'static str,
pub forms_close_hint: &'static str,
pub col_learn: &'static str,
pub col_move: &'static str,
pub col_type: &'static str,
pub col_category: &'static str,
pub col_power: &'static str,
pub col_accuracy: &'static str,
pub col_pp: &'static str,
pub learn_machine: &'static str,
pub learn_egg: &'static str,
pub learn_tutor: &'static str,
pub class_physical: &'static str,
pub class_special: &'static str,
pub class_status: &'static str,
pub expand_hint: &'static str,
pub evo_nav_hint: &'static str,
pub evo_card_hint: &'static str,
pub sprite_loading: &'static str,
pub language_title: &'static str,
pub matchups_title: &'static str,
pub matchups_defense: &'static str,
pub matchups_offense: &'static str,
pub matchups_none: &'static str,
pub close_hint: &'static str,
pub compare_title: &'static str,
pub compare_best_hit: &'static str,
pub compare_tie: &'static str,
pub compare_hint: &'static str,
pub help_card: HelpStrings,
pub evo: EvoStrings,
pub legendary_label: &'static str,
pub mythical_label: &'static str,
pub baby_label: &'static str,
pub shiny_label: &'static str,
}
#[derive(Debug, Clone, Copy)]
pub struct HelpStrings {
pub title: &'static str,
pub ctx_list: &'static str,
pub ctx_search: &'static str,
pub ctx_evolution: &'static str,
pub ctx_party: &'static str,
pub ctx_forms: &'static str,
pub ctx_cards: &'static str,
pub act_move: &'static str,
pub act_jump10: &'static str,
pub act_load: &'static str,
pub act_search: &'static str,
pub act_evolutions: &'static str,
pub act_types: &'static str,
pub act_abilities: &'static str,
pub act_moves: &'static str,
pub act_forms: &'static str,
pub act_shiny: &'static str,
pub act_random: &'static str,
pub act_party_toggle: &'static str,
pub act_party_card: &'static str,
pub act_sort: &'static str,
pub act_language: &'static str,
pub act_help: &'static str,
pub act_quit: &'static str,
pub act_load_back: &'static str,
pub act_back: &'static str,
pub act_by_type: &'static str,
pub act_by_ability: &'static str,
pub act_by_egg: &'static str,
pub act_by_generation: &'static str,
pub act_chain_move: &'static str,
pub act_chain_jump: &'static str,
pub act_form_jump: &'static str,
pub act_chain_expand: &'static str,
pub act_compare: &'static str,
pub act_close: &'static str,
pub close_hint: &'static str,
}
#[derive(Debug, Clone, Copy)]
pub struct EvoStrings {
pub level: &'static str,
pub level_up: &'static str,
pub trade: &'static str,
pub trade_with: &'static str,
pub use_item: &'static str,
pub held_item: &'static str,
pub knows_move: &'static str,
pub knows_move_type: &'static str,
pub happiness: &'static str,
pub affection: &'static str,
pub beauty: &'static str,
pub day: &'static str,
pub night: &'static str,
pub dusk: &'static str,
pub location: &'static str,
pub male: &'static str,
pub female: &'static str,
pub rain: &'static str,
pub upside_down: &'static str,
pub party_species: &'static str,
pub party_type: &'static str,
pub shed: &'static str,
}
impl EvoStrings {
pub fn parts(&self, condition: &EvolutionCondition) -> Vec<String> {
let fill = |template: &str, value: &str| template.replace("{}", value);
let mut parts = Vec::new();
if let Some(level) = condition.min_level {
parts.push(fill(self.level, &level.to_string()));
}
if let Some(item) = &condition.item {
parts.push(fill(self.use_item, &title_case(item)));
}
match (&condition.trigger, &condition.trade_species) {
(Some(EvolutionTrigger::Trade), Some(species)) => {
parts.push(fill(self.trade_with, &title_case(species)));
}
(Some(EvolutionTrigger::Trade), None) => parts.push(self.trade.to_string()),
(Some(EvolutionTrigger::Shed), _) => parts.push(self.shed.to_string()),
_ => {}
}
if let Some(item) = &condition.held_item {
parts.push(fill(self.held_item, &title_case(item)));
}
if let Some(move_) = &condition.known_move {
parts.push(fill(self.knows_move, &title_case(move_)));
}
if let Some(type_) = &condition.known_move_type {
parts.push(fill(self.knows_move_type, &title_case(type_)));
}
if let Some(value) = condition.min_happiness {
parts.push(fill(self.happiness, &value.to_string()));
}
if let Some(value) = condition.min_affection {
parts.push(fill(self.affection, &value.to_string()));
}
if let Some(value) = condition.min_beauty {
parts.push(fill(self.beauty, &value.to_string()));
}
if let Some(time) = condition.time_of_day.as_deref() {
match time {
"day" => parts.push(self.day.to_string()),
"night" => parts.push(self.night.to_string()),
"dusk" => parts.push(self.dusk.to_string()),
other => parts.push(title_case(other)),
}
}
if let Some(place) = &condition.location {
parts.push(fill(self.location, &title_case(place)));
}
match condition.gender {
Some(1) => parts.push(self.female.to_string()),
Some(2) => parts.push(self.male.to_string()),
_ => {}
}
if let Some(species) = &condition.party_species {
parts.push(fill(self.party_species, &title_case(species)));
}
if let Some(type_) = &condition.party_type {
parts.push(fill(self.party_type, &title_case(type_)));
}
if condition.needs_overworld_rain {
parts.push(self.rain.to_string());
}
if condition.turn_upside_down {
parts.push(self.upside_down.to_string());
}
if let Some(cmp) = condition.relative_physical_stats {
parts.push(match cmp {
1 => "Atk > Def".to_string(),
-1 => "Atk < Def".to_string(),
_ => "Atk = Def".to_string(),
});
}
if parts.is_empty() {
match &condition.trigger {
Some(EvolutionTrigger::LevelUp) => parts.push(self.level_up.to_string()),
Some(EvolutionTrigger::Other(slug)) => parts.push(title_case(slug)),
_ => {}
}
}
parts
}
pub fn summary(&self, condition: &EvolutionCondition) -> String {
self.parts(condition).join(" ยท ")
}
pub fn short(&self, condition: &EvolutionCondition) -> Option<String> {
self.parts(condition).into_iter().next()
}
}
impl Strings {
fn english() -> Self {
Strings {
app_title: " Pokeductor โ Pokedex & Evolution Analyzer ",
sidebar_title: " Pokemon ",
search_title: " Search ",
details_title: " Details ",
evolution_title: " Evolution Chain ",
loading: "Loading",
loading_list: "Fetching Pokedex",
no_selection: "Select a Pokemon and press Enter",
no_results: "No Pokemon match your search",
no_evolution: "No evolution data",
types_label: "Types",
height_label: "Height",
weight_label: "Weight",
total_label: "Total",
egg_groups_label: "Egg groups",
genderless: "Genderless",
catch_rate_label: "Catch rate",
catch_hard: "hard",
catch_average: "average",
catch_easy: "easy",
growth_label: "Growth",
happiness_label: "Happiness",
habitat_label: "Habitat",
error_prefix: "Error",
stat_hp: "HP",
stat_attack: "Attack",
stat_defense: "Defense",
stat_sp_attack: "Sp. Atk",
stat_sp_defense: "Sp. Def",
stat_speed: "Speed",
help: " โ/โ Navigate ยท Enter Select ยท / Search ยท ? Help ยท Q Quit ",
search_hint: "name ยท dex:25 ยท type:water ยท gen:1",
sort_dex: "Dex",
sort_name: "AโZ",
team_title: " Party ",
team_empty: "Press Space in the list to add a Pokemon",
team_shared_weak: "Shared weaknesses",
team_unresisted: "Resisted by nobody",
team_offense_gaps: "Hit hard by nobody",
team_all_clear: "nothing โ all covered",
abilities_label: "Abilities",
abilities_title: " Abilities ",
ability_hidden: "hidden",
ability_close_hint: "Esc / A to close",
moves_title: " Moves ",
moves_empty: "No learnset recorded",
moves_close_hint: "โ โ to browse ยท M / Esc to close",
forms_label: "Forms",
forms_title: " Forms ",
forms_close_hint: "โ โ Select ยท Enter Open ยท Esc / V to close",
col_learn: "Lv",
col_move: "Move",
col_type: "Type",
col_category: "Cat.",
col_power: "Pow",
col_accuracy: "Acc",
col_pp: "PP",
learn_machine: "TM",
learn_egg: "Egg",
learn_tutor: "Tutor",
class_physical: "Phys",
class_special: "Spec",
class_status: "Stat",
immune_by_ability: "Immune by ability",
immunity_maybe: "possible",
team_close_hint: "โ โ Select ยท C Pin / compare ยท Esc / P to close",
loading_filter: "Fetching the filter's list",
expand_hint: "Press E to browse evolutions",
evo_nav_hint: "โ/โ Select ยท Enter Jump ยท F Full screen ยท Esc Back",
evo_card_hint: "โ/โ Select ยท Enter Jump ยท F / Esc Close",
sprite_loading: "loadingโฆ",
language_title: " Language ",
matchups_title: " Type Matchups ",
matchups_defense: "Damage taken",
matchups_offense: "Super effective against",
matchups_none: "nothing",
close_hint: "Esc / T to close",
compare_title: " Head to Head ",
compare_best_hit: "Best same-type hit",
compare_tie: "level",
compare_hint: "Esc / C to close",
help_card: HelpStrings {
title: " Help ",
ctx_list: "List",
ctx_search: "Search box",
ctx_evolution: "Evolution panel",
ctx_party: "Party card",
ctx_forms: "Forms card",
ctx_cards: "Any card",
act_move: "Move selection",
act_jump10: "Jump ten",
act_load: "Load",
act_search: "Search",
act_evolutions: "Evolutions",
act_types: "Type matchups",
act_abilities: "Abilities",
act_moves: "Moves",
act_forms: "Alternate forms",
act_shiny: "Shiny artwork",
act_random: "Random from the list",
act_party_toggle: "Add / remove from party",
act_party_card: "Party",
act_sort: "Sort order",
act_language: "Language",
act_help: "This help",
act_quit: "Quit",
act_load_back: "Load and return",
act_back: "Back to list",
act_by_type: "Filter by type",
act_by_ability: "Filter by ability",
act_by_egg: "Filter by egg group",
act_by_generation: "Filter by generation",
act_chain_move: "Move between stages",
act_chain_jump: "Jump to stage",
act_form_jump: "Open form",
act_chain_expand: "Full-screen chain",
act_compare: "Pin / compare two species",
act_close: "Close",
close_hint: "? / Esc to close",
},
evo: EvoStrings {
level: "Lv. {}",
level_up: "Level up",
trade: "Trade",
trade_with: "Trade for {}",
use_item: "Use {}",
held_item: "Holding {}",
knows_move: "Knows {}",
knows_move_type: "Knows a {} move",
happiness: "Happiness {}",
affection: "Affection {}",
beauty: "Beauty {}",
day: "Daytime",
night: "At night",
dusk: "At dusk",
location: "At {}",
male: "Male",
female: "Female",
rain: "In rain",
upside_down: "Console upside down",
party_species: "With {} in party",
party_type: "With a {} type in party",
shed: "Empty party slot",
},
legendary_label: "Legendary",
mythical_label: "Mythical",
baby_label: "Baby",
shiny_label: "Shiny",
}
}
fn turkish() -> Self {
Strings {
app_title: " Pokeductor โ Pokedex ve Evrim Analizcisi ",
sidebar_title: " Pokemonlar ",
search_title: " Ara ",
details_title: " Ayrฤฑntฤฑlar ",
evolution_title: " Evrim Zinciri ",
loading: "Yรผkleniyor",
loading_list: "Pokedex getiriliyor",
no_selection: "Bir Pokemon seรงip Enter'a basฤฑn",
no_results: "Aramanฤฑzla eลleลen Pokemon yok",
no_evolution: "Evrim verisi yok",
types_label: "Tรผrler",
height_label: "Boy",
weight_label: "Aฤฤฑrlฤฑk",
total_label: "Toplam",
egg_groups_label: "Yumurta gruplarฤฑ",
genderless: "Cinsiyetsiz",
catch_rate_label: "Yakalama oranฤฑ",
catch_hard: "zor",
catch_average: "orta",
catch_easy: "kolay",
growth_label: "Geliลim",
happiness_label: "Mutluluk",
habitat_label: "Yaลam alanฤฑ",
error_prefix: "Hata",
stat_hp: "CAN",
stat_attack: "Saldฤฑrฤฑ",
stat_defense: "Savunma",
stat_sp_attack: "รz. Sal",
stat_sp_defense: "รz. Sav",
stat_speed: "Hฤฑz",
help: " โ/โ Gezin ยท Enter Seรง ยท / Ara ยท ? Yardฤฑm ยท Q รฤฑkฤฑล ",
search_hint: "isim ยท dex:25 ยท type:water ยท gen:1",
sort_dex: "Dex",
sort_name: "AโZ",
team_title: " Takฤฑm ",
team_empty: "Listede Boลluk tuลuyla Pokemon ekleyin",
team_shared_weak: "Ortak zayฤฑflฤฑklar",
team_unresisted: "Kimsenin direnmediฤi",
team_offense_gaps: "Kimsenin vuramadฤฑฤฤฑ",
team_all_clear: "yok โ hepsi kapalฤฑ",
abilities_label: "Yetenekler",
abilities_title: " Yetenekler ",
ability_hidden: "gizli",
ability_close_hint: "Kapatmak iรงin Esc / A",
moves_title: " Hareketler ",
moves_empty: "Kayฤฑtlฤฑ hareket listesi yok",
moves_close_hint: "โ โ gezin ยท M / Esc kapat",
forms_label: "Formlar",
forms_title: " Formlar ",
forms_close_hint: "โ โ Seรง ยท Enter Aรง ยท Esc / V Kapat",
col_learn: "Sv",
col_move: "Hareket",
col_type: "Tip",
col_category: "Tรผr",
col_power: "Gรผรง",
col_accuracy: "ฤฐsb",
col_pp: "PP",
learn_machine: "TM",
learn_egg: "Yumurta",
learn_tutor: "รฤretmen",
class_physical: "Fiz",
class_special: "รzel",
class_status: "Durum",
immune_by_ability: "Yetenekle baฤฤฑลฤฑk",
immunity_maybe: "olasฤฑ",
team_close_hint: "โ โ Seรง ยท C Sabitle / karลฤฑlaลtฤฑr ยท Esc / P Kapat",
loading_filter: "Filtre listesi getiriliyor",
expand_hint: "Evrimlere gรถz atmak iรงin E'ye basฤฑn",
evo_nav_hint: "โ/โ Seรง ยท Enter Git ยท F Tam ekran ยท Esc Geri",
evo_card_hint: "โ/โ Seรง ยท Enter Git ยท F / Esc Kapat",
sprite_loading: "yรผkleniyorโฆ",
language_title: " Dil ",
matchups_title: " Tip Etkinliฤi ",
matchups_defense: "Alฤฑnan hasar",
matchups_offense: "Karลฤฑ รผstรผn olduฤu tipler",
matchups_none: "yok",
close_hint: "Kapatmak iรงin Esc / T",
compare_title: " Karลฤฑlaลtฤฑrma ",
compare_best_hit: "En sert aynฤฑ tipten vuruล",
compare_tie: "eลit",
compare_hint: "Kapatmak iรงin Esc / C",
help_card: HelpStrings {
title: " Yardฤฑm ",
ctx_list: "Liste",
ctx_search: "Arama kutusu",
ctx_evolution: "Evrim paneli",
ctx_party: "Takฤฑm kartฤฑ",
ctx_forms: "Form kartฤฑ",
ctx_cards: "Tรผm kartlar",
act_move: "Seรงimi taลฤฑ",
act_jump10: "On atla",
act_load: "Yรผkle",
act_search: "Ara",
act_evolutions: "Evrimler",
act_types: "Tip eลleลmeleri",
act_abilities: "Yetenekler",
act_moves: "Hareketler",
act_forms: "Alternatif formlar",
act_shiny: "Parlak gรถrsel",
act_random: "Listeden rastgele",
act_party_toggle: "Takฤฑma ekle / รงฤฑkar",
act_party_card: "Takฤฑm",
act_sort: "Sฤฑralama",
act_language: "Dil",
act_help: "Bu yardฤฑm",
act_quit: "รฤฑkฤฑล",
act_load_back: "Yรผkle ve dรถn",
act_back: "Listeye dรถn",
act_by_type: "Tipe gรถre sรผz",
act_by_ability: "Yeteneฤe gรถre sรผz",
act_by_egg: "Yumurta grubuna gรถre sรผz",
act_by_generation: "Jenerasyona gรถre sรผz",
act_chain_move: "Aลamalar arasฤฑnda gez",
act_chain_jump: "Aลamaya atla",
act_form_jump: "Formu aรง",
act_chain_expand: "Zinciri tam ekran aรง",
act_compare: "Sabitle / iki tรผrรผ karลฤฑlaลtฤฑr",
act_close: "Kapat",
close_hint: "Kapatmak iรงin ? / Esc",
},
evo: EvoStrings {
level: "Sv. {}",
level_up: "Seviye atlayฤฑnca",
trade: "Takas",
trade_with: "{} ile takas",
use_item: "{} kullan",
held_item: "{} taลฤฑrken",
knows_move: "{} bilir",
knows_move_type: "{} tipi hamle bilir",
happiness: "Mutluluk {}",
affection: "Sevgi {}",
beauty: "Gรผzellik {}",
day: "Gรผndรผz",
night: "Gece",
dusk: "Alacakaranlฤฑk",
location: "{} bรถlgesinde",
male: "Erkek",
female: "Diลi",
rain: "Yaฤmurda",
upside_down: "Konsol ters รงevrili",
party_species: "Takฤฑmda {} varken",
party_type: "Takฤฑmda {} tipi varken",
shed: "Takฤฑmda boล yer",
},
legendary_label: "Efsanevi",
mythical_label: "Mitik",
baby_label: "Yavru",
shiny_label: "Parlak",
}
}
fn german() -> Self {
Strings {
app_title: " Pokeductor โ Pokedex & Evolutions-Analyse ",
sidebar_title: " Pokemon ",
search_title: " Suche ",
details_title: " Details ",
evolution_title: " Entwicklungsreihe ",
loading: "Lรคdt",
loading_list: "Pokedex wird geladen",
no_selection: "Wรคhle ein Pokemon und drรผcke Enter",
no_results: "Keine Pokemon gefunden",
no_evolution: "Keine Entwicklungsdaten",
types_label: "Typen",
height_label: "Grรถรe",
weight_label: "Gewicht",
total_label: "Summe",
egg_groups_label: "Ei-Gruppen",
genderless: "Geschlechtslos",
catch_rate_label: "Fangrate",
catch_hard: "schwer",
catch_average: "mittel",
catch_easy: "leicht",
growth_label: "Wachstum",
happiness_label: "Freundschaft",
habitat_label: "Lebensraum",
error_prefix: "Fehler",
stat_hp: "KP",
stat_attack: "Angriff",
stat_defense: "Verteid.",
stat_sp_attack: "Sp. Ang",
stat_sp_defense: "Sp. Vert",
stat_speed: "Tempo",
help: " โ/โ Navigieren ยท Enter Wรคhlen ยท / Suche ยท ? Hilfe ยท Q Beenden ",
search_hint: "Name ยท dex:25 ยท type:water ยท gen:1",
sort_dex: "Dex",
sort_name: "AโZ",
team_title: " Team ",
team_empty: "Leertaste in der Liste fรผgt ein Pokemon hinzu",
team_shared_weak: "Gemeinsame Schwรคchen",
team_unresisted: "Von niemandem resistiert",
team_offense_gaps: "Von niemandem hart getroffen",
team_all_clear: "nichts โ alles abgedeckt",
abilities_label: "Fรคhigkeiten",
abilities_title: " Fรคhigkeiten ",
ability_hidden: "versteckt",
ability_close_hint: "Esc / A zum Schlieรen",
moves_title: " Attacken ",
moves_empty: "Keine Attacken verzeichnet",
moves_close_hint: "โ โ blรคttern ยท M / Esc schlieรt",
forms_label: "Formen",
forms_title: " Formen ",
forms_close_hint: "โ โ Wรคhlen ยท Enter รffnen ยท Esc / V Schlieรen",
col_learn: "Lv",
col_move: "Attacke",
col_type: "Typ",
col_category: "Kat.",
col_power: "Str",
col_accuracy: "Gen",
col_pp: "AP",
learn_machine: "TM",
learn_egg: "Ei",
learn_tutor: "Lehrer",
class_physical: "Phys",
class_special: "Spez",
class_status: "Stat",
immune_by_ability: "Immun durch Fรคhigkeit",
immunity_maybe: "mรถglich",
team_close_hint: "โ โ Wรคhlen ยท C Anheften ยท Esc / P Schlieรen",
loading_filter: "Filterliste wird geladen",
expand_hint: "Drรผcke E fรผr die Entwicklungsreihe",
evo_nav_hint: "โ/โ Wรคhlen ยท Enter Springen ยท F Vollbild ยท Esc Zurรผck",
evo_card_hint: "โ/โ Wรคhlen ยท Enter Springen ยท F / Esc Schlieรen",
sprite_loading: "lรคdtโฆ",
language_title: " Sprache ",
matchups_title: " Typ-Effektivitรคt ",
matchups_defense: "Erlittener Schaden",
matchups_offense: "Sehr effektiv gegen",
matchups_none: "nichts",
close_hint: "Esc / T zum Schlieรen",
compare_title: " Direktvergleich ",
compare_best_hit: "Bester Treffer eigenen Typs",
compare_tie: "gleich",
compare_hint: "Esc / C zum Schlieรen",
help_card: HelpStrings {
title: " Hilfe ",
ctx_list: "Liste",
ctx_search: "Suchfeld",
ctx_evolution: "Entwicklungsfeld",
ctx_party: "Teamkarte",
ctx_forms: "Formenkarte",
ctx_cards: "Alle Karten",
act_move: "Auswahl bewegen",
act_jump10: "Zehn springen",
act_load: "Laden",
act_search: "Suche",
act_evolutions: "Entwicklungen",
act_types: "Typ-Matchups",
act_abilities: "Fรคhigkeiten",
act_moves: "Attacken",
act_forms: "Andere Formen",
act_shiny: "Schillernde Grafik",
act_random: "Zufรคllig aus der Liste",
act_party_toggle: "Team hinzu / entfernen",
act_party_card: "Team",
act_sort: "Sortierung",
act_language: "Sprache",
act_help: "Diese Hilfe",
act_quit: "Beenden",
act_load_back: "Laden und zurรผck",
act_back: "Zurรผck zur Liste",
act_by_type: "Nach Typ filtern",
act_by_ability: "Nach Fรคhigkeit filtern",
act_by_egg: "Nach Ei-Gruppe filtern",
act_by_generation: "Nach Generation filtern",
act_chain_move: "Zwischen Stufen",
act_chain_jump: "Zur Stufe springen",
act_form_jump: "Form รถffnen",
act_chain_expand: "Reihe im Vollbild",
act_compare: "Anheften / zwei vergleichen",
act_close: "Schlieรen",
close_hint: "? / Esc zum Schlieรen",
},
evo: EvoStrings {
level: "Lv. {}",
level_up: "Levelaufstieg",
trade: "Tausch",
trade_with: "Tausch gegen {}",
use_item: "{} benutzen",
held_item: "{} tragend",
knows_move: "Kennt {}",
knows_move_type: "Kennt {}-Attacke",
happiness: "Freundschaft {}",
affection: "Zuneigung {}",
beauty: "Schรถnheit {}",
day: "Tagsรผber",
night: "Nachts",
dusk: "In der Dรคmmerung",
location: "Bei {}",
male: "Mรคnnlich",
female: "Weiblich",
rain: "Bei Regen",
upside_down: "Konsole umgedreht",
party_species: "Mit {} im Team",
party_type: "Mit {}-Typ im Team",
shed: "Freier Teamplatz",
},
legendary_label: "Legendรคr",
mythical_label: "Mysteriรถs",
baby_label: "Baby",
shiny_label: "Schillernd",
}
}
fn french() -> Self {
Strings {
app_title: " Pokeductor โ Pokedex & Analyseur d'รvolution ",
sidebar_title: " Pokemon ",
search_title: " Recherche ",
details_title: " Dรฉtails ",
evolution_title: " Chaรฎne d'รvolution ",
loading: "Chargement",
loading_list: "Chargement du Pokedex",
no_selection: "Choisis un Pokemon et appuie sur Entrรฉe",
no_results: "Aucun Pokemon trouvรฉ",
no_evolution: "Pas de donnรฉes d'รฉvolution",
types_label: "Types",
height_label: "Taille",
weight_label: "Poids",
total_label: "Total",
egg_groups_label: "Groupes d'ลuf",
genderless: "Asexuรฉ",
catch_rate_label: "Taux de capture",
catch_hard: "difficile",
catch_average: "moyen",
catch_easy: "facile",
growth_label: "Croissance",
happiness_label: "Bonheur",
habitat_label: "Habitat",
error_prefix: "Erreur",
stat_hp: "PV",
stat_attack: "Attaque",
stat_defense: "Dรฉfense",
stat_sp_attack: "Att. Sp",
stat_sp_defense: "Dรฉf. Sp",
stat_speed: "Vitesse",
help: " โ/โ Naviguer ยท Entrรฉe Choisir ยท / Recherche ยท ? Aide ยท Q Quitter ",
search_hint: "nom ยท dex:25 ยท type:water ยท gen:1",
sort_dex: "Dex",
sort_name: "AโZ",
team_title: " รquipe ",
team_empty: "Espace dans la liste pour ajouter un Pokemon",
team_shared_weak: "Faiblesses communes",
team_unresisted: "Rรฉsistรฉ par personne",
team_offense_gaps: "Frappรฉ fort par personne",
team_all_clear: "rien โ tout est couvert",
abilities_label: "Talents",
abilities_title: " Talents ",
ability_hidden: "cachรฉ",
ability_close_hint: "Esc / A pour fermer",
moves_title: " Capacitรฉs ",
moves_empty: "Aucune capacitรฉ rรฉpertoriรฉe",
moves_close_hint: "โ โ parcourir ยท M / รchap ferme",
forms_label: "Formes",
forms_title: " Formes ",
forms_close_hint: "โ โ Choisir ยท Entrรฉe Ouvrir ยท Esc / V Fermer",
col_learn: "Niv",
col_move: "Capacitรฉ",
col_type: "Type",
col_category: "Cat.",
col_power: "Puis",
col_accuracy: "Prรฉc",
col_pp: "PP",
learn_machine: "CT",
learn_egg: "ลuf",
learn_tutor: "Tuteur",
class_physical: "Phys",
class_special: "Spรฉ",
class_status: "Statut",
immune_by_ability: "Immunisรฉ par talent",
immunity_maybe: "possible",
team_close_hint: "โ โ Choisir ยท C รpingler / comparer ยท Esc / P Fermer",
loading_filter: "Chargement du filtre",
expand_hint: "Appuie sur E pour les รฉvolutions",
evo_nav_hint: "โ/โ Choisir ยท Entrรฉe Aller ยท F Plein รฉcran ยท Esc Retour",
evo_card_hint: "โ/โ Choisir ยท Entrรฉe Aller ยท F / Esc Fermer",
sprite_loading: "chargementโฆ",
language_title: " Langue ",
matchups_title: " Efficacitรฉ des Types ",
matchups_defense: "Dรฉgรขts subis",
matchups_offense: "Super efficace contre",
matchups_none: "rien",
close_hint: "Esc / T pour fermer",
compare_title: " Face ร Face ",
compare_best_hit: "Meilleure attaque de mรชme type",
compare_tie: "รฉgalitรฉ",
compare_hint: "Esc / C pour fermer",
help_card: HelpStrings {
title: " Aide ",
ctx_list: "Liste",
ctx_search: "Recherche",
ctx_evolution: "Panneau d'รฉvolution",
ctx_party: "Carte d'รฉquipe",
ctx_forms: "Carte des formes",
ctx_cards: "Toute carte",
act_move: "Dรฉplacer la sรฉlection",
act_jump10: "Sauter dix",
act_load: "Charger",
act_search: "Rechercher",
act_evolutions: "รvolutions",
act_types: "Affinitรฉs de type",
act_abilities: "Talents",
act_moves: "Capacitรฉs",
act_forms: "Autres formes",
act_shiny: "Illustration chromatique",
act_random: "Au hasard dans la liste",
act_party_toggle: "Ajouter / retirer de l'รฉquipe",
act_party_card: "รquipe",
act_sort: "Tri",
act_language: "Langue",
act_help: "Cette aide",
act_quit: "Quitter",
act_load_back: "Charger et revenir",
act_back: "Retour ร la liste",
act_by_type: "Filtrer par type",
act_by_ability: "Filtrer par talent",
act_by_egg: "Filtrer par groupe d'ลufs",
act_by_generation: "Filtrer par gรฉnรฉration",
act_chain_move: "Entre les stades",
act_chain_jump: "Aller au stade",
act_form_jump: "Ouvrir la forme",
act_chain_expand: "Chaรฎne en plein รฉcran",
act_compare: "รpingler / comparer deux espรจces",
act_close: "Fermer",
close_hint: "? / Esc pour fermer",
},
evo: EvoStrings {
level: "Niv. {}",
level_up: "Montรฉe de niveau",
trade: "รchange",
trade_with: "รchange contre {}",
use_item: "Utiliser {}",
held_item: "Tient {}",
knows_move: "Connaรฎt {}",
knows_move_type: "Connaรฎt une capacitรฉ {}",
happiness: "Bonheur {}",
affection: "Affection {}",
beauty: "Beautรฉ {}",
day: "Le jour",
night: "La nuit",
dusk: "Au crรฉpuscule",
location: "ร {}",
male: "Mรขle",
female: "Femelle",
rain: "Sous la pluie",
upside_down: "Console retournรฉe",
party_species: "Avec {} dans l'รฉquipe",
party_type: "Avec un type {} dans l'รฉquipe",
shed: "Place libre dans l'รฉquipe",
},
legendary_label: "Lรฉgendaire",
mythical_label: "Fabuleux",
baby_label: "Bรฉbรฉ",
shiny_label: "Chromatique",
}
}
fn spanish() -> Self {
Strings {
app_title: " Pokeductor โ Pokedex y Analizador de Evoluciรณn ",
sidebar_title: " Pokemon ",
search_title: " Buscar ",
details_title: " Detalles ",
evolution_title: " Cadena Evolutiva ",
loading: "Cargando",
loading_list: "Cargando Pokedex",
no_selection: "Elige un Pokemon y pulsa Enter",
no_results: "No se encontraron Pokemon",
no_evolution: "Sin datos de evoluciรณn",
types_label: "Tipos",
height_label: "Altura",
weight_label: "Peso",
total_label: "Total",
egg_groups_label: "Grupos huevo",
genderless: "Sin gรฉnero",
catch_rate_label: "Ratio de captura",
catch_hard: "difรญcil",
catch_average: "media",
catch_easy: "fรกcil",
growth_label: "Crecimiento",
happiness_label: "Amistad",
habitat_label: "Hรกbitat",
error_prefix: "Error",
stat_hp: "PS",
stat_attack: "Ataque",
stat_defense: "Defensa",
stat_sp_attack: "At. Esp",
stat_sp_defense: "Def. Esp",
stat_speed: "Velocid.",
help: " โ/โ Navegar ยท Enter Elegir ยท / Buscar ยท ? Ayuda ยท Q Salir ",
search_hint: "nombre ยท dex:25 ยท type:water ยท gen:1",
sort_dex: "Dex",
sort_name: "AโZ",
team_title: " Equipo ",
team_empty: "Espacio en la lista para aรฑadir un Pokemon",
team_shared_weak: "Debilidades compartidas",
team_unresisted: "Nadie lo resiste",
team_offense_gaps: "Nadie lo golpea fuerte",
team_all_clear: "nada โ todo cubierto",
abilities_label: "Habilidades",
abilities_title: " Habilidades ",
ability_hidden: "oculta",
ability_close_hint: "Esc / A para cerrar",
moves_title: " Movimientos ",
moves_empty: "Sin movimientos registrados",
moves_close_hint: "โ โ para navegar ยท M / Esc cierra",
forms_label: "Formas",
forms_title: " Formas ",
forms_close_hint: "โ โ Elegir ยท Enter Abrir ยท Esc / V Cerrar",
col_learn: "Niv",
col_move: "Movimiento",
col_type: "Tipo",
col_category: "Cat.",
col_power: "Pot",
col_accuracy: "Prec",
col_pp: "PP",
learn_machine: "MT",
learn_egg: "Huevo",
learn_tutor: "Tutor",
class_physical: "Fรญs",
class_special: "Esp",
class_status: "Estado",
immune_by_ability: "Inmune por habilidad",
immunity_maybe: "posible",
team_close_hint: "โ โ Elegir ยท C Fijar / comparar ยท Esc / P Cerrar",
loading_filter: "Cargando la lista del filtro",
expand_hint: "Pulsa E para ver las evoluciones",
evo_nav_hint: "โ/โ Elegir ยท Enter Ir ยท F Pantalla completa ยท Esc Volver",
evo_card_hint: "โ/โ Elegir ยท Enter Ir ยท F / Esc Cerrar",
sprite_loading: "cargandoโฆ",
language_title: " Idioma ",
matchups_title: " Eficacia de Tipos ",
matchups_defense: "Daรฑo recibido",
matchups_offense: "Muy eficaz contra",
matchups_none: "nada",
close_hint: "Esc / T para cerrar",
compare_title: " Cara a Cara ",
compare_best_hit: "Mejor golpe del mismo tipo",
compare_tie: "empate",
compare_hint: "Esc / C para cerrar",
help_card: HelpStrings {
title: " Ayuda ",
ctx_list: "Lista",
ctx_search: "Bรบsqueda",
ctx_evolution: "Panel de evoluciรณn",
ctx_party: "Tarjeta de equipo",
ctx_forms: "Tarjeta de formas",
ctx_cards: "Cualquier ficha",
act_move: "Mover selecciรณn",
act_jump10: "Saltar diez",
act_load: "Cargar",
act_search: "Buscar",
act_evolutions: "Evoluciones",
act_types: "Efectividad de tipos",
act_abilities: "Habilidades",
act_moves: "Movimientos",
act_forms: "Otras formas",
act_shiny: "Ilustraciรณn variocolor",
act_random: "Al azar de la lista",
act_party_toggle: "Aรฑadir / quitar del equipo",
act_party_card: "Equipo",
act_sort: "Orden",
act_language: "Idioma",
act_help: "Esta ayuda",
act_quit: "Salir",
act_load_back: "Cargar y volver",
act_back: "Volver a la lista",
act_by_type: "Filtrar por tipo",
act_by_ability: "Filtrar por habilidad",
act_by_egg: "Filtrar por grupo huevo",
act_by_generation: "Filtrar por generaciรณn",
act_chain_move: "Entre etapas",
act_chain_jump: "Ir a la etapa",
act_form_jump: "Abrir forma",
act_chain_expand: "Cadena a pantalla completa",
act_compare: "Fijar / comparar dos especies",
act_close: "Cerrar",
close_hint: "? / Esc para cerrar",
},
evo: EvoStrings {
level: "Niv. {}",
level_up: "Subir de nivel",
trade: "Intercambio",
trade_with: "Intercambiar por {}",
use_item: "Usar {}",
held_item: "Llevando {}",
knows_move: "Conoce {}",
knows_move_type: "Conoce un movimiento {}",
happiness: "Felicidad {}",
affection: "Afecto {}",
beauty: "Belleza {}",
day: "De dรญa",
night: "De noche",
dusk: "Al anochecer",
location: "En {}",
male: "Macho",
female: "Hembra",
rain: "Bajo la lluvia",
upside_down: "Consola boca abajo",
party_species: "Con {} en el equipo",
party_type: "Con un tipo {} en el equipo",
shed: "Hueco libre en el equipo",
},
legendary_label: "Legendario",
mythical_label: "Singular",
baby_label: "Bebรฉ",
shiny_label: "Variocolor",
}
}
fn italian() -> Self {
Strings {
app_title: " Pokeductor โ Pokedex e Analizzatore di Evoluzione ",
sidebar_title: " Pokemon ",
search_title: " Cerca ",
details_title: " Dettagli ",
evolution_title: " Catena Evolutiva ",
loading: "Caricamento",
loading_list: "Caricamento Pokedex",
no_selection: "Scegli un Pokemon e premi Invio",
no_results: "Nessun Pokemon trovato",
no_evolution: "Nessun dato di evoluzione",
types_label: "Tipi",
height_label: "Altezza",
weight_label: "Peso",
total_label: "Totale",
egg_groups_label: "Gruppi uova",
genderless: "Senza sesso",
catch_rate_label: "Tasso di cattura",
catch_hard: "difficile",
catch_average: "medio",
catch_easy: "facile",
growth_label: "Crescita",
happiness_label: "Felicitร ",
habitat_label: "Habitat",
error_prefix: "Errore",
stat_hp: "PS",
stat_attack: "Attacco",
stat_defense: "Difesa",
stat_sp_attack: "Att. Sp",
stat_sp_defense: "Dif. Sp",
stat_speed: "Velocitร ",
help: " โ/โ Naviga ยท Invio Scegli ยท / Cerca ยท ? Aiuto ยท Q Esci ",
search_hint: "nome ยท dex:25 ยท type:water ยท gen:1",
sort_dex: "Dex",
sort_name: "AโZ",
team_title: " Squadra ",
team_empty: "Spazio nella lista per aggiungere un Pokemon",
team_shared_weak: "Debolezze condivise",
team_unresisted: "Nessuno lo resiste",
team_offense_gaps: "Nessuno lo colpisce forte",
team_all_clear: "niente โ tutto coperto",
abilities_label: "Abilitร ",
abilities_title: " Abilitร ",
ability_hidden: "nascosta",
ability_close_hint: "Esc / A per chiudere",
moves_title: " Mosse ",
moves_empty: "Nessuna mossa registrata",
moves_close_hint: "โ โ per scorrere ยท M / Esc chiude",
forms_label: "Forme",
forms_title: " Forme ",
forms_close_hint: "โ โ Scegli ยท Invio Apri ยท Esc / V Chiudi",
col_learn: "Liv",
col_move: "Mossa",
col_type: "Tipo",
col_category: "Cat.",
col_power: "Pot",
col_accuracy: "Prec",
col_pp: "PP",
learn_machine: "MT",
learn_egg: "Uovo",
learn_tutor: "Tutor",
class_physical: "Fis",
class_special: "Spec",
class_status: "Stato",
immune_by_ability: "Immune per abilitร ",
immunity_maybe: "possibile",
team_close_hint: "โ โ Scegli ยท C Fissa / confronta ยท Esc / P Chiudi",
loading_filter: "Caricamento del filtro",
expand_hint: "Premi E per le evoluzioni",
evo_nav_hint: "โ/โ Scegli ยท Invio Vai ยท F Schermo intero ยท Esc Indietro",
evo_card_hint: "โ/โ Scegli ยท Invio Vai ยท F / Esc Chiudi",
sprite_loading: "caricamentoโฆ",
language_title: " Lingua ",
matchups_title: " Efficacia dei Tipi ",
matchups_defense: "Danni subiti",
matchups_offense: "Superefficace contro",
matchups_none: "niente",
close_hint: "Esc / T per chiudere",
compare_title: " Testa a Testa ",
compare_best_hit: "Miglior colpo dello stesso tipo",
compare_tie: "pari",
compare_hint: "Esc / C per chiudere",
help_card: HelpStrings {
title: " Aiuto ",
ctx_list: "Lista",
ctx_search: "Ricerca",
ctx_evolution: "Pannello evoluzioni",
ctx_party: "Scheda squadra",
ctx_forms: "Scheda forme",
ctx_cards: "Ogni scheda",
act_move: "Sposta selezione",
act_jump10: "Salta dieci",
act_load: "Carica",
act_search: "Cerca",
act_evolutions: "Evoluzioni",
act_types: "Efficacia dei tipi",
act_abilities: "Abilitร ",
act_moves: "Mosse",
act_forms: "Altre forme",
act_shiny: "Illustrazione cromatica",
act_random: "A caso dalla lista",
act_party_toggle: "Aggiungi / togli dalla squadra",
act_party_card: "Squadra",
act_sort: "Ordinamento",
act_language: "Lingua",
act_help: "Questo aiuto",
act_quit: "Esci",
act_load_back: "Carica e torna",
act_back: "Torna alla lista",
act_by_type: "Filtra per tipo",
act_by_ability: "Filtra per abilitร ",
act_by_egg: "Filtra per gruppo uova",
act_by_generation: "Filtra per generazione",
act_chain_move: "Tra gli stadi",
act_chain_jump: "Vai allo stadio",
act_form_jump: "Apri forma",
act_chain_expand: "Catena a schermo intero",
act_compare: "Fissa / confronta due specie",
act_close: "Chiudi",
close_hint: "? / Esc per chiudere",
},
evo: EvoStrings {
level: "Liv. {}",
level_up: "Aumento di livello",
trade: "Scambio",
trade_with: "Scambio con {}",
use_item: "Usa {}",
held_item: "Tenendo {}",
knows_move: "Conosce {}",
knows_move_type: "Conosce una mossa {}",
happiness: "Felicitร {}",
affection: "Affetto {}",
beauty: "Bellezza {}",
day: "Di giorno",
night: "Di notte",
dusk: "Al tramonto",
location: "A {}",
male: "Maschio",
female: "Femmina",
rain: "Sotto la pioggia",
upside_down: "Console capovolta",
party_species: "Con {} in squadra",
party_type: "Con un tipo {} in squadra",
shed: "Posto libero in squadra",
},
legendary_label: "Leggendario",
mythical_label: "Misterioso",
baby_label: "Cucciolo",
shiny_label: "Cromatico",
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn every_language_reads_back_out_of_its_code() {
for language in Language::ALL {
assert_eq!(Language::from_code(language.flavor_code()), Some(language));
}
}
#[test]
fn an_unknown_language_code_is_not_guessed_at() {
assert_eq!(Language::from_code("xx"), None);
assert_eq!(Language::from_code(""), None);
}
fn umbreon() -> EvolutionCondition {
EvolutionCondition {
trigger: Some(EvolutionTrigger::LevelUp),
min_happiness: Some(160),
time_of_day: Some("night".into()),
..Default::default()
}
}
#[test]
fn every_language_fills_its_placeholders() {
let kitchen_sink = EvolutionCondition {
trigger: Some(EvolutionTrigger::Trade),
min_level: Some(16),
item: Some("water-stone".into()),
held_item: Some("kings-rock".into()),
known_move: Some("ancient-power".into()),
known_move_type: Some("fairy".into()),
min_happiness: Some(160),
min_affection: Some(2),
min_beauty: Some(170),
location: Some("mount-coronet".into()),
trade_species: Some("shelmet".into()),
party_species: Some("remoraid".into()),
party_type: Some("rock".into()),
..Default::default()
};
for language in Language::ALL {
for part in language.strings().evo.parts(&kitchen_sink) {
assert!(
!part.contains("{}"),
"{:?} left a placeholder unfilled: {part}",
language
);
}
}
}
#[test]
fn parts_are_ordered_headline_first() {
let english = Language::English.strings().evo;
assert_eq!(english.short(&umbreon()).as_deref(), Some("Happiness 160"));
assert_eq!(english.summary(&umbreon()), "Happiness 160 ยท At night");
}
#[test]
fn a_bare_trigger_still_reads_as_something() {
let condition = EvolutionCondition {
trigger: Some(EvolutionTrigger::Other("three-critical-hits".into())),
..Default::default()
};
let english = Language::English.strings().evo;
assert_eq!(english.summary(&condition), "Three Critical Hits");
}
#[test]
fn an_unknown_condition_yields_no_text() {
let english = Language::English.strings().evo;
assert!(english.short(&EvolutionCondition::default()).is_none());
}
#[test]
fn item_names_are_humanised() {
let english = Language::English.strings().evo;
let condition = EvolutionCondition {
trigger: Some(EvolutionTrigger::UseItem),
item: Some("water-stone".into()),
..Default::default()
};
assert_eq!(english.summary(&condition), "Use Water Stone");
}
}