From a227e7adcc899aac9b7c0cb4ff2d4c7428349fce Mon Sep 17 00:00:00 2001 From: Eevee Date: Mon, 28 Mar 2011 19:12:30 -0700 Subject: [PATCH] language_id -> local_language_id --- pokedex/data/csv/ability_changelog_prose.csv | 2 +- pokedex/data/csv/ability_names.csv | 2 +- pokedex/data/csv/ability_prose.csv | 2 +- pokedex/data/csv/berry_firmness_names.csv | 2 +- pokedex/data/csv/contest_effect_prose.csv | 2 +- pokedex/data/csv/contest_type_names.csv | 2 +- pokedex/data/csv/egg_group_prose.csv | 2 +- pokedex/data/csv/encounter_condition_prose.csv | 2 +- .../data/csv/encounter_condition_value_prose.csv | 2 +- pokedex/data/csv/encounter_terrain_prose.csv | 2 +- pokedex/data/csv/evolution_trigger_prose.csv | 2 +- pokedex/data/csv/generation_names.csv | 2 +- pokedex/data/csv/growth_rate_prose.csv | 2 +- pokedex/data/csv/item_category_prose.csv | 2 +- pokedex/data/csv/item_flag_prose.csv | 2 +- pokedex/data/csv/item_fling_effect_prose.csv | 2 +- pokedex/data/csv/item_names.csv | 2 +- pokedex/data/csv/item_pocket_names.csv | 2 +- pokedex/data/csv/item_prose.csv | 2 +- pokedex/data/csv/language_names.csv | 2 +- pokedex/data/csv/location_area_prose.csv | 2 +- pokedex/data/csv/location_names.csv | 2 +- pokedex/data/csv/move_battle_style_prose.csv | 2 +- pokedex/data/csv/move_damage_class_prose.csv | 2 +- pokedex/data/csv/move_effect_category_prose.csv | 2 +- pokedex/data/csv/move_effect_changelog_prose.csv | 2 +- pokedex/data/csv/move_effect_prose.csv | 2 +- pokedex/data/csv/move_flag_type_prose.csv | 2 +- pokedex/data/csv/move_meta_ailment_names.csv | 2 +- pokedex/data/csv/move_meta_category_prose.csv | 2 +- pokedex/data/csv/move_names.csv | 2 +- pokedex/data/csv/move_target_prose.csv | 2 +- pokedex/data/csv/nature_names.csv | 2 +- pokedex/data/csv/pokeathlon_stat_names.csv | 2 +- pokedex/data/csv/pokedex_prose.csv | 2 +- pokedex/data/csv/pokemon_color_names.csv | 2 +- pokedex/data/csv/pokemon_form_group_prose.csv | 2 +- pokedex/data/csv/pokemon_form_names.csv | 2 +- pokedex/data/csv/pokemon_habitat_names.csv | 2 +- pokedex/data/csv/pokemon_move_method_prose.csv | 2 +- pokedex/data/csv/pokemon_names.csv | 2 +- pokedex/data/csv/pokemon_shape_prose.csv | 2 +- pokedex/data/csv/region_names.csv | 2 +- pokedex/data/csv/stat_hint_names.csv | 2 +- pokedex/data/csv/stat_names.csv | 2 +- pokedex/data/csv/super_contest_effect_prose.csv | 2 +- pokedex/data/csv/type_names.csv | 2 +- pokedex/data/csv/version_names.csv | 2 +- pokedex/db/multilang.py | 29 ++++++++-------------- pokedex/db/tables.py | 4 +-- 50 files changed, 60 insertions(+), 69 deletions(-) diff --git a/pokedex/data/csv/ability_changelog_prose.csv b/pokedex/data/csv/ability_changelog_prose.csv index 45e8544..ee498c5 100644 --- a/pokedex/data/csv/ability_changelog_prose.csv +++ b/pokedex/data/csv/ability_changelog_prose.csv @@ -1,4 +1,4 @@ -ability_changelog_id,language_id,effect +ability_changelog_id,local_language_id,effect 1,9,Has no effect in battle. 2,9,Does not prevent regular KOs from full [HP]{mechanic}. 3,9,Has no overworld effect. diff --git a/pokedex/data/csv/ability_names.csv b/pokedex/data/csv/ability_names.csv index 7fa67a7..cc6b089 100644 --- a/pokedex/data/csv/ability_names.csv +++ b/pokedex/data/csv/ability_names.csv @@ -1,4 +1,4 @@ -ability_id,language_id,name +ability_id,local_language_id,name 1,1,あくしゅう 1,5,Puanteur 1,6,Duftnote diff --git a/pokedex/data/csv/ability_prose.csv b/pokedex/data/csv/ability_prose.csv index ed87876..6850969 100644 --- a/pokedex/data/csv/ability_prose.csv +++ b/pokedex/data/csv/ability_prose.csv @@ -1,4 +1,4 @@ -ability_id,language_id,effect,short_effect +ability_id,local_language_id,effect,short_effect 1,9,"This Pokémon's moves have approximately a 10% chance to make the target [flinch]{mechanic}. This ability does not stack with a held [King's Rock]{item}. diff --git a/pokedex/data/csv/berry_firmness_names.csv b/pokedex/data/csv/berry_firmness_names.csv index ff2ae24..c66ff7c 100644 --- a/pokedex/data/csv/berry_firmness_names.csv +++ b/pokedex/data/csv/berry_firmness_names.csv @@ -1,4 +1,4 @@ -berry_firmness_id,language_id,name +berry_firmness_id,local_language_id,name 1,9,Very Soft 2,9,Soft 3,9,Hard diff --git a/pokedex/data/csv/contest_effect_prose.csv b/pokedex/data/csv/contest_effect_prose.csv index b8061b8..2dd6114 100644 --- a/pokedex/data/csv/contest_effect_prose.csv +++ b/pokedex/data/csv/contest_effect_prose.csv @@ -1,4 +1,4 @@ -contest_effect_id,language_id,flavor_text,effect +contest_effect_id,local_language_id,flavor_text,effect 1,9,A highly appealing move.,Gives a high number of appeal points wth no other effects. 2,9,Affected by how well the appeal in front goes.,"If the Pokémon that appealed before the user earned less than three appeal points, user earns six; if three, user earns three; if more than three, user earns none." 3,9,"After this move, the user is more easily startled.","If the user is jammed this turn after using this move, it will receive twice as many jam points." diff --git a/pokedex/data/csv/contest_type_names.csv b/pokedex/data/csv/contest_type_names.csv index 8b71fd1..9bebf39 100644 --- a/pokedex/data/csv/contest_type_names.csv +++ b/pokedex/data/csv/contest_type_names.csv @@ -1,4 +1,4 @@ -contest_type_id,language_id,name,flavor,color +contest_type_id,local_language_id,name,flavor,color 1,9,Cool,Spicy,Red 2,9,Beauty,Dry,Blue 3,9,Cute,Sweet,Pink diff --git a/pokedex/data/csv/egg_group_prose.csv b/pokedex/data/csv/egg_group_prose.csv index 43342f6..ffe8375 100644 --- a/pokedex/data/csv/egg_group_prose.csv +++ b/pokedex/data/csv/egg_group_prose.csv @@ -1,4 +1,4 @@ -egg_group_id,language_id,name +egg_group_id,local_language_id,name 1,9,Monster 2,9,Water 1 3,9,Bug diff --git a/pokedex/data/csv/encounter_condition_prose.csv b/pokedex/data/csv/encounter_condition_prose.csv index 87e524a..c6ee690 100644 --- a/pokedex/data/csv/encounter_condition_prose.csv +++ b/pokedex/data/csv/encounter_condition_prose.csv @@ -1,4 +1,4 @@ -encounter_condition_id,language_id,name +encounter_condition_id,local_language_id,name 1,9,Swarm 2,9,Time of day 3,9,PokeRadar diff --git a/pokedex/data/csv/encounter_condition_value_prose.csv b/pokedex/data/csv/encounter_condition_value_prose.csv index 8096c03..146b2c5 100644 --- a/pokedex/data/csv/encounter_condition_value_prose.csv +++ b/pokedex/data/csv/encounter_condition_value_prose.csv @@ -1,4 +1,4 @@ -encounter_condition_value_id,language_id,name +encounter_condition_value_id,local_language_id,name 1,9,During a swarm 2,9,Not during a swarm 3,9,In the morning diff --git a/pokedex/data/csv/encounter_terrain_prose.csv b/pokedex/data/csv/encounter_terrain_prose.csv index e30ed27..789ae19 100644 --- a/pokedex/data/csv/encounter_terrain_prose.csv +++ b/pokedex/data/csv/encounter_terrain_prose.csv @@ -1,4 +1,4 @@ -encounter_terrain_id,language_id,name +encounter_terrain_id,local_language_id,name 1,9,Walking in tall grass or a cave 2,9,Fishing with an Old Rod 3,9,Fishing with a Good Rod diff --git a/pokedex/data/csv/evolution_trigger_prose.csv b/pokedex/data/csv/evolution_trigger_prose.csv index 33d3983..625ae13 100644 --- a/pokedex/data/csv/evolution_trigger_prose.csv +++ b/pokedex/data/csv/evolution_trigger_prose.csv @@ -1,4 +1,4 @@ -evolution_trigger_id,language_id,name +evolution_trigger_id,local_language_id,name 1,9,Level_up 2,9,Trade 3,9,Use_item diff --git a/pokedex/data/csv/generation_names.csv b/pokedex/data/csv/generation_names.csv index 81bfd2c..50d3b55 100644 --- a/pokedex/data/csv/generation_names.csv +++ b/pokedex/data/csv/generation_names.csv @@ -1,4 +1,4 @@ -generation_id,language_id,name +generation_id,local_language_id,name 1,9,Generation I 2,9,Generation II 3,9,Generation III diff --git a/pokedex/data/csv/growth_rate_prose.csv b/pokedex/data/csv/growth_rate_prose.csv index af6af90..f2f79b3 100644 --- a/pokedex/data/csv/growth_rate_prose.csv +++ b/pokedex/data/csv/growth_rate_prose.csv @@ -1,4 +1,4 @@ -growth_rate_id,language_id,name +growth_rate_id,local_language_id,name 1,9,slow 2,9,medium 3,9,fast diff --git a/pokedex/data/csv/item_category_prose.csv b/pokedex/data/csv/item_category_prose.csv index 0e8f1d2..7d09263 100644 --- a/pokedex/data/csv/item_category_prose.csv +++ b/pokedex/data/csv/item_category_prose.csv @@ -1,4 +1,4 @@ -item_category_id,language_id,name +item_category_id,local_language_id,name 1,9,Stat boosts 2,9,Effort drop 3,9,Medicine diff --git a/pokedex/data/csv/item_flag_prose.csv b/pokedex/data/csv/item_flag_prose.csv index 4d48bd2..037b563 100644 --- a/pokedex/data/csv/item_flag_prose.csv +++ b/pokedex/data/csv/item_flag_prose.csv @@ -1,4 +1,4 @@ -item_flag_id,language_id,name,description +item_flag_id,local_language_id,name,description 1,9,Countable,Has a count in the bag 2,9,Consumable,Consumed when used 3,9,Usable_overworld,Usable outside battle diff --git a/pokedex/data/csv/item_fling_effect_prose.csv b/pokedex/data/csv/item_fling_effect_prose.csv index e965e03..038d393 100644 --- a/pokedex/data/csv/item_fling_effect_prose.csv +++ b/pokedex/data/csv/item_fling_effect_prose.csv @@ -1,4 +1,4 @@ -item_fling_effect_id,language_id,effect +item_fling_effect_id,local_language_id,effect 1,9,Badly poisons the target. 2,9,Burns the target. 3,9,Immediately activates the berry's effect on the target. diff --git a/pokedex/data/csv/item_names.csv b/pokedex/data/csv/item_names.csv index 7eaa8a8..223a522 100644 --- a/pokedex/data/csv/item_names.csv +++ b/pokedex/data/csv/item_names.csv @@ -1,4 +1,4 @@ -item_id,language_id,name +item_id,local_language_id,name 1,1,マスターボール 1,5,Master Ball 1,6,Meisterball diff --git a/pokedex/data/csv/item_pocket_names.csv b/pokedex/data/csv/item_pocket_names.csv index 0be9437..ca85fd6 100644 --- a/pokedex/data/csv/item_pocket_names.csv +++ b/pokedex/data/csv/item_pocket_names.csv @@ -1,4 +1,4 @@ -item_pocket_id,language_id,name +item_pocket_id,local_language_id,name 1,9,Items 2,9,Medicine 3,9,Poké Balls diff --git a/pokedex/data/csv/item_prose.csv b/pokedex/data/csv/item_prose.csv index 7d3b85b..38ce9e7 100644 --- a/pokedex/data/csv/item_prose.csv +++ b/pokedex/data/csv/item_prose.csv @@ -1,4 +1,4 @@ -item_id,language_id,short_effect,effect +item_id,local_language_id,short_effect,effect 1,9,,In battle: Captures one Pokémon without fail. Has a capture rate of 255. 2,9,,In battle: Attempts to capture one Pokémon. Has a capture rate of 2. 3,9,,In battle: Attempts to capture one Pokémon. Has a capture rate of 1.5. diff --git a/pokedex/data/csv/language_names.csv b/pokedex/data/csv/language_names.csv index 8e1cdfa..42663ae 100644 --- a/pokedex/data/csv/language_names.csv +++ b/pokedex/data/csv/language_names.csv @@ -1,4 +1,4 @@ -lang_id,language_id,name +language_id,local_language_id,name 1,9,Japanese 2,9,Official Roomaji 3,9,Korean diff --git a/pokedex/data/csv/location_area_prose.csv b/pokedex/data/csv/location_area_prose.csv index 43ac3b3..5aec6b5 100644 --- a/pokedex/data/csv/location_area_prose.csv +++ b/pokedex/data/csv/location_area_prose.csv @@ -1,4 +1,4 @@ -location_area_id,language_id,name +location_area_id,local_language_id,name 1,9, 2,9, 3,9, diff --git a/pokedex/data/csv/location_names.csv b/pokedex/data/csv/location_names.csv index a36cfe2..ae74b6a 100644 --- a/pokedex/data/csv/location_names.csv +++ b/pokedex/data/csv/location_names.csv @@ -1,4 +1,4 @@ -location_id,language_id,name +location_id,local_language_id,name 1,9,Canalave City 2,9,Eterna City 3,9,Pastoria City diff --git a/pokedex/data/csv/move_battle_style_prose.csv b/pokedex/data/csv/move_battle_style_prose.csv index 408f76c..441b73b 100644 --- a/pokedex/data/csv/move_battle_style_prose.csv +++ b/pokedex/data/csv/move_battle_style_prose.csv @@ -1,4 +1,4 @@ -move_battle_style_id,language_id,name +move_battle_style_id,local_language_id,name 1,9,Attack 2,9,Defense 3,9,Support diff --git a/pokedex/data/csv/move_damage_class_prose.csv b/pokedex/data/csv/move_damage_class_prose.csv index a7cd3d7..2083337 100644 --- a/pokedex/data/csv/move_damage_class_prose.csv +++ b/pokedex/data/csv/move_damage_class_prose.csv @@ -1,4 +1,4 @@ -move_damage_class_id,language_id,name,description +move_damage_class_id,local_language_id,name,description 1,9,non-damaging,No damage 2,9,physical,"Physical damage, controlled by Attack and Defense" 3,9,special,"Special damage, controlled by Special Attack and Special Defense" diff --git a/pokedex/data/csv/move_effect_category_prose.csv b/pokedex/data/csv/move_effect_category_prose.csv index 9d8e1a0..edf7734 100644 --- a/pokedex/data/csv/move_effect_category_prose.csv +++ b/pokedex/data/csv/move_effect_category_prose.csv @@ -1,4 +1,4 @@ -move_effect_category_id,language_id,name +move_effect_category_id,local_language_id,name 1,9,Regular damage 2,9,Power varies 3,9,Special damage diff --git a/pokedex/data/csv/move_effect_changelog_prose.csv b/pokedex/data/csv/move_effect_changelog_prose.csv index 0305775..11df252 100644 --- a/pokedex/data/csv/move_effect_changelog_prose.csv +++ b/pokedex/data/csv/move_effect_changelog_prose.csv @@ -1,4 +1,4 @@ -move_effect_changelog_id,language_id,effect +move_effect_changelog_id,local_language_id,effect 1,9,"Halves the target's [Defense]{mechanic} for damage calculation, which is similar to doubling the attack's [power]{mechanic}." 2,9,Hits Pokémon under the effects of [Dig]{move} and [Fly]{move}. 3,9,Does nothing in trainer battles. diff --git a/pokedex/data/csv/move_effect_prose.csv b/pokedex/data/csv/move_effect_prose.csv index 41f1e5a..a88a070 100644 --- a/pokedex/data/csv/move_effect_prose.csv +++ b/pokedex/data/csv/move_effect_prose.csv @@ -1,4 +1,4 @@ -move_effect_id,language_id,short_effect,effect +move_effect_id,local_language_id,short_effect,effect 1,9,Inflicts regular damage with no additional effect.,Inflicts [regular damage]{mechanic}. 2,9,Puts the target to sleep.,Puts the target to [sleep]{mechanic}. 3,9,Has a $effect_chance% chance to poison the target.,Inflicts [regular damage]{mechanic}. Has a $effect_chance% chance to [poison]{mechanic} the target. diff --git a/pokedex/data/csv/move_flag_type_prose.csv b/pokedex/data/csv/move_flag_type_prose.csv index 3083f83..33e7fe9 100644 --- a/pokedex/data/csv/move_flag_type_prose.csv +++ b/pokedex/data/csv/move_flag_type_prose.csv @@ -1,4 +1,4 @@ -move_flag_type_id,language_id,name,description +move_flag_type_id,local_language_id,name,description 1,9,Makes contact,"User touches the target. This triggers some abilities (e.g., [Static]{ability}) and items (e.g., [Sticky Barb]{item})." 2,9,Has a charging turn,This move has a charging turn that can be skipped with a [Power Herb]{item}. 3,9,Must recharge,"The turn after this move is used, the Pokémon's action is skipped so it can recharge." diff --git a/pokedex/data/csv/move_meta_ailment_names.csv b/pokedex/data/csv/move_meta_ailment_names.csv index 0512c3e..a202a71 100644 --- a/pokedex/data/csv/move_meta_ailment_names.csv +++ b/pokedex/data/csv/move_meta_ailment_names.csv @@ -1,4 +1,4 @@ -move_meta_ailment_id,language_id,name +move_meta_ailment_id,local_language_id,name -1,9,???? 0,9,none 1,9,Paralysis diff --git a/pokedex/data/csv/move_meta_category_prose.csv b/pokedex/data/csv/move_meta_category_prose.csv index 287d5fa..8ea22f1 100644 --- a/pokedex/data/csv/move_meta_category_prose.csv +++ b/pokedex/data/csv/move_meta_category_prose.csv @@ -1,4 +1,4 @@ -move_meta_category_id,language_id,description +move_meta_category_id,local_language_id,description 0,9,Inflicts damage 1,9,No damage; inflicts status ailment 2,9,No damage; lowers target's stats or raises user's stats diff --git a/pokedex/data/csv/move_names.csv b/pokedex/data/csv/move_names.csv index 321a0ee..cacf76f 100644 --- a/pokedex/data/csv/move_names.csv +++ b/pokedex/data/csv/move_names.csv @@ -1,4 +1,4 @@ -move_id,language_id,name +move_id,local_language_id,name 1,1,はたく 1,5,Écras'Face 1,6,Pfund diff --git a/pokedex/data/csv/move_target_prose.csv b/pokedex/data/csv/move_target_prose.csv index d907c5c..b1c2aee 100644 --- a/pokedex/data/csv/move_target_prose.csv +++ b/pokedex/data/csv/move_target_prose.csv @@ -1,4 +1,4 @@ -move_target_id,language_id,name,description +move_target_id,local_language_id,name,description 1,9,Specific move,One specific move. How this move is chosen depends upon on the move being used. 2,9,Selected Pokémon,"One other Pokémon on the field, selected by the trainer. Stolen moves reuse the same target." 3,9,Ally,The user's ally (if any). diff --git a/pokedex/data/csv/nature_names.csv b/pokedex/data/csv/nature_names.csv index e5b4e03..eaab7a5 100644 --- a/pokedex/data/csv/nature_names.csv +++ b/pokedex/data/csv/nature_names.csv @@ -1,4 +1,4 @@ -nature_id,language_id,name +nature_id,local_language_id,name 1,1,がんばりや 1,5,Hardi 1,6,Robust diff --git a/pokedex/data/csv/pokeathlon_stat_names.csv b/pokedex/data/csv/pokeathlon_stat_names.csv index 1112bba..4f47d7e 100644 --- a/pokedex/data/csv/pokeathlon_stat_names.csv +++ b/pokedex/data/csv/pokeathlon_stat_names.csv @@ -1,4 +1,4 @@ -pokeathlon_stat_id,language_id,name +pokeathlon_stat_id,local_language_id,name 1,9,Speed 2,9,Power 3,9,Skill diff --git a/pokedex/data/csv/pokedex_prose.csv b/pokedex/data/csv/pokedex_prose.csv index 32e93b0..b739880 100644 --- a/pokedex/data/csv/pokedex_prose.csv +++ b/pokedex/data/csv/pokedex_prose.csv @@ -1,4 +1,4 @@ -pokedex_id,language_id,name,description +pokedex_id,local_language_id,name,description 1,9,National,Entire National dex 2,9,Kanto,Red/Blue/Yellow Kanto dex 3,9,Original Johto,"Gold/Silver/Crystal Johto dex—called the ""New"" Pokédex in-game" diff --git a/pokedex/data/csv/pokemon_color_names.csv b/pokedex/data/csv/pokemon_color_names.csv index d25c717..6e8eb80 100644 --- a/pokedex/data/csv/pokemon_color_names.csv +++ b/pokedex/data/csv/pokemon_color_names.csv @@ -1,4 +1,4 @@ -pokemon_color_id,language_id,name +pokemon_color_id,local_language_id,name 1,9,Black 2,9,Blue 3,9,Brown diff --git a/pokedex/data/csv/pokemon_form_group_prose.csv b/pokedex/data/csv/pokemon_form_group_prose.csv index 03dca2e..ec15308 100644 --- a/pokedex/data/csv/pokemon_form_group_prose.csv +++ b/pokedex/data/csv/pokemon_form_group_prose.csv @@ -1,4 +1,4 @@ -pokemon_form_group_id,language_id,term,description +pokemon_form_group_id,local_language_id,term,description 172,9,,"Spiky-eared Pichu can only be received by taking the shiny Pichu from an official promotion to [Celebi]{pokemon}'s shrine in [Ilex Forest]{location}. Spiky-eared Pichu is always female, cannot evolve, and cannot be taken into the Wi-Fi Club or the Union Room, but is otherwise a normal Pichu." 201,9,,Forms only affect appearance. A form is determined at random before a wild encounter and cannot be changed. 351,9,Form,"Form changes along with type to match the [weather]{mechanic} in battle, due to [Forecast]{ability}. Castform is always in its normal form outside of battle, regardless of weather." diff --git a/pokedex/data/csv/pokemon_form_names.csv b/pokedex/data/csv/pokemon_form_names.csv index 70d4dfe..e51e486 100644 --- a/pokedex/data/csv/pokemon_form_names.csv +++ b/pokedex/data/csv/pokemon_form_names.csv @@ -1,4 +1,4 @@ -pokemon_form_id,language_id,name +pokemon_form_id,local_language_id,name 1,9, 2,9, 3,9, diff --git a/pokedex/data/csv/pokemon_habitat_names.csv b/pokedex/data/csv/pokemon_habitat_names.csv index d78b059..d974bc6 100644 --- a/pokedex/data/csv/pokemon_habitat_names.csv +++ b/pokedex/data/csv/pokemon_habitat_names.csv @@ -1,4 +1,4 @@ -pokemon_habitat_id,language_id,name +pokemon_habitat_id,local_language_id,name 1,9,cave 2,9,forest 3,9,grassland diff --git a/pokedex/data/csv/pokemon_move_method_prose.csv b/pokedex/data/csv/pokemon_move_method_prose.csv index b39a211..8d3802c 100644 --- a/pokedex/data/csv/pokemon_move_method_prose.csv +++ b/pokedex/data/csv/pokemon_move_method_prose.csv @@ -1,4 +1,4 @@ -pokemon_move_method_id,language_id,name,description +pokemon_move_method_id,local_language_id,name,description 1,9,Level up,Learned when a Pokémon reaches a certain level. 2,9,Egg,"Appears on a newly-hatched Pokémon, if the father had the same move." 3,9,Tutor,Can be taught at any time by an NPC. diff --git a/pokedex/data/csv/pokemon_names.csv b/pokedex/data/csv/pokemon_names.csv index 87f77b1..09db3d5 100644 --- a/pokedex/data/csv/pokemon_names.csv +++ b/pokedex/data/csv/pokemon_names.csv @@ -1,4 +1,4 @@ -pokemon_id,language_id,name,species +pokemon_id,local_language_id,name,species 1,1,フシギダネ, 1,2,Fushigidane, 1,3,이상해씨, diff --git a/pokedex/data/csv/pokemon_shape_prose.csv b/pokedex/data/csv/pokemon_shape_prose.csv index 5a3cf37..38fca57 100644 --- a/pokedex/data/csv/pokemon_shape_prose.csv +++ b/pokedex/data/csv/pokemon_shape_prose.csv @@ -1,4 +1,4 @@ -pokemon_shape_id,language_id,name,awesome_name +pokemon_shape_id,local_language_id,name,awesome_name 1,9,Ball,Pomaceous 2,9,Squiggle,Caudal 3,9,Fish,Ichthyic diff --git a/pokedex/data/csv/region_names.csv b/pokedex/data/csv/region_names.csv index 5f05e2b..43a76bc 100644 --- a/pokedex/data/csv/region_names.csv +++ b/pokedex/data/csv/region_names.csv @@ -1,4 +1,4 @@ -region_id,language_id,name +region_id,local_language_id,name 1,9,Kanto 2,9,Johto 3,9,Hoenn diff --git a/pokedex/data/csv/stat_hint_names.csv b/pokedex/data/csv/stat_hint_names.csv index 36acada..44b3450 100644 --- a/pokedex/data/csv/stat_hint_names.csv +++ b/pokedex/data/csv/stat_hint_names.csv @@ -1,4 +1,4 @@ -stat_hint_id,language_id,message +stat_hint_id,local_language_id,message 1,9,Loves to eat 2,9,Proud of its power 3,9,Sturdy body diff --git a/pokedex/data/csv/stat_names.csv b/pokedex/data/csv/stat_names.csv index ceb73a2..aca8e1a 100644 --- a/pokedex/data/csv/stat_names.csv +++ b/pokedex/data/csv/stat_names.csv @@ -1,4 +1,4 @@ -stat_id,language_id,name +stat_id,local_language_id,name 1,9,HP 2,9,Attack 3,9,Defense diff --git a/pokedex/data/csv/super_contest_effect_prose.csv b/pokedex/data/csv/super_contest_effect_prose.csv index 8585c26..3715323 100644 --- a/pokedex/data/csv/super_contest_effect_prose.csv +++ b/pokedex/data/csv/super_contest_effect_prose.csv @@ -1,4 +1,4 @@ -super_contest_effect_id,language_id,flavor_text +super_contest_effect_id,local_language_id,flavor_text 1,9,Enables the user to perform first in the next turn. 2,9,Enables the user to perform last in the next turn. 4,9,Earn +2 if the Judge's Voltage goes up. diff --git a/pokedex/data/csv/type_names.csv b/pokedex/data/csv/type_names.csv index 4ad1b6e..49c3165 100644 --- a/pokedex/data/csv/type_names.csv +++ b/pokedex/data/csv/type_names.csv @@ -1,4 +1,4 @@ -type_id,language_id,name +type_id,local_language_id,name 1,1,ノーマル 1,5,Normal 1,6,Normal diff --git a/pokedex/data/csv/version_names.csv b/pokedex/data/csv/version_names.csv index 518a11c..1902bfe 100644 --- a/pokedex/data/csv/version_names.csv +++ b/pokedex/data/csv/version_names.csv @@ -1,4 +1,4 @@ -version_id,language_id,name +version_id,local_language_id,name 1,9,Red 2,9,Blue 3,9,Yellow diff --git a/pokedex/db/multilang.py b/pokedex/db/multilang.py index 96d70d6..8ac1bfc 100644 --- a/pokedex/db/multilang.py +++ b/pokedex/db/multilang.py @@ -17,7 +17,6 @@ def create_translation_table(_table_name, foreign_class, relation_name, `foreign_class` must have a `__singlename__`, currently only used to create the name of the foreign key column. -TODO remove this requirement Also supports the notion of a default language, which is attached to the session. This is English by default, for historical and practical reasons. @@ -69,21 +68,16 @@ TODO remove this requirement # want to create tables entirely separate from the pokedex metadata foreign_key_name = foreign_class.__singlename__ + '_id' - # A foreign key "language_id" will clash with the language_id we naturally - # put in every table. Rename it something else - if foreign_key_name == 'language_id': - # TODO change language_id below instead and rename this - foreign_key_name = 'lang_id' Translations = type(_table_name, (object,), { - '_language_identifier': association_proxy('language', 'identifier'), + '_language_identifier': association_proxy('local_language', 'identifier'), }) # Create the table object table = Table(_table_name, foreign_class.__table__.metadata, Column(foreign_key_name, Integer, ForeignKey(foreign_class.id), primary_key=True, nullable=False), - Column('language_id', Integer, ForeignKey(language_class.id), + Column('local_language_id', Integer, ForeignKey(language_class.id), primary_key=True, nullable=False), ) Translations.__table__ = table @@ -99,14 +93,11 @@ TODO remove this requirement # Construct ye mapper mapper(Translations, table, properties={ - # TODO change to foreign_id - 'object_id': synonym(foreign_key_name), - # TODO change this as appropriate - 'language': relationship(language_class, - primaryjoin=table.c.language_id == language_class.id, + 'foreign_id': synonym(foreign_key_name), + 'local_language': relationship(language_class, + primaryjoin=table.c.local_language_id == language_class.id, lazy='joined', innerjoin=True), - # TODO does this need to join to the original table? }) # Add full-table relations to the original class @@ -114,8 +105,8 @@ TODO remove this requirement setattr(foreign_class, relation_name + '_table', Translations) # Foo.bars setattr(foreign_class, relation_name, relationship(Translations, - primaryjoin=foreign_class.id == Translations.object_id, - collection_class=attribute_mapped_collection('language'), + primaryjoin=foreign_class.id == Translations.foreign_id, + collection_class=attribute_mapped_collection('local_language'), # TODO lazy='select', )) @@ -129,8 +120,8 @@ TODO remove this requirement language_class_a = aliased(language_class) setattr(foreign_class, local_relation_name, relationship(Translations, primaryjoin=and_( - foreign_class.id == Translations.object_id, - Translations.language_id == select( + foreign_class.id == Translations.foreign_id, + Translations.local_language_id == select( [language_class_a.id], language_class_a.identifier == bindparam('_default_language', required=True), @@ -152,7 +143,7 @@ TODO remove this requirement # these are passed as *args anyway def creator(language, value): row = Translations() - row.language = language + row.local_language = language setattr(row, name, value) return row setattr(foreign_class, name + '_map', diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index d56bf65..1c1db60 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -264,7 +264,7 @@ class EggGroup(TableBase): create_translation_table('egg_group_prose', EggGroup, 'names', name = Column(Unicode(16), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=False)), + info=dict(description="The name", format='plaintext', official=True)), ) class Encounter(TableBase): @@ -1557,7 +1557,7 @@ class SuperContestEffect(TableBase): create_translation_table('super_contest_effect_prose', SuperContestEffect, 'prose', flavor_text = Column(Unicode(64), nullable=False, - info=dict(description=u"A description of the effect.", format='plaintext')), + info=dict(description=u"A description of the effect.", format='plaintext', official=True)), ) -- 2.7.4