From 24275d22c3a3f8474eb3fabf25387eb0be35c6d5 Mon Sep 17 00:00:00 2001 From: chenganj Date: Thu, 31 Oct 2019 13:26:44 -0400 Subject: [PATCH] improved the performance of pageload after language toggle set --- doc/sphinx-guides/source/installation/config.rst | 9 +++------ .../edu/harvard/iq/dataverse/util/BundleUtil.java | 12 +----------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index f114a7403b7..6b5248c902e 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -573,13 +573,10 @@ The presence of the :ref:`:Languages` database setting adds a dropdown in the he Configuring the "lang" Directory ++++++++++++++++++++++++++++++++ -Translations for Dataverse are stored in "properties" files in a directory on disk (e.g. ``/home/glassfish/langBundles``) that you specify with the :ref:`dataverse.lang.directory` ``dataverse.lang.directory`` JVM option, like this: +Translations for Dataverse are stored in "properties" files in a directory on disk (e.g. ``/glassfish/domains//lib/classes``) that you specify with the :ref:`dataverse.lang.directory` ``dataverse.lang.directory`` JVM option, like this: -``./asadmin create-jvm-options '-Ddataverse.lang.directory=/home/glassfish/langBundles'`` +``./asadmin create-jvm-options '-Ddataverse.lang.directory=/glassfish/domains//lib/classes'`` -Go ahead and create the directory you specified. - -``mkdir /home/glassfish/langBundles`` Creating a languages.zip File +++++++++++++++++++++++++++++ @@ -1045,7 +1042,7 @@ dataverse.lang.directory This JVM option is used to configure the path where all the language specific property files are to be stored. If this option is set then the English property file must be present in the path along with any other language property file. You can download language property files from https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs -``./asadmin create-jvm-options '-Ddataverse.lang.directory=PATH_LOCATION_HERE'`` +``./asadmin create-jvm-options '-Ddataverse.lang.directory=/glassfish/domains//lib/classes'`` If this value is not set, by default, a Dataverse installation will read the English language property files from the Java Application. diff --git a/src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java b/src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java index 1311a2495ae..8c775a9c8cd 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/BundleUtil.java @@ -87,17 +87,7 @@ public static ResourceBundle getResourceBundle(String propertyFileName, Locale c if (filesRootDirectory == null || filesRootDirectory.isEmpty()) { bundle = ResourceBundle.getBundle("propertyFiles/" +propertyFileName, currentLocale); } else { - File bundleFileDir = new File(filesRootDirectory); - URL[] urls = null; - try { - urls = new URL[]{bundleFileDir.toURI().toURL()}; - } catch (Exception e) { - e.printStackTrace(); - return null; - } - - ClassLoader loader = new URLClassLoader(urls); - bundle = ResourceBundle.getBundle(propertyFileName, currentLocale, loader); + bundle = ResourceBundle.getBundle(propertyFileName, currentLocale); } return bundle ;