Skip to content

Commit

Permalink
Add all languages to market groups
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Jun 26, 2020
1 parent 42706f3 commit c3389fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions db_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,13 @@ def processDogmaUnits():
def processMarketGroups():
print('processing marketgroups')
data = _readData('fsd_binary', 'marketgroups', keyIdName='marketGroupID')
_addRows(data, eos.gamedata.MarketGroup, fieldMap={
map = {
'name_en-us': 'name',
'name_zh': 'marketGroupName_zh',
'description_en-us': 'description',
'description_zh': 'marketGroupDescription_zh'
})
}
map.update({'name'+v: 'marketGroupName'+v for (k, v) in eos.config.translation_mapping.items() if k != 'en_US'})
map.update({'description' + v: 'marketGroupDescription' + v for (k, v) in eos.config.translation_mapping.items() if k != 'en_US'})
_addRows(data, eos.gamedata.MarketGroup, fieldMap=map)

def processMetaGroups():
print('processing metagroups')
Expand Down
6 changes: 2 additions & 4 deletions eos/db/gamedata/marketGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@

marketgroups_table = Table("invmarketgroups", gamedata_meta,
Column("marketGroupID", Integer, primary_key=True),
Column("marketGroupName", String),
Column("marketGroupName_zh", String),
Column("marketGroupDescription", String),
Column("marketGroupDescription_zh", String),
*[Column("marketGroupName{}".format(lang), String) for lang in eos.config.translation_mapping.values()],
*[Column("marketGroupDescription{}".format(lang), String) for lang in eos.config.translation_mapping.values()],
Column("hasTypes", Boolean),
Column("parentGroupID", Integer,
ForeignKey("invmarketgroups.marketGroupID", initially="DEFERRED", deferrable=True)),
Expand Down

0 comments on commit c3389fb

Please sign in to comment.