Commit 64a9f5fc authored by Kai Willadsen's avatar Kai Willadsen

filediff, const: Extract newline translations for use elsewhere

parent 98cf9f0b
from meld.conf import _
# Chunk action mode, set by filediff and used in gutterrendererchunk
MODE_REPLACE = 0
MODE_DELETE = 1
MODE_INSERT = 2
NEWLINES = {
'\n': _("UNIX (LF)"),
'\r\n': _("DOS/Windows (CR-LF)"),
'\r': _("Mac OS (CR)"),
}
......@@ -45,7 +45,7 @@ from . import undo
from .ui import findbar
from .ui import gnomeglade
from meld.const import MODE_REPLACE, MODE_DELETE, MODE_INSERT
from meld.const import MODE_REPLACE, MODE_DELETE, MODE_INSERT, NEWLINES
from meld.settings import bind_settings, meldsettings, settings
from .util.compat import text_type
from meld.sourceview import LanguageManager
......@@ -1687,9 +1687,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
text = text.replace("\n", bufdata.newlines)
else:
buttons = {
'\n': ("UNIX (LF)", 0),
'\r\n': ("DOS/Windows (CR-LF)", 1),
'\r': ("Mac OS (CR)", 2),
'\n': (NEWLINES['\n'], 0),
'\r\n': (NEWLINES['\r\n'], 1),
'\r': (NEWLINES['\r'], 2),
}
dialog_buttons = [(_("_Cancel"), Gtk.ResponseType.CANCEL)]
dialog_buttons += [buttons[b] for b in bufdata.newlines]
......
......@@ -13,6 +13,7 @@ data/org.gnome.meld.gschema.xml
[type: gettext/glade]data/ui/preferences.ui
[type: gettext/glade]data/ui/tab-placeholder.ui
[type: gettext/glade]data/ui/vcview.ui
meld/const.py
meld/dirdiff.py
meld/filediff.py
meld/filemerge.py
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment