Skip to content

Commit

Permalink
Merge pull request #428 from sngyo/rename-transfunction
Browse files Browse the repository at this point in the history
Rename translation function alias
  • Loading branch information
kevin-bates authored Mar 1, 2021
2 parents bf00ad0 + 5210fa2 commit d07853e
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 100 deletions.
14 changes: 7 additions & 7 deletions jupyter_server/extension/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from jupyter_core.application import JupyterApp, NoStart

from jupyter_server.serverapp import ServerApp
from jupyter_server.transutils import _
from jupyter_server.transutils import _i18n
from jupyter_server.utils import url_path_join
from .handler import ExtensionHandlerMixin

Expand Down Expand Up @@ -87,7 +87,7 @@ class ExtensionAppJinjaMixin(HasTraits):
"""Use Jinja templates for HTML templates on top of an ExtensionApp."""

jinja2_options = Dict(
help=_("""Options to pass to the jinja2 environment for this
help=_i18n("""Options to pass to the jinja2 environment for this
""")
).tag(config=True)

Expand Down Expand Up @@ -230,24 +230,24 @@ def _default_static_url_prefix(self):
).tag(config=True)

template_paths = List(Unicode(),
help=_("""Paths to search for serving jinja templates.
help=_i18n("""Paths to search for serving jinja templates.
Can be used to override templates from notebook.templates.""")
).tag(config=True)

settings = Dict(
help=_("""Settings that will passed to the server.""")
help=_i18n("""Settings that will passed to the server.""")
).tag(config=True)

handlers = List(
help=_("""Handlers appended to the server.""")
help=_i18n("""Handlers appended to the server.""")
).tag(config=True)

def _config_file_name_default(self):
"""The default config file name."""
if not self.name:
return ''
return 'jupyter_{}_config'.format(self.name.replace('-','_'))
return 'jupyter_{}_config'.format(self.name.replace('-', '_'))

def initialize_settings(self):
"""Override this method to add handling of settings."""
Expand Down Expand Up @@ -519,4 +519,4 @@ def launch_instance(cls, argv=None, **kwargs):
try:
serverapp.start()
except NoStart:
pass
pass
2 changes: 1 addition & 1 deletion jupyter_server/i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ communicate this back to Jinja2. So far, I haven't yet figured out how to do th
of languages in the UI ( never a good thing ).

2. We will need to decide if console messages should be translatable, and enable them if desired.
3. The keyboard shorcut editor was implemented after the i18n work was completed, so that portion
3. The keyboard shortcut editor was implemented after the i18n work was completed, so that portion
does not have translation support at this time.
4. Babel's documentation has instructions on how to integrate messages extraction
into your *setup.py* so that eventually we can just do:
Expand Down
Loading

0 comments on commit d07853e

Please sign in to comment.