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 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.

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 6, 2015

Member

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

This comment has been minimized.

Copy link
@felixfontein

felixfontein Sep 6, 2015

Author Contributor

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

@@ -564,7 +565,8 @@ def __init__(self, **config):
'social_buttons_code',
'search_form',
'body_end',
'extra_head_data',)
'extra_head_data',
'date_format',)

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 6, 2015

Member

You might also want to do this with JS_DATE_FORMAT.

This comment has been minimized.

Copy link
@felixfontein

felixfontein Sep 6, 2015

Author Contributor

Good idea.

'extra_head_data',)
'extra_head_data',
'date_format',
'js_date_format',)

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Sep 6, 2015

Member

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.

This comment has been minimized.

Copy link
@felixfontein

felixfontein Sep 6, 2015

Author Contributor

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 pull request Sep 6, 2015
Making DATE_FORMAT translatable.
@Kwpolska Kwpolska merged commit 621f2ee into master Sep 6, 2015
3 checks passed
3 checks passed
continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@Kwpolska Kwpolska deleted the localize-date-format branch Sep 6, 2015
@felixfontein

This comment has been minimized.

Copy link
Contributor Author

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.