Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making DATE_FORMAT translatable. #2033

Merged
merged 3 commits into from Sep 6, 2015
Merged

Making DATE_FORMAT translatable. #2033

merged 3 commits into from Sep 6, 2015

Conversation

@felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Sep 6, 2015

(fixes #2032)

@felixfontein felixfontein self-assigned this Sep 6, 2015
@@ -140,7 +140,7 @@ TIMEZONE = ${TIMEZONE}
# Note that this does not affect DATE_FORMAT.
# FORCE_ISO8601 = False

# Date format used to display post dates.
# (Translatable) Date format used to display post dates.
Copy link
Member

@Kwpolska Kwpolska Sep 6, 2015

put the (translatable) tag, lower case, at the end of this line

Copy link
Contributor Author

@felixfontein felixfontein Sep 6, 2015

Changed that. There are some other places (unrelated to my edits) where it still is at the beginning of the line.

'extra_head_data',)
'extra_head_data',
'date_format',
'js_date_format',)
Copy link
Member

@Kwpolska Kwpolska Sep 6, 2015

I’m afraid the tests fail because JS_DATE_FORMAT is not that easy, you would need special casing to do json.dumps() when the translatable context is evaluated and drop the _GLOBAL_CONTEXT setting.

Copy link
Contributor Author

@felixfontein felixfontein Sep 6, 2015

I now did the json.dumps() before creating the TranslatableSetting object creations. This way, I only have to change a bit in nikola.py, but not in all places where _GLOBAL_CONTEXT is converted to a local context (that happens several times in nikola.py and in at least four plugins).

Kwpolska added a commit that referenced this issue Sep 6, 2015
@Kwpolska Kwpolska merged commit 621f2ee into master Sep 6, 2015
3 checks passed
@Kwpolska Kwpolska deleted the localize-date-format branch Sep 6, 2015
@felixfontein
Copy link
Contributor Author

@felixfontein felixfontein commented Sep 6, 2015

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants