core icon indicating copy to clipboard operation
core copied to clipboard

Include Locale in java packaging

Open wezell opened this issue 2 years ago • 1 comments

We need to include the jdk.localedata in our java-seed that we use to run dotCMS

wezell avatar Aug 09 '22 22:08 wezell

PR: #22723

nollymar avatar Aug 10 '22 19:08 nollymar

@yolabingo Can you share the steps to test this change?

wezell avatar Aug 11 '22 14:08 wezell

$date.getLocale().getAvailableLocales() should return long list of locales, rather than just en_US_POSIX en en_US

and $date.format( "MMMM yyyy", $date.getDate(), $date.getLocale().forLanguageTag("fr-CA") ) should return month name in French aout

yolabingo avatar Aug 11 '22 14:08 yolabingo

Internal QA: Passed It is working as expected with the examples provided. Using this code snipped for example:

<b class="d-block">Locales: $date.getLocale().getAvailableLocales().size()</b>
<b class="d-block">Locale in French: $date.format( "MMMM yyyy", $date.getDate(), $date.getLocale().forLanguageTag("fr-CA") )</b>
#foreach($locale in $date.getLocale().getAvailableLocales())
       <a class="text-capitalize">${locale.country}</a>#if(${velocityCount} < $date.getLocale().getAvailableLocales().size()), #end
#end

I get this output: Screen Shot 2022-08-18 at 5 15 42 PM

nollymar avatar Aug 18 '22 22:08 nollymar

Fixed, tested on release-22.09 // Docker // FF image

bryanboza avatar Aug 22 '22 14:08 bryanboza

@erickgonzalez @jdotcms I wonder if the missing timezones are why the TimeZone startup task was not adjusting the offsets correctly?

wezell avatar Aug 22 '22 15:08 wezell

@erickgonzalez @jdotcms I wonder if the missing timezones are why the TimeZone startup task was not adjusting the offsets correctly?

@wezell I am not sure if it is the case, @erickgonzalez do you know if their instance has just such as 3 locales, or bunch of them?

jdotcms avatar Aug 22 '22 15:08 jdotcms

@swicken-dotcms this might might fix the timezone startup task. I am thinking this because that startup task does a timezone lookup and uses the timezone data to calculate the offset to update the dates with. It might be (I haven't tested) that if the timezone is not available in java that it just returns UTC, which would throw everyones dates off.

wezell avatar Aug 22 '22 17:08 wezell