Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 93452 invoked from network); 5 Jul 2007 14:42:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jul 2007 14:42:33 -0000 Received: (qmail 96690 invoked by uid 500); 5 Jul 2007 14:42:32 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 96681 invoked by uid 500); 5 Jul 2007 14:42:32 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 96670 invoked by uid 99); 5 Jul 2007 14:42:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 07:42:32 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of larry.meadors@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 07:42:26 -0700 Received: by ug-out-1314.google.com with SMTP id h2so546769ugf for ; Thu, 05 Jul 2007 07:42:05 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ifU+U+DiUZUKNgGAMILFU9ZBOtju63tUzDNfre0KBYsXupPKsL/Ik5Q9R4VORCDDk0oibc6gOxQqEpSXkZiG8OrjcfukX2G9YTzWhU4+FTjrfpmRU2Oj8BnXzAO7s3qLFo3VZc9mhROaEACteuR5HG5Zd/UJ6sIhC1yCApk6iKg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=V3Wgqy4ZKsq4bN1r/NDS157hcWCkZE5zqt1JJ9pSRZIot7PdO8hdr6bDg11ImdLDXZ+a5YZtwqSmtCiljFHGtdHh97RHfAKIR2IEXBOfiy23ZN+9swOruaiBWiLoE4P7fWY4uHCOnea1W5Wy8CW251mGuSrzrh5oRbcYP7xXois= Received: by 10.78.195.9 with SMTP id s9mr4714737huf.1183646524990; Thu, 05 Jul 2007 07:42:04 -0700 (PDT) Received: by 10.78.143.9 with HTTP; Thu, 5 Jul 2007 07:42:04 -0700 (PDT) Message-ID: Date: Thu, 5 Jul 2007 08:42:04 -0600 From: "Larry Meadors" Reply-To: lmeadors@apache.org Sender: larry.meadors@gmail.com To: "Collin Peters" Subject: Re: I18N best practices with iBatis Cc: user-java@ibatis.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 57f870eda22eb27f X-Virus-Checked: Checked by ClamAV on apache.org Is this a web app or a desktop app? Larry On 7/4/07, Collin Peters wrote: > On 6/29/07, Larry Meadors wrote: > > So you have a field for each locale? > > Yes, a column for each locale in the i18n table > > > I'd think it would be easier to if that were a compound key instead: > > > > SELECT a.activity_id, i.name as name > > FROM activities a > > JOIN i18n i ON (a.name_i18n_id = i.i18n_id and i.i18n_locale = #locale#) > > > > But.. I guess you'd still have to pass it to each query... > > Yup, same question for iBatis > > > How about this - if you don't have a ton of locales to support, you > > could do this: > > > > SELECT a.activity_id, i.${locale} as name > > FROM activities a > > JOIN i18n i ON (a.name_i18n_id = i.i18n_id) > > > > Then pass in the locale when you create the sqlmap client - each > > locale would have it's own sql map client that you could put in a Map, > > then put on the thread (use a ThreadLocale) and get from there when > > needed. That could be a pretty clean solution if done well. > > Can you expand on this idea a bit? I'm not sure what you mean with > the Thread idea. In the end all I want is a way to abstract having to > send the locale as a variable to *every* single call in my iBatis > code. >