New Locale

View: New views
3 Messages — Rating Filter:   Alert me  

New Locale

by omid p :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
How add new locale to apache roller ?
unfortunately roller does not have iran locale ,
i want to translate ApplicationResource to farsi and need to add
ApplicationResource_fa.properties
but without fa_IR locale i can not load this resource

Re: New Locale

by Anil Gangolli :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Roller relies on the JVM support and the list comes from the method
Locale.getAvailableLocales()
These pages list the locales supported in Sun Java 1.5 and 1.6

http://java.sun.com/j2se/1.5.0/docs/guide/intl/locale.doc.html

http://java.sun.com/javase/6/docs/technotes/guides/intl/locale.doc.html

I do not know how to extend these.

For message bundle support, one might be able to get away with hacking
the code to just construct the desired Locale object with a fixed or
configured String value, but we also rely on it for some date
formatting, which I believe requires a supported Locale.

--a.



omid p wrote:
> Hi,
> How add new locale to apache roller ?
> unfortunately roller does not have iran locale ,
> i want to translate ApplicationResource to farsi and need to add
> ApplicationResource_fa.properties
> but without fa_IR locale i can not load this resource
>
>  



Re: New Locale

by omid p :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks ,
I found How to solve it Edit UIUtils.java as below
List<Locale> withIranLocale = new ArrayList<Locale>();
        withIranLocale.addAll(Arrays.asList(Locale.getAvailableLocales()));
        withIranLocale.add(new Locale("fa", "IR"));
        locales = withIranLocale;

there is a static variable that populate Locale combobox

On Tue, Oct 6, 2009 at 7:23 PM, Anil Gangolli <anil@...> wrote:

>
> Roller relies on the JVM support and the list comes from the method
> Locale.getAvailableLocales()
> These pages list the locales supported in Sun Java 1.5 and 1.6
>
> http://java.sun.com/j2se/1.5.0/docs/guide/intl/locale.doc.html
>
> http://java.sun.com/javase/6/docs/technotes/guides/intl/locale.doc.html
>
> I do not know how to extend these.
>
> For message bundle support, one might be able to get away with hacking the
> code to just construct the desired Locale object with a fixed or configured
> String value, but we also rely on it for some date formatting, which I
> believe requires a supported Locale.
>
> --a.
>
>
>
>
> omid p wrote:
>
>> Hi,
>> How add new locale to apache roller ?
>> unfortunately roller does not have iran locale ,
>> i want to translate ApplicationResource to farsi and need to add
>> ApplicationResource_fa.properties
>> but without fa_IR locale i can not load this resource
>>
>>
>>
>
>
>