Index: tmp/org.txm.translate.feature/.project
===================================================================
--- tmp/org.txm.translate.feature/.project	(revision 0)
+++ tmp/org.txm.translate.feature/.project	(revision 1024)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.translate.feature</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.pde.FeatureBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.FeatureNature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.translate.feature/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.feature/build.properties
===================================================================
--- tmp/org.txm.translate.feature/build.properties	(revision 0)
+++ tmp/org.txm.translate.feature/build.properties	(revision 1024)
@@ -0,0 +1 @@
+bin.includes = feature.xml

Property changes on: tmp/org.txm.translate.feature/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.feature/feature.xml
===================================================================
--- tmp/org.txm.translate.feature/feature.xml	(revision 0)
+++ tmp/org.txm.translate.feature/feature.xml	(revision 1024)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+      id="org.txm.translate.feature"
+      label="org.txm.translate.feature"
+      version="1.0.0.qualifier"
+      provider-name="Textometrie.org">
+
+   <description url="http://www.example.com/description">
+      [Enter Feature Description here.]
+   </description>
+
+   <copyright url="http://www.example.com/copyright">
+      [Enter Copyright Description here.]
+   </copyright>
+
+   <license url="http://www.example.com/license">
+      [Enter License Description here.]
+   </license>
+
+   <requires>
+      <import plugin="org.eclipse.ui"/>
+      <import plugin="org.eclipse.core.runtime"/>
+      <import plugin="org.eclipse.core.resources"/>
+      <import plugin="org.eclipse.jface.text"/>
+      <import plugin="org.eclipse.ui.workbench.texteditor"/>
+      <import plugin="org.eclipse.ui.editors"/>
+      <import plugin="org.eclipse.ui.ide"/>
+      <import plugin="org.eclipse.ui.views"/>
+   </requires>
+
+   <plugin
+         id="com.essiembre.eclipse.rbe"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+</feature>

Property changes on: tmp/org.txm.translate.feature/feature.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/.project
===================================================================
--- tmp/org.txm.translate.rcp/.project	(revision 0)
+++ tmp/org.txm.translate.rcp/.project	(revision 1024)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.txm.translate.rcp</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Property changes on: tmp/org.txm.translate.rcp/.project
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/ExportTranslateProject.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/ExportTranslateProject.java	(revision 0)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/ExportTranslateProject.java	(revision 1024)
@@ -0,0 +1,79 @@
+package org.txm.rcp.translate;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.internal.wizards.datatransfer.ArchiveFileExportOperation;
+import org.txm.Toolbox;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.stat.utils.ConsoleProgressBar;
+
+public class ExportTranslateProject extends BaseAbstractHandler {
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IWorkspace workspace = ResourcesPlugin.getWorkspace();
+		IProject newProject = workspace.getRoot().getProject("translate");
+		if (!newProject.exists()) {
+			System.out.println("You must create the translate project before.");
+			return null;
+		}
+		
+		if (!newProject.isOpen()) {
+			System.out.println("You must open the translate project before.");
+			return null;
+		}
+		
+		String path = Toolbox.getTxmHomePath()+"/translate.zip";
+		ArrayList propertiesFiles = new ArrayList<>();
+		try {
+			findPropertiesFile(newProject.getFolder("plugins"), propertiesFiles);
+		} catch (CoreException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+			return null;
+		}
+		
+		ArchiveFileExportOperation exporter = new ArchiveFileExportOperation(null, propertiesFiles, path);
+		exporter.setUseCompression(true);
+		exporter.setIncludeLinkedResources(true);
+		ConsoleProgressBar cbp = new ConsoleProgressBar(100);
+		try {
+			System.out.println("Exporting translation to "+path);
+			exporter.run(cbp);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		cbp.done();
+		return null;
+	}
+
+	public static ArrayList findPropertiesFile(IResource r, ArrayList propertiesFiles) throws CoreException {
+		if (r instanceof IFolder) {
+			IFolder dir = (IFolder)r;
+			
+			for (IResource s : dir.members()) {
+				findPropertiesFile(s, propertiesFiles);
+			}
+		} else if (r instanceof IFile) {
+			IFile file = (IFile)r;
+			String name = file.getName();
+			if (name.endsWith(".properties") && (name.startsWith("bundle") || name.startsWith("messages"))) {
+				propertiesFiles.add(r);
+			}
+		}
+		return propertiesFiles;
+	}
+}

Property changes on: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/ExportTranslateProject.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java
===================================================================
--- tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java	(revision 0)
+++ tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java	(revision 1024)
@@ -0,0 +1,137 @@
+package org.txm.rcp.translate;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.WorkingSet;
+import org.eclipse.ui.views.framelist.FrameList;
+import org.eclipse.ui.views.framelist.GoIntoAction;
+import org.eclipse.ui.views.navigator.ResourceNavigator;
+import org.txm.Toolbox;
+import org.txm.core.preferences.TXMPreferences;
+import org.txm.rcp.handlers.BaseAbstractHandler;
+import org.txm.stat.utils.ConsoleProgressBar;
+import org.txm.utils.logger.Log;
+
+public class CreateTranslateProject extends BaseAbstractHandler {
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IWorkspace workspace = ResourcesPlugin.getWorkspace();
+
+		IProject newProject = workspace.getRoot().getProject("translate");
+		IScopeContext projectScope = new ProjectScope(newProject);
+
+		// ensure the project exists
+		if (!newProject.exists()) {
+			IProjectDescription desc = workspace.newProjectDescription(newProject.getName());
+			desc.setComment("TXT translate project");
+			try {
+				newProject.create(desc, null);
+
+				if (!newProject.isOpen()) {
+					ConsoleProgressBar cpb = new ConsoleProgressBar(2);
+					newProject.open(cpb);
+
+					cpb.done();
+
+					// set global encoding preferences
+					projectScope.getNode("org.eclipse.core.resources/encoding").put("<project>", "UTF-8");
+					projectScope.getNode("org.eclipse.core.resources").flush();
+					projectScope.getNode("org.eclipse.core.runtime").put("line.separator", "\n");
+					projectScope.getNode("org.eclipse.core.runtime").flush();
+
+					// link to TXM plugins files
+					cpb = new ConsoleProgressBar(2);
+					IFolder srcFolder = newProject.getFolder("plugins");
+					IPath path = new Path(Toolbox.getInstallDirectory()+"/plugins");
+					srcFolder.createLink(path, IResource.ALLOW_MISSING_LOCAL, cpb);
+
+					// set the encoding bundle=iso-8859-1, messages=utf-8
+					ArrayList<IResource> propertiesFiles = new ArrayList<>();
+					ExportTranslateProject.findPropertiesFile(srcFolder, propertiesFiles);
+					for (IResource e : propertiesFiles) {
+						IFile f = (IFile)e;
+						if (f.getName().startsWith("messages")) {
+							projectScope.getNode("org.eclipse.core.resources/encoding").put(f.getProjectRelativePath().toString(), "UTF-8");
+						}
+						projectScope.getNode("org.eclipse.core.resources/encoding").flush();
+					}
+
+					//TXMPreferences.put("org.eclipse.ui.workbench", "resourcetypes", "<?xml version\\=\"1.0\" encoding\\=\"UTF-8\"?>\\n<editors version\\=\"3.1\">\\n<info extension\\=\"shtml\" name\\=\"*\">\\n<editor id\\=\"org.eclipse.ui.browser.editorSupport\"/>\\n</info>\\n<info extension\\=\"htm\" name\\=\"*\">\\n<editor id\\=\"org.eclipse.ui.browser.editorSupport\"/>\\n</info>\\n<info extension\\=\"html\" name\\=\"*\">\\n<editor id\\=\"org.eclipse.ui.browser.editorSupport\"/>\\n</info>\\n<info extension\\=\"properties\" name\\=\"*\">\\n<editor id\\=\"com.essiembre.eclipse.rbe.ui.editor.ResourceBundleEditor\"/>\\n<editor id\\=\"org.eclipse.ui.DefaultTextEditor\"/>\\n<defaultEditor id\\=\"com.essiembre.eclipse.rbe.ui.editor.ResourceBundleEditor\"/>\\n<defaultEditor id\\=\"org.eclipse.ui.DefaultTextEditor\"/>\\n</info>\\n</editors>");
+					//TXMPreferences.put("org.eclipse.ui.workbench", "editors", "");
+					TXMPreferences.flush("org.eclipse.ui.workbench");
+					cpb.done();
+				}
+
+			} catch (Exception e) {
+				System.out.println("Fail to create translation project: "+e);
+				e.printStackTrace();
+			}
+		} 
+
+		// project should exists now, we can show it
+		IViewPart view = openView();
+		if (view != null) {
+			ResourceNavigator navigator = (ResourceNavigator)view;
+			try {
+				IFolder plugins = newProject.getFolder("plugins");
+
+				//focus on plugins in the plugins directory (link) 
+				navigator.getTreeViewer().setSelection(new StructuredSelection(plugins));
+				FrameList fm = navigator.getFrameList();
+				GoIntoAction a = new GoIntoAction(fm);
+				a.run();
+
+				// show only the properties files
+				ArrayList<IResource> propertiesFiles = new ArrayList<>();
+				ExportTranslateProject.findPropertiesFile(plugins, propertiesFiles);
+				IResource[] elements = propertiesFiles.toArray(new IResource[propertiesFiles.size()]);
+
+				navigator.setWorkingSet(new WorkingSet("Translate TXM", "Translate TXM", elements));
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+
+		return null;
+	}
+
+	public static final String NAVIGATOR_ID = "org.eclipse.ui.views.ResourceNavigator";
+	public static IViewPart openView() {
+		// open Element View if not opened
+		try {
+			IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+			IViewPart view = page.findView(NAVIGATOR_ID);
+			if (view == null) {
+				view = page.showView(NAVIGATOR_ID);
+			}
+
+			return view;
+		} catch (PartInitException e1) {
+			System.out.println("Part initialisation error: "+e1.getLocalizedMessage());
+			Log.printStackTrace(e1);
+		}
+		return null;
+	}
+}

Property changes on: tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/CreateTranslateProject.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/build.properties
===================================================================
--- tmp/org.txm.translate.rcp/build.properties	(revision 0)
+++ tmp/org.txm.translate.rcp/build.properties	(revision 1024)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Property changes on: tmp/org.txm.translate.rcp/build.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/plugin.xml
===================================================================
--- tmp/org.txm.translate.rcp/plugin.xml	(revision 0)
+++ tmp/org.txm.translate.rcp/plugin.xml	(revision 1024)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.menus">
+      <menuContribution
+            allPopups="false"
+            locationURI="menu:org.eclipse.ui.main.menu">
+         <menu
+               id="menu.translate"
+               label="Translate">
+            <command
+                  commandId="org.txm.rcp.translate.CreateTranslateProject"
+                  label="Start translating">
+            </command>
+            <command
+                  commandId="org.txm.rcp.translate.ExportTranslateProject"
+                  label="Export translation">
+            </command>
+         </menu>
+      </menuContribution>
+   </extension>
+   <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="org.txm.rcp.translate.CreateTranslateProject"
+            id="org.txm.rcp.translate.CreateTranslateProject"
+            name="CreateTranslateProject">
+      </command>
+      <command
+            defaultHandler="org.txm.rcp.translate.ExportTranslateProject"
+            id="org.txm.rcp.translate.ExportTranslateProject"
+            name="ExportTranslateProject">
+      </command>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.translate.rcp/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- tmp/org.txm.translate.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 0)
+++ tmp/org.txm.translate.rcp/.settings/org.eclipse.jdt.core.prefs	(revision 1024)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7

Property changes on: tmp/org.txm.translate.rcp/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/.classpath
===================================================================
--- tmp/org.txm.translate.rcp/.classpath	(revision 0)
+++ tmp/org.txm.translate.rcp/.classpath	(revision 1024)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Property changes on: tmp/org.txm.translate.rcp/.classpath
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.translate.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.translate.rcp/META-INF/MANIFEST.MF	(revision 0)
+++ tmp/org.txm.translate.rcp/META-INF/MANIFEST.MF	(revision 1024)
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.txm.translate.rcp
+Bundle-SymbolicName: org.txm.translate.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Automatic-Module-Name: org.txm.translate.rcp
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.txm.rcp;bundle-version="0.8.0"

Property changes on: tmp/org.txm.translate.rcp/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
   + text/plain

