Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java57
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_1.0.0.qualifier.jarbin0 -> 1148 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle_de.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/META-INF/MANIFEST.MF9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle_de.properties2
11 files changed, 85 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java
index 3c5e68aed..e64e63c2a 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/BundlesAction.java
@@ -85,7 +85,7 @@ public class BundlesAction extends AbstractPublisherAction {
public static final IProvidedCapability BUNDLE_CAPABILITY = MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, Version.createOSGi(1, 0, 0));
public static final IProvidedCapability SOURCE_BUNDLE_CAPABILITY = MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, Version.createOSGi(1, 0, 0));
- static final String DEFAULT_BUNDLE_LOCALIZATION = "plugin"; //$NON-NLS-1$
+ static final String DEFAULT_BUNDLE_LOCALIZATION = "OSGI-INF/l10n/bundle"; //$NON-NLS-1$
private static final String[] BUNDLE_IU_PROPERTY_MAP = {Constants.BUNDLE_NAME, IInstallableUnit.PROP_NAME, Constants.BUNDLE_DESCRIPTION, IInstallableUnit.PROP_DESCRIPTION, Constants.BUNDLE_VENDOR, IInstallableUnit.PROP_PROVIDER, Constants.BUNDLE_CONTACTADDRESS, IInstallableUnit.PROP_CONTACT, Constants.BUNDLE_DOCURL, IInstallableUnit.PROP_DOC_URL, Constants.BUNDLE_UPDATELOCATION, IInstallableUnit.PROP_BUNDLE_LOCALIZATION, Constants.BUNDLE_LOCALIZATION, IInstallableUnit.PROP_BUNDLE_LOCALIZATION};
public static final int BUNDLE_LOCALIZATION_INDEX = PublisherHelper.BUNDLE_LOCALIZED_PROPERTIES.length - 1;
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java
index db80201ee..32d1e2ec1 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java
@@ -72,7 +72,7 @@ public final class LocalizationHelper {
Locale nextLocale = getLocale(LocalizationHelper.getLocaleString(nextFile, localizationFile));
try {
- Map<String, String> properties = loadProperties(root, nextFile);
+ Map<String, String> properties = loadProperties(localizationDir, nextFile);
Map<String, String> localizedStrings = getLocalizedProperties(propertyKeys, properties);
if (localizedStrings.size() > 0) {
localizations.put(nextLocale, localizedStrings);
diff --git a/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch b/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch
index 852c329c6..1b0fa7c0b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch
+++ b/bundles/org.eclipse.equinox.p2.tests/All p2 Tests.launch
@@ -52,7 +52,7 @@
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/IBM-1.6.0-20090519-SR5"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/ibm-150"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.equinox.p2.tests.AutomatedTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consolelog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.equinox.p2.tests"/>
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
index a9c32c38e..de26b0068 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
@@ -53,6 +53,7 @@ public class LocalizationTests extends TestCase {
}
public void testBundleLocalizationDE() throws IOException {
+ //Tests with the default localization file location
File file = TestData.getFile("localizationtests/foobundle", "");
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
@@ -63,6 +64,39 @@ public class LocalizationTests extends TestCase {
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
}
+ public void testBundleLocalizationDefaultDE() throws IOException {
+ File file = TestData.getFile("localizationtests/foobundle_default", "");
+ BundlesAction action = new BundlesAction(new File[] {file});
+ action.perform(info, results, monitor);
+ TranslationSupport utils = getTranslationSupport();
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
+ assertEquals("1.0", "Foo German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
+ assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
+ }
+
+ public void testBundleLocalizationDefaultDEJar() throws IOException {
+ File file = TestData.getFile("localizationtests/foobundle_1.0.0.qualifier.jar", "");
+ BundlesAction action = new BundlesAction(new File[] {file});
+ action.perform(info, results, monitor);
+ TranslationSupport utils = getTranslationSupport();
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
+ assertEquals("1.0", "Foo German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
+ assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
+ }
+
+ public void testBundleLocalizationOSGI_INF_DE() throws IOException {
+ File file = TestData.getFile("localizationtests/foobundle_osgi-inf", "");
+ BundlesAction action = new BundlesAction(new File[] {file});
+ action.perform(info, results, monitor);
+ TranslationSupport utils = getTranslationSupport();
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
+ assertEquals("1.0", "Foo German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN.toString()));
+ assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
+ }
+
public void testBundleLocalizationDE_alternatePropFile() throws IOException {
File file = TestData.getFile("localizationtests/barbundle", "");
BundlesAction action = new BundlesAction(new File[] {file});
@@ -100,6 +134,17 @@ public class LocalizationTests extends TestCase {
assertEquals("1.1", "Foo German Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN.toString()));
}
+ public void testBundleLocalizationOSGI_INF_EN() throws IOException {
+ File file = TestData.getFile("localizationtests/foobundle_osgi-inf", "");
+ BundlesAction action = new BundlesAction(new File[] {file});
+ action.perform(info, results, monitor);
+ TranslationSupport utils = getTranslationSupport();
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
+ assertEquals("1.0", "Foo English Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
+ assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
+ }
+
public void testBundleLocalizationEN() throws IOException {
File file = TestData.getFile("localizationtests/foobundle", "");
BundlesAction action = new BundlesAction(new File[] {file});
@@ -111,6 +156,18 @@ public class LocalizationTests extends TestCase {
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
}
+ public void testBundleLocalizationENDefault() throws IOException {
+ // Tests with the default localization file location
+ File file = TestData.getFile("localizationtests/foobundle_default", "");
+ BundlesAction action = new BundlesAction(new File[] {file});
+ action.perform(info, results, monitor);
+ TranslationSupport utils = getTranslationSupport();
+ IQueryResult queryResult = results.query(QueryUtil.createIUQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
+ assertEquals("1.0", "Foo English Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH.toString()));
+ assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH.toString()));
+ }
+
public void testBundleLocalizationEN_alternatePropFile() throws IOException {
File file = TestData.getFile("localizationtests/barbundle", "");
BundlesAction action = new BundlesAction(new File[] {file});
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_1.0.0.qualifier.jar b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_1.0.0.qualifier.jar
new file mode 100644
index 000000000..f8f42facd
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_1.0.0.qualifier.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..54aa697a9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %name
+Bundle-SymbolicName: foobundle
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %provider
+Require-Bundle: org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle.properties b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 000000000..9a0f12777
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,2 @@
+name=Foo English Bundle
+provider=Foo English Provider \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle_de.properties b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle_de.properties
new file mode 100644
index 000000000..cbd6d5c5b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_default/OSGI-INF/l10n/bundle_de.properties
@@ -0,0 +1,2 @@
+name=Foo German Bundle
+provider=Foo German Provider \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..e69b74ad9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %name
+Bundle-SymbolicName: foobundle
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: %provider
+Require-Bundle: org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Localization: OSGI-INF/bundle
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle.properties b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle.properties
new file mode 100644
index 000000000..9a0f12777
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle.properties
@@ -0,0 +1,2 @@
+name=Foo English Bundle
+provider=Foo English Provider \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle_de.properties b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle_de.properties
new file mode 100644
index 000000000..cbd6d5c5b
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/localizationtests/foobundle_osgi-inf/OSGI-INF/bundle_de.properties
@@ -0,0 +1,2 @@
+name=Foo German Bundle
+provider=Foo German Provider \ No newline at end of file

Back to the top