summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorsfranklin2013-02-11 15:22:01 (EST)
committer Malgorzata Janczarska2013-02-12 11:34:30 (EST)
commit1ac96e03af0310421606f8caa5063f7444d93257 (patch)
tree4673f3a9ebe35cae2aefbfca70edb4d552ca14e1
parent3838b8768a40ce5b4156b1eb7ab268011cd34116 (diff)
downloadorg.eclipse.orion.client-1ac96e03af0310421606f8caa5063f7444d93257.zip
org.eclipse.orion.client-1ac96e03af0310421606f8caa5063f7444d93257.tar.gz
org.eclipse.orion.client-1ac96e03af0310421606f8caa5063f7444d93257.tar.bz2
Bug 400227 - Unexternalized strings on Navigator page
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js4
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js5
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/navigate/table.js55
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/nls/root/messages.js7
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/plugins/pageLinksPlugin.html10
5 files changed, 56 insertions, 25 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js b/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js
index f0bb537..562dd55 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js
@@ -379,5 +379,7 @@ define({
"To review the commit you can also:" : "To review the commit you can also:",
"Contribution Review Request for ${0} on ${1}" : "Contribution Review Request for ${0} on ${1}",
"Failing paths: ${0}": "Failing paths: ${0}",
- "Problem while performing the action": "Problem while performing the action"
+ "Problem while performing the action": "Problem while performing the action",
+ "Clone Git Repository": "Clone Git Repository",
+ "Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.": "Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator."
});
diff --git a/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js b/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js
index e9af7d2..1df5a91 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js
@@ -51,8 +51,9 @@ define(["orion/plugin", "orion/xhr", "orion/URL-shim", "domReady!"], function(Pl
provider.registerService("orion.core.content", null, {
id: "orion.content.gitClone",
- name: "Clone Git Repository",
- description: "Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.",
+ nls: "git/nls/gitmessages",
+ nameKey: "Clone Git Repository",
+ descriptionKey: "Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.",
uriTemplate: "{OrionHome}/git/git-repository.html#,cloneGitRepository=URL"
});
diff --git a/bundles/org.eclipse.orion.client.ui/web/navigate/table.js b/bundles/org.eclipse.orion.client.ui/web/navigate/table.js
index fec8e32..1474f53 100644
--- a/bundles/org.eclipse.orion.client.ui/web/navigate/table.js
+++ b/bundles/org.eclipse.orion.client.ui/web/navigate/table.js
@@ -12,10 +12,10 @@
/*global define document window eclipse orion serviceRegistry:true widgets alert URL*/
/*browser:true*/
-define(['require', 'i18n!orion/navigate/nls/messages', 'orion/bootstrap', 'orion/webui/littlelib', 'orion/selection', 'orion/status', 'orion/progress', 'orion/dialogs',
+define(['require', 'i18n!orion/navigate/nls/messages', 'orion/bootstrap', 'orion/Deferred', 'orion/i18nUtil', 'orion/webui/littlelib', 'orion/selection', 'orion/status', 'orion/progress', 'orion/dialogs',
'orion/ssh/sshTools', 'orion/commands', 'orion/favorites', 'orion/tasks', 'orion/navoutliner', 'orion/searchClient', 'orion/fileClient', 'orion/operationsClient', 'orion/globalCommands',
'orion/fileCommands', 'orion/explorers/explorer-table', 'orion/explorers/navigatorRenderer', 'orion/fileUtils', 'orion/PageUtil', 'orion/URITemplate', 'orion/contentTypes', 'orion/URL-shim'],
- function(require, messages, mBootstrap, lib, mSelection, mStatus, mProgress, mDialogs, mSsh, mCommands, mFavorites, mTasks, mNavOutliner,
+ function(require, messages, mBootstrap, Deferred, i18nUtil, lib, mSelection, mStatus, mProgress, mDialogs, mSsh, mCommands, mFavorites, mTasks, mNavOutliner,
mSearchClient, mFileClient, mOperationsClient, mGlobalCommands, mFileCommands, mExplorerTable, mNavigatorRenderer, mFileUtils, PageUtil, URITemplate, mContentTypes) {
mBootstrap.startup().then(function(core) {
@@ -71,9 +71,10 @@ define(['require', 'i18n!orion/navigate/nls/messages', 'orion/bootstrap', 'orion
if (isAtRoot && !gettingStartedNode) {
// create a command that represents each "orion.core.content" extension point
var newContentContributions = serviceRegistry.getServiceReferences("orion.core.content"); //$NON-NLS-0$
- var tasks = [];
- for (var i=0; i<newContentContributions.length; i++) {
- var contribution = newContentContributions[i];
+ var deferreds = [];
+ newContentContributions.forEach(function(contribution) {
+ var d = new Deferred();
+ deferreds.push(d);
var href, hrefContent, uriTemplate = null;
var id = contribution.getProperty("id"); //$NON-NLS-0$
var template = contribution.getProperty("uriTemplate"); //$NON-NLS-0$
@@ -86,18 +87,38 @@ define(['require', 'i18n!orion/navigate/nls/messages', 'orion/bootstrap', 'orion
uriTemplate = new URITemplate(template);
hrefContent = window.decodeURIComponent(uriTemplate.expand({OrionHome: orionHome}));
}
- var wrappingCommand = mFileCommands.createNewContentCommand(id, contribution.getProperty("name"), href, hrefContent, explorer, fileClient, progress); //$NON-NLS-0$
- wrappingCommand.contentDescription = contribution.getProperty("description"); //$NON-NLS-0$
- commandService.addCommand(wrappingCommand);
- tasks.push({commandId: id});
- }
- // Add the getting started task list. Keep it collapsed unless there is no workspace content.
- // We want project creation commands to always be valid from the task list (even if the explorer root is not the workspace.)
- // So the item we pass into the task list for validating commands is a fake object that pretends to be the workspace.
- new mTasks.TaskList({parent: "gettingStarted", id: "gettingStartedTasks", title: messages["Create new content"], //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
- description: messages["Click one of the tasks below to create an Orion folder. You can upload, import, or generate files."],
- tasks: tasks, serviceRegistry: serviceRegistry, commandService: commandService, item: {Location: "/workspace"}, handler: explorer, collapsed: false, //$NON-NLS-0$
- descriptionProperty: "contentDescription"}); //$NON-NLS-0$
+ if(contribution.getProperty("nls")) {//$NON-NLS-0$
+ i18nUtil.getMessageBundle(contribution.getProperty("nls")).then(function(commandMessages){ //$NON-NLS-0$
+ var name = contribution.getProperty("nameKey") ? commandMessages[contribution.getProperty("nameKey")] : contribution.getProperty("name"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ var description = contribution.getProperty("descriptionKey") ? commandMessages[contribution.getProperty("descriptionKey")] : contribution.getProperty("description"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ var wrappingCommand = mFileCommands.createNewContentCommand(id, name, href, hrefContent, explorer, fileClient, progress); //$NON-NLS-0$
+ wrappingCommand.contentDescription = description; //$NON-NLS-0$
+ commandService.addCommand(wrappingCommand);
+ d.resolve(wrappingCommand);
+ });
+ } else {
+ var wrappingCommand = mFileCommands.createNewContentCommand(id, contribution.getProperty("name"), href, hrefContent, explorer, fileClient, progress); //$NON-NLS-0$
+ wrappingCommand.contentDescription = contribution.getProperty("description"); //$NON-NLS-0$
+ commandService.addCommand(wrappingCommand);
+ d.resolve(wrappingCommand);
+ }
+ });
+ Deferred.all(deferreds, function(error) { return {error: error}; }).then(function(commandsOrErrors) {
+ var tasks = [];
+ commandsOrErrors.forEach(function(commandOrError) {
+ if (commandOrError.error) {
+ } else {
+ tasks.push({commandId: commandOrError.id});
+ }
+ });
+ // Add the getting started task list. Keep it collapsed unless there is no workspace content.
+ // We want project creation commands to always be valid from the task list (even if the explorer root is not the workspace.)
+ // So the item we pass into the task list for validating commands is a fake object that pretends to be the workspace.
+ new mTasks.TaskList({parent: "gettingStarted", id: "gettingStartedTasks", title: messages["Create new content"], //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ description: messages["Click one of the tasks below to create an Orion folder. You can upload, import, or generate files."],
+ tasks: tasks, serviceRegistry: serviceRegistry, commandService: commandService, item: {Location: "/workspace"}, handler: explorer, collapsed: false, //$NON-NLS-0$
+ descriptionProperty: "contentDescription"}); //$NON-NLS-0$
+ });
} else if (gettingStartedNode) {
lib.empty(gettingStartedNode.parentNode);
}
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/nls/root/messages.js b/bundles/org.eclipse.orion.client.ui/web/orion/nls/root/messages.js
index 1a20424..689e7af 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/nls/root/messages.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/nls/root/messages.js
@@ -90,5 +90,10 @@ define({
"Toggle side panel" : "Toggle side panel",
"Open or close the side panel": "Open or close the side panel",
"Projects" : "Projects",
- "Toggle Outliner" : "Toggle Outliner"
+ "Toggle Outliner" : "Toggle Outliner",
+ "Sample HTML5 Site": "Sample HTML5 Site",
+ "Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.": "Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.",
+ "Sample Orion Plugin": "Sample Orion Plugin",
+ "Generate a sample plugin for integrating with Orion.": "Generate a sample plugin for integrating with Orion."
+
});
diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/pageLinksPlugin.html b/bundles/org.eclipse.orion.client.ui/web/plugins/pageLinksPlugin.html
index e4ba11f..87acd7f 100644
--- a/bundles/org.eclipse.orion.client.ui/web/plugins/pageLinksPlugin.html
+++ b/bundles/org.eclipse.orion.client.ui/web/plugins/pageLinksPlugin.html
@@ -105,15 +105,17 @@
provider.registerService("orion.core.content", null, {
id: "orion.content.html5",
- name: "Sample HTML5 Site",
- description: 'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
+ nameKey: "Sample HTML5 Site",
+ nls: "orion/nls/messages",
+ descriptionKey: "Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.",
contentURITemplate: htmlHelloWorld.href
});
provider.registerService("orion.core.content", null, {
id: "orion.content.plugin",
- name: "Sample Orion Plugin",
- description: "Generate a sample plugin for integrating with Orion.",
+ nameKey: "Sample Orion Plugin",
+ nls: "orion/nls/messages",
+ descriptionKey: "Generate a sample plugin for integrating with Orion.",
contentURITemplate: pluginHelloWorld.href
});