+
+ # For name tables, dump rows for official languages, as well as
+ # for those in `langs`.
+ # For other translation tables, only dump rows for languages in `langs`
+ # For non-translation tables, dump all rows.
+ if 'local_language_id' in columns:
+ if any(col.info.get('official') for col in table.columns):
+ def include_row(row):
+ return (languages[row.local_language_id].official or
+ languages[row.local_language_id].identifier in langs)
+ else:
+ def include_row(row):
+ return languages[row.local_language_id].identifier in langs
+ else:
+ def include_row(row):
+ return True
+