Return-Path: X-Original-To: apmail-incubator-deltaspike-users-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltaspike-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8068119F5 for ; Fri, 10 May 2013 00:05:18 +0000 (UTC) Received: (qmail 61266 invoked by uid 500); 10 May 2013 00:05:18 -0000 Delivered-To: apmail-incubator-deltaspike-users-archive@incubator.apache.org Received: (qmail 61148 invoked by uid 500); 10 May 2013 00:05:18 -0000 Mailing-List: contact deltaspike-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltaspike-users@incubator.apache.org Delivered-To: mailing list deltaspike-users@incubator.apache.org Received: (qmail 61139 invoked by uid 99); 10 May 2013 00:05:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2013 00:05:18 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_BELOW2 X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gerhard.petracek@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-we0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2013 00:05:11 +0000 Received: by mail-we0-f175.google.com with SMTP id p57so3482238wes.20 for ; Thu, 09 May 2013 17:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=BjBtCxunPSLicNuvtaCZP007j6BEWoncpH0UbJBJHrc=; b=ONuaqb02bqvj8TS7vP91eZ3ilusRSvgpv12U8TU2Zg/8CN9a+39DTWmusHc27xyszs 3TeAI0yqApNRTdB/DnouvZJLo4hRWOlnw0fxe8kbgUplC2y3sZzCh69Y8PvsD8BuR0Kf nCGBe5Y/xg1np9IKIrKoUfNnmmzUrdd3i7S84RJtSYp6epoJ9sfW7RVudxsuk2G53Hl7 DQZv+qZw93oLYliLy24CL/V2myB0ZGIc71wRCuCrTO+bHkJaxj5uJNtZmIJGTVgb55yP BXIIywYBkyurzwcd7ikqwI4SQoHrid8C6kIdzZNvNu2kE0kG+p5bZCSiPJEZOQ4fXxNa Mbqg== X-Received: by 10.180.39.233 with SMTP id s9mr274874wik.25.1368144290994; Thu, 09 May 2013 17:04:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.79.138 with HTTP; Thu, 9 May 2013 17:04:30 -0700 (PDT) In-Reply-To: <518C2273.6080604@gmail.com> References: <518C0D26.6070006@gmail.com> <518C2273.6080604@gmail.com> From: Gerhard Petracek Date: Fri, 10 May 2013 02:04:30 +0200 Message-ID: Subject: Re: I18N Module To: deltaspike-users@incubator.apache.org Content-Type: multipart/alternative; boundary=001a11c2469277610b04dc51eab3 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2469277610b04dc51eab3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable like MessageContext#messageSource(/*list*/), we would need MessageContext#supportedLocale(/*list*/) -> the MessageResolver has to do the correct handling (like it does for message-sources). that wouldn't solve your use-case (due to >multiple dynamic< fallbacks) -> you would need a custom MessageResolver. regards, gerhard 2013/5/10 Christian Beikov > If you don't localize your texts properly you will always sooner or later > end up with differently localized messages. > In my application I know for every set of texts, in what languages they > are available. I also have a prioritized set of locale preferrences that > are orderd like: > > 1. user locale > 2. company locale > 3 - (n - 1): locales sent by the browser > n. default locale > > I resolve the locale that should be used by considering these two sets an= d > returning the best match. When the locales that are supported are not kno= wn > it's just not possible to use my resolving algorithm. So probably somethi= ng > like the following would suite the LocaleResolver interfaces a bit more? > > public Locale getLocale(Collection supportedLocales); > > > Mit freundlichen Gr=FC=DFen, > ------------------------------**------------------------------** > ------------ > *Christian Beikov* > Am 10.05.2013 00:09, schrieb Gerhard Petracek: > >> i've attached a first draft to [1]. >> >> regards, >> gerhard >> >> [1] https://issues.apache.org/**jira/browse/DELTASPIKE-360 >> >> >> >> 2013/5/9 Gerhard Petracek >> >> hi christian, >>> >>> you could end up with a mixture of messages easily. >>> what you would need is a LocalResolver which checks the current locale >>> (based on a list of supported locals + a default locale). >>> >>> regards, >>> gerhard >>> >>> >>> >>> 2013/5/9 Christian Beikov >>> >>> Hello there, >>>> >>>> I was just about to configure the I18N module for my needs and hit a >>>> limitation. The LocalResolver can only return a single Locale which is >>>> somehow bad. Normally you have various preferences. Are you going to a= dd >>>> something like: >>>> >>>> public Iterable getLocales() >>>> >>>> to LocaleResolver or is the current design intended to be kind of fina= l? >>>> -- >>>> >>>> Mit freundlichen Gr=FC=DFen, >>>> ------------------------------****----------------------------**--** >>>> ------------ >>>> *Christian Beikov* >>>> >>>> >>> > --001a11c2469277610b04dc51eab3--