svendiedrichsen / jollyday

Jollyday - A holiday API
Other
186 stars 116 forks source link

Holiday translation ignored from holiday_descriptions_de.properties #135

Closed int5749 closed 4 years ago

int5749 commented 4 years ago

Hi all, I've added Christmas_eve as personal holiday to my holiday-de.xml and this is working perfectly and even more it's translated properly from holiday_descriptions_de.properties

But I've added few more personal holidays and like to continue with English in XML to have it common. Therefore I've added proper translation to holiday_descriptions_de.properties which is ignored. Is this already known issue and are you working on Solution?

svendiedrichsen commented 4 years ago

@int5749 It's pretty impossible to advise anything if I can't see what you have done. As you have already stated translations are generally picked up properly. Did you try to debug to see where this fails?

int5749 commented 4 years ago

@svendiedrichsen thanks for very prompt action Unfortunately I have no idea how to debug further as it's my names are simply not looked up. My entry in *.xml `

    </tns:FixedWeekdayRelativeToFixed>

Entry to holiday_descriptions_de.properties holiday.description.FOURTH_ADVENT = 4. Advent` This seems to be equal to the other entries.

So FOURTH_ADVENT is returned properly when using logInfo("Test", "Vierter {}", Ephemeris.getBankHolidayName((new DateTimeType("2021-12-2019").zonedDateTime), '<myPath>/holidays_de.xml'))

But I didn't get value from logInfo("Test", "vorher: {} und nachher: {}", Ephemeris.getBankHolidayName((new DateTimeType("2020-12-20").zonedDateTime), '<myPath>/holidays_de.xml'), Ephemeris.getHolidayDescription(Ephemeris.getBankHolidayName((new DateTimeType("2020-12-20").zonedDateTime), '<myPathY/holidays_de.xml')))

Returns

20:27:42.667 [INFO ] [g.eclipse.smarthome.model.script.Test] - vorher: FOURTH_ADVENT und nachher: undefined

Hope this helps?

svendiedrichsen commented 4 years ago

The first thiing I see is that you don't work with Jollyday on its own but you are using some software which uses Jollyday. That way I can't tell whats going on. I can only advise you to construct an example without anything else but Jollyday and see if it gets picked up. Your software may contain some other description properties file which gets picked up before the one you are using. or the other way around depending on which properties file you are modifying.

svendiedrichsen commented 4 years ago

Or you might want to ask this question at the project of the software you are using. They may be more qualified to answer why your changed properties file does not get picked up. In the end it all comes down to the order in which the classpath provides the properties files.

int5749 commented 4 years ago

@svendiedrichsen I thought this project integrates this funktion into OpenHab? Am I wrong? Than for sure I should raise this question to OpenHab Community/Git

svendiedrichsen commented 4 years ago

@int5749 This project is only responsible for the Jollyday library. Integration of Jollyday is done by project which uses it.

int5749 commented 4 years ago

@svendiedrichsen OK, than apologies to bother you and I will contact OpenHab Git ;-)

svendiedrichsen commented 4 years ago

No problem. At least I could help with some directions. ;-)

svendiedrichsen commented 4 years ago

@int5749 Following this implementation https://github.com/openhab/openhab-core/blob/master/bundles/org.openhab.core.ephemeris/src/main/java/org/openhab/core/ephemeris/internal/EphemerisManagerImpl.java it could be that OpenHAB is not using the german locale as you would expect. Maybe you could check that the german locale is really in use there.