ugh... list reformatting sucks.  here's the past link:  
http://www.rifers.org/paste/show/5129


David

David HM Spector wrote:
> I've been working on ways to parameterize  as many things as possible in
> my various RIFE apps.  Mostly to avoid  typo-based errors in my code,
> but also to be able to re-use components with minimal editing.  
>
> One area I have been working on is localization:  in my app (Let's call
> it "AppStart" - a generic app starting point like JumpStart)  there's
> one main bundle name and potentially lots of files IN that bundle
> (l10n/AppStart_en, etc) and then a default language parameter... (this
> is the same mechanism described in
> http://rifers.org/wiki/display/RIFE/Localization+through+ResourceBundles)
>
> In my "AppStart" system I am parameterizing the hell out of things so
> there are as few config level names to change as possible..   I didn't
> see any methods in Config that let me do this
>
> Typical resource bundle usage:
>
>             String label_string =
> Localization.getString("l10n/AppStart", "venue.label.OpenClosedDays." +
> feature.toString(), RifeConfig.Tools.getDefaultLanguage(), null);
>
> I was looking to change it to something more parameterizable, since in
> the app config I have this:
>
>     <list name="TEMPLATE_DEFAULT_RESOURCEBUNDLES_ENGINEHTML">      <!--
> The l10N localization resource bundles -->
>         <item>l10n/AppStart</item>
>     </list>
>     <param name="L10N_DEFAULT_LANGUAGE">en</param>                      
>    <!-- ...and what the default language should be -->
>
> It would be nice to have a convenience method that gets the default
> resource bundle name, which is essentially:
>
> public static String getDefaultRIFEResourceBundle() {
>         return (String)
> (Config.getRepInstance().getStringItems("TEMPLATE_DEFAULT_RESOURCEBUNDLES_ENGINEHTML").toArray())[0];
> }
>
> ...which would eliminate one more hard-coded string in RIFE apps:
>
>  String label_string =
> Localization.getString(getDefaultRIFEResourceBundle(),
> "venue.label.OpenClosedDays." + feature.toString(),
> RifeConfig.Tools.getDefaultLanguage(), null);
>  
>
>
> Of course, I have implemented this in my code and I got rid of several
> hundred hard-coded strings that refer to the resource bundle name that's
> declared in my app's config file...
>
> thoughts?
>
> David
>
>   

-- 
--------------------------------------------------------------------
David HM Spector                      spector at zeitgeist dot com
voice: +1 631.261.5013                     http://www.zeitgeist.com/

New and stirring things are belittled because if they are not 
belittled, the humiliating question arises:
      'Why then are you not taking part in them?'
                                    --H. G. Wells



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to