Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6E5D5200D35 for ; Tue, 7 Nov 2017 11:10:07 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6CE91160C07; Tue, 7 Nov 2017 10:10:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 93EAA160C02 for ; Tue, 7 Nov 2017 11:10:06 +0100 (CET) Received: (qmail 5579 invoked by uid 500); 7 Nov 2017 10:10:05 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 5457 invoked by uid 99); 7 Nov 2017 10:10:05 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2017 10:10:05 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 10E5F87B3D; Tue, 7 Nov 2017 10:10:05 +0000 (UTC) Date: Tue, 07 Nov 2017 10:10:08 +0000 To: "commits@sling.apache.org" Subject: [sling-org-apache-sling-scripting-sightly-compiler] 04/15: SLING-5314 - Support setting the basename for the resource bundle backing the Sightly i18n Extension MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: rombert@apache.org In-Reply-To: <151004940465.26468.8513315735818592334@gitbox.apache.org> References: <151004940465.26468.8513315735818592334@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: sling-org-apache-sling-scripting-sightly-compiler X-Git-Refname: refs/tags/org.apache.sling.scripting.sightly.compiler-1.0.0 X-Git-Reftype: annotated tag X-Git-Rev: 1154ba31ea8c00464103c80c44d1be4ac4dd9143 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171107101005.10E5F87B3D@gitbox.apache.org> archived-at: Tue, 07 Nov 2017 10:10:07 -0000 This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.compiler-1.0.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-compiler.git commit 1154ba31ea8c00464103c80c44d1be4ac4dd9143 Author: Radu Cotescu AuthorDate: Tue Jul 5 12:19:16 2016 +0000 SLING-5314 - Support setting the basename for the resource bundle backing the Sightly i18n Extension * added support for non-standard (not in the language specification) 'basename' option in expressions using 'i18n' git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/compiler@1751458 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/sling/scripting/sightly/compiler/RuntimeFunction.java | 4 ++++ .../org/apache/sling/scripting/sightly/impl/filter/I18nFilter.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/sling/scripting/sightly/compiler/RuntimeFunction.java b/src/main/java/org/apache/sling/scripting/sightly/compiler/RuntimeFunction.java index f4fa5e0..e88022c 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/compiler/RuntimeFunction.java +++ b/src/main/java/org/apache/sling/scripting/sightly/compiler/RuntimeFunction.java @@ -16,6 +16,8 @@ ******************************************************************************/ package org.apache.sling.scripting.sightly.compiler; +import java.util.Locale; + /** *

* This class documents what runtime functions (abstracted by @@ -55,6 +57,8 @@ public final class RuntimeFunction { *

  • the String to translate
  • *
  • optional: locale information
  • *
  • optional: hint information
  • + *
  • optional (not part of the specification): basename information; for more details see + * {@link java.util.ResourceBundle#getBundle(String, Locale)}
  • * *

    *

    diff --git a/src/main/java/org/apache/sling/scripting/sightly/impl/filter/I18nFilter.java b/src/main/java/org/apache/sling/scripting/sightly/impl/filter/I18nFilter.java index 62d5756..3fe12d5 100644 --- a/src/main/java/org/apache/sling/scripting/sightly/impl/filter/I18nFilter.java +++ b/src/main/java/org/apache/sling/scripting/sightly/impl/filter/I18nFilter.java @@ -32,6 +32,7 @@ public final class I18nFilter extends AbstractFilter { public static final String I18N_OPTION = "i18n"; public static final String HINT_OPTION = "hint"; public static final String LOCALE_OPTION = "locale"; + public static final String BASENAME_OPTION = "basename"; private static final class I18nFilterLoader { private static final I18nFilter INSTANCE = new I18nFilter(); @@ -55,7 +56,7 @@ public final class I18nFilter extends AbstractFilter { return expression; } ExpressionNode translation = new RuntimeCall(RuntimeFunction.I18N, expression.getRoot(), new MapLiteral - (getFilterOptions(expression, HINT_OPTION, LOCALE_OPTION))); + (getFilterOptions(expression, HINT_OPTION, LOCALE_OPTION, BASENAME_OPTION))); expression.removeOption(I18N_OPTION); return expression.withNode(translation); } -- To stop receiving notification emails like this one, please contact "commits@sling.apache.org" .