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
Conversation
@@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put the (translatable)
tag, lower case, at the end of this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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',) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
Making DATE_FORMAT translatable.
Thanks for merging! |
(fixes #2032)