Skip to content

Commit

Permalink
L10N: Get translations from correct module
Browse files Browse the repository at this point in the history
The _ from spyder.config.base gets translations from the spyder module,
while we need to get them from the spyder_notebook module.
  • Loading branch information
jitseniesen committed Jul 29, 2020
1 parent 7e1ef35 commit 6eb393f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spyder_notebook/notebookplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

# Spyder imports
from spyder.api.plugins import SpyderPluginWidget
from spyder.config.base import _
from spyder.config.gui import is_dark_interface
from spyder.utils import icon_manager as ima
from spyder.utils.qthelpers import (create_action, create_toolbutton,
add_actions, MENU_SEPARATOR)
from spyder.utils.switcher import shorten_paths

# Local imports
from spyder_notebook.utils.localization import _
from spyder_notebook.utils.servermanager import ServerManager
from spyder_notebook.widgets.notebooktabwidget import NotebookTabWidget
from spyder_notebook.widgets.serverinfo import ServerInfoDialog
Expand Down
9 changes: 9 additions & 0 deletions spyder_notebook/utils/localization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) Spyder Project Contributors
# Licensed under the terms of the MIT License

"""Localization utility function."""

from spyder.config.base import get_translation
_ = get_translation('spyder_notebook')
3 changes: 2 additions & 1 deletion spyder_notebook/widgets/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
import requests

# Spyder imports
from spyder.config.base import _, get_image_path, get_module_source_path
from spyder.config.base import get_image_path, get_module_source_path
from spyder.utils.qthelpers import add_actions
from spyder.utils import sourcecode
from spyder.widgets.findreplace import FindReplace

# Local imports
from spyder_notebook.utils.localization import _
from spyder_notebook.widgets.dom import DOMWidget

# -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion spyder_notebook/widgets/notebooktabwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import nbformat

# Spyder imports
from spyder.config.base import _
from spyder.utils.programs import get_temp_dir
from spyder.widgets.tabs import Tabs

# Local imports
from spyder_notebook.utils.localization import _
from spyder_notebook.widgets.client import NotebookClient


Expand Down
2 changes: 1 addition & 1 deletion spyder_notebook/widgets/serverinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
QPushButton, QTextEdit, QVBoxLayout)

# Spyder imports
from spyder.config.base import _
from spyder.plugins.variableexplorer.widgets.basedialog import BaseDialog

# Local imports
from spyder_notebook.utils.localization import _
from spyder_notebook.utils.servermanager import ServerProcess, ServerState


Expand Down

0 comments on commit 6eb393f

Please sign in to comment.