118571 Fixed setting locale for svn command line client - "LC_ALL" variable is set to configured locale, "LANGUAGE" variable is cleared (to use english output, if localization files for configured locale are not found)

This commit is contained in:
Konstantin Kolosovsky
2014-10-22 19:29:46 +04:00
parent 1d6ec58c64
commit 5cad53fa66
@@ -75,8 +75,7 @@ public class CommandExecutor {
public CommandExecutor(@NotNull @NonNls String exePath, @NotNull Command command) {
myCommand = command;
myResultBuilder = command.getResultBuilder();
if (myResultBuilder != null)
{
if (myResultBuilder != null) {
myListeners.addListener(myResultBuilder);
// cancel tracker should be executed after result builder
myListeners.addListener(new CommandCancelTracker());
@@ -160,12 +159,13 @@ public class CommandExecutor {
private void setupLocale() {
String locale = Registry.stringValue("svn.executable.locale");
Map<String, String> environment = myCommandLine.getEnvironment();
// TODO: check if we need to set LC_ALL to configured locale or just clear it
environment.put("LC_ALL", "");
environment.put("LC_MESSAGES", locale);
environment.put("LANG", locale);
if (!StringUtil.isEmpty(locale)) {
Map<String, String> environment = myCommandLine.getEnvironment();
environment.put("LANGUAGE", "");
environment.put("LC_ALL", locale);
}
}
private void ensureMessageFile() throws SvnBindException {
@@ -413,7 +413,7 @@ public class CommandExecutor {
* @throws IllegalStateException if process has not been started
*/
protected void checkStarted() {
if (! isStarted()) {
if (!isStarted()) {
throw new IllegalStateException("The process is not started yet");
}
}