Changeset 5738
- Timestamp:
- 11/20/08 18:20:51 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/turbogears/i18n/sogettext/__init__.py
r5719 r5738 56 56 return catalog 57 57 58 def create_so_catalog_tables(): 59 """create the tables if needed 60 """ 61 TG_Message.dropTable(ifExists=True) 62 TG_Domain.dropTable(ifExists=True) 63 64 TG_Domain.createTable(ifNotExists=True) 65 TG_Message.createTable(ifNotExists=True) 66 58 67 def create_so_catalog(locales, domain): 59 68 """ … … 61 70 GNU message catalog 62 71 """ 72 # first try to create the table if we need to... 73 create_so_catalog_tables() 63 74 64 TG_Message.dropTable(ifExists=True)65 TG_Domain.dropTable(ifExists=True)66 67 TG_Domain.createTable(ifNotExists=True)68 TG_Message.createTable(ifNotExists=True)69 75 localedir = turbogears.config.get("i18n.locale_dir", "locales") 70 76 … … 76 82 77 83 for locale in locales: 78 translations = translation( 79 domain=domain.name, 80 localedir=localedir, 84 translations = translation(domain=domain.name, localedir=localedir, 81 85 languages=[locale]) 82 86 catalog = translations._catalog 87 83 88 for k, v in catalog.items(): 84 85 89 TG_Message(domain=domain, locale=locale, name=k, text=v) 86 90