forked from practicalparticipation/iati-datastore
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i18n: Add locale key to API and start translating CSV/XLSX headers
#341 Alter JS so locale key added to URL's Ignore locale key when checking for valid filters Start using flask-babel Set up our 2 current translations, with no translated strings. Set up custom extractor to get CSV column headings. Translate headers in CSV & XLSX Update README with instructions Add compile strings stage to deploy Fix tests
- Loading branch information
Showing
19 changed files
with
1,791 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[extractors] | ||
csv_column_headings = iatilib.frontend.serialize.babel:extract_csv_column_headings | ||
|
||
[csv_column_headings: frontend/serialize/csv.py] | ||
|
||
[python: **.py] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from .csv import _activity_fields, _activity_by_country_fields, _activity_by_sector_fields, \ | ||
_transaction_fields, _transaction_by_country_fields, _transaction_by_sector_fields, \ | ||
_budget_fields, _budget_by_country_fields, _budget_by_sector_fields | ||
|
||
|
||
def extract_csv_column_headings(fileobj, keywords, comment_tags, options): | ||
out = [] | ||
list_names = [ | ||
'_activity_fields','_activity_by_country_fields','_activity_by_sector_fields', | ||
'_transaction_fields','_transaction_by_country_fields','_transaction_by_sector_fields', | ||
'_budget_fields','_budget_by_country_fields','_budget_by_sector_fields', | ||
] | ||
for list_name in list_names: | ||
for x in globals()[list_name]: | ||
if isinstance(x, tuple): | ||
out.append((1, '', x[0], ['A CSV/Excel column header; in '+list_name])) | ||
else: | ||
out.append((1, '', x, ['A CSV/Excel column header; in '+list_name])) | ||
return iter(out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.