Introduce way to dynamically map the languages, helps reduce the typing and also should "just work" if there's any new languages added
This commit is contained in:
@@ -19,7 +19,12 @@ lang = ""
|
||||
# Maps supported langauges to their suffix in the database
|
||||
translation_mapping = {
|
||||
"en_US": "",
|
||||
"zh_CN": "_zh"
|
||||
"fr": "_fr",
|
||||
"it": "_it",
|
||||
"ja": "_ja",
|
||||
"ko": "_ko",
|
||||
"ru": "_ru",
|
||||
"zh_CN": "_zh",
|
||||
}
|
||||
|
||||
def set_lang(i18n_lang):
|
||||
|
||||
@@ -26,8 +26,7 @@ import eos.config
|
||||
|
||||
categories_table = Table("invcategories", gamedata_meta,
|
||||
Column("categoryID", Integer, primary_key=True),
|
||||
Column("name", String),
|
||||
Column("name_zh", String),
|
||||
*[Column("name{}".format(lang), String) for lang in eos.config.translation_mapping.values()],
|
||||
Column("description", String), # deprecated
|
||||
Column("published", Boolean),
|
||||
Column("iconID", Integer))
|
||||
|
||||
Reference in New Issue
Block a user