FAQ
Author: ehatcher
Date: Fri Sep 11 18:08:46 2015
New Revision: 1702529

URL: http://svn.apache.org/r1702529
Log:
SOLR-8041: Fix VelocityResponseWriter's $resource.get(key,baseName,locale) to use specified locale (merged from branch_5x r1702517

Modified:
     lucene/dev/branches/lucene_solr_5_3/ (props changed)
     lucene/dev/branches/lucene_solr_5_3/solr/ (props changed)
     lucene/dev/branches/lucene_solr_5_3/solr/CHANGES.txt (contents, props changed)
     lucene/dev/branches/lucene_solr_5_3/solr/contrib/ (props changed)
     lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
     lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java

Modified: lucene/dev/branches/lucene_solr_5_3/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_3/solr/CHANGES.txt?rev=1702529&r1=1702528&r2=1702529&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_3/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_5_3/solr/CHANGES.txt Fri Sep 11 18:08:46 2015
@@ -31,6 +31,9 @@ Bug Fixes
  * SOLR-7990: Use of timeAllowed can cause incomplete filters to be cached and incorrect
    results to be returned on subsequent requests. (Erick Erickson, yonik)

+* SOLR-8041: Fix VelocityResponseWriter's $resource.get(key,baseName,locale) to use specified locale.
+ (Erik Hatcher)
+
  ================== 5.3.0 ==================

  Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java?rev=1702529&r1=1702528&r2=1702529&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java (original)
+++ lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java Fri Sep 11 18:08:46 2015
@@ -337,7 +337,10 @@ public class VelocityResponseWriter impl
      @Override
      protected ResourceBundle getBundle(String baseName, Object loc) {
        // resource bundles for this tool must be in velocity "package"
- return ResourceBundle.getBundle("velocity." + baseName, getLocale(), solrClassLoader);
+ return ResourceBundle.getBundle(
+ "velocity." + baseName,
+ (loc == null) ? this.getLocale() : this.toLocale(loc),
+ solrClassLoader);
      }

      // Why did Velocity Tools make this private? Copied from ResourceTools.java

Modified: lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java?rev=1702529&r1=1702528&r2=1702529&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java (original)
+++ lucene/dev/branches/lucene_solr_5_3/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java Fri Sep 11 18:08:46 2015
@@ -125,6 +125,11 @@ public class VelocityResponseWriterTest
          VelocityResponseWriter.LOCALE,"en_US")));
      assertEquals("Colour", h.query(req("q", "*:*", "wt", "velocity", VelocityResponseWriter.TEMPLATE, "locale",
          VelocityResponseWriter.LOCALE,"en_UK")));
+
+ // Test that $resource.get(key,baseName,locale) works with specified locale
+ assertEquals("Colour", h.query(req("q","*:*", "wt","velocityWithCustomTools",VelocityResponseWriter.TEMPLATE,"t",
+ SolrParamResourceLoader.TEMPLATE_PARAM_PREFIX+"t", "$resource.get(\"color\",\"resources\",\"en_UK\")")));
+
    }

    @Test

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupcommits @
categorieslucene
postedSep 11, '15 at 6:08p
activeSep 11, '15 at 6:08p
posts1
users1
websitelucene.apache.org

1 user in discussion

Ehatcher: 1 post

People

Translate

site design / logo © 2021 Grokbase