Ubuntu – Setting LANG for SublimeText from Unity


I am trying to run SublimeText with the package control addon and each time I open it using the Unity launcher I receive this error.

enter image description here

So far I have tried following the instructions provided by Ubuntu Community Help, setting it in all of the mentioned places and then restarting has not fixed the problem.

I've also followed the steps found on the package control github page to no avail.

This does work when I am launching SublimeText from the command line so I am guessing it is a Unity specific problem, does anyone know how to set LANG correctly when launching SublimeText from Unity?

Edit: Adding installation details,
I installed using the 64-bit SublimeText3 .deb found here, http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3059_amd64.deb

Package Control was installed using the simple method found here, https://sublime.wbond.net/installation

Best Answer

  • I installed sublimetext using the ppa method and Package control with the "simple method" described here, it works out of the box with Ubuntu 13.10 (Unity).

    To reproduce your problem I tried to force LANG-C to start sublimetext by modifying the .desktop file. I think you could try the same tweak to start it by this time forcing LANG=en_US.UTF-8:

    sudo gedit /usr/share/applications/sublime-text.desktop

    And copy the following lines into the file:

    [Desktop Entry]
    Name=Sublime Text
    GenericName=Text Editor
    Comment=Sophisticated text editor for code, markup and prose
    Exec=bash -c "LANG=en_US.UTF-8 /opt/sublime_text/sublime_text %F"
    [Desktop Action Window]
    Name=New Window
    Exec=bash -c "LANG=en_US.UTF-8 /opt/sublime_text/sublime_text -n"
    [Desktop Action Document]
    Name=New File
    Exec=bash -c "LANG=en_US.UTF-8 /opt/sublime_text/sublime_text --command new_file"