aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-04-09 16:43:16 (EDT)
committerOleg Besedin2012-04-09 16:43:36 (EDT)
commit21fd001ce9dd1ea4da8adf6810526ba45624c172 (patch)
treed396791957ff7309e48928e845ad2ebcf61dfb30
parentbcbd4357507d02c8990d425a0363cb0d2b316676 (diff)
downloadeclipse.platform.ui-21fd001ce9dd1ea4da8adf6810526ba45624c172.zip
eclipse.platform.ui-21fd001ce9dd1ea4da8adf6810526ba45624c172.tar.gz
eclipse.platform.ui-21fd001ce9dd1ea4da8adf6810526ba45624c172.tar.bz2
-rw-r--r--bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/LocalizationHelper.java4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java11
2 files changed, 11 insertions, 4 deletions
diff --git a/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/LocalizationHelper.java b/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/LocalizationHelper.java
index 9f9d5d2..d15278c 100644
--- a/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/LocalizationHelper.java
+++ b/bundles/org.eclipse.e4.ui.model.workbench/src/org/eclipse/e4/ui/model/LocalizationHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2011, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -126,6 +126,8 @@ final public class LocalizationHelper {
*/
public static String getLocalized(String key, MApplicationElement element,
IEclipseContext context) {
+ if (key == null)
+ return null;
TranslationService translation = context.get(TranslationService.class);
if (translation == null)
return key;
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java
index 4d05430..a2831a4 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/ContextProcessingAddon.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.core.commands.contexts.ContextManager;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.e4.ui.internal.workbench.Activator;
import org.eclipse.e4.ui.internal.workbench.Policy;
+import org.eclipse.e4.ui.model.LocalizationHelper;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.commands.MBindingContext;
import org.eclipse.e4.ui.workbench.UIEvents;
@@ -57,8 +58,12 @@ public class ContextProcessingAddon {
private void defineContexts(MBindingContext parent, MBindingContext current) {
Context context = contextManager.getContext(current.getElementId());
if (!context.isDefined()) {
- context.define(current.getName(), current.getDescription(), parent == null ? null
- : parent.getElementId());
+ String localizedName = LocalizationHelper.getLocalized(current.getName(), current,
+ application.getContext());
+ String localizedDescriptor = LocalizationHelper.getLocalized(current.getDescription(),
+ current, application.getContext());
+ context.define(localizedName, localizedDescriptor,
+ parent == null ? null : parent.getElementId());
}
for (MBindingContext child : current.getChildren()) {
defineContexts(current, child);