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

Rename translation function alias #428

Merged
merged 8 commits into from
Mar 1, 2021
12 changes: 6 additions & 6 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1714,17 +1714,17 @@ def shutdown_no_activity(self):

seconds_since_active = \
(utcnow() - self.web_app.last_activity()).total_seconds()
self.log.debug(_i18n("No activity for %d seconds.",
seconds_since_active))
self.log.debug("No activity for %d seconds.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be introducing new localized strings in this exercise. Only those statements wrapped in _() should be replaced with _i18n()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this comment is on the wrong line now and it looks like things were reverted, but I think the point is still the same - let's not introduce new strings for localization bundles in this PR. I think there are a few other cases in serverapp.py where this occurred.

Copy link
Contributor Author

@sngyo sngyo Feb 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kevin-bates,
thanks for the advice, I'll revert the last two commits later! 😄
--> DONE!

seconds_since_active)
if seconds_since_active > self.shutdown_no_activity_timeout:
self.log.info(_i18n("No kernels or terminals for %d seconds; shutting down.",
seconds_since_active))
self.log.info("No kernels or terminals for %d seconds; shutting down.",
seconds_since_active)
self.stop()

def init_shutdown_no_activity(self):
if self.shutdown_no_activity_timeout > 0:
self.log.info(_i18n("Will shut down after %d seconds with no kernels or terminals.",
self.shutdown_no_activity_timeout))
self.log.info("Will shut down after %d seconds with no kernels or terminals.",
self.shutdown_no_activity_timeout)
pc = ioloop.PeriodicCallback(self.shutdown_no_activity, 60000)
pc.start()

Expand Down