Closed wiedikerli closed 7 years ago
@ninjaonsafari adding the file to the lang
folder should be sufficient. If you can make a pull request, I'd be happy to merge that into the project ;)
@abjerner is this file only used in the backend?
@ninjaonsafari Yup
Closing the issue here as #27 now has been merged.
@abjerner could it be possible that the label gets filled with the values from the language files on basis of the current culture?
@ninjaonsafari The GetUpcomingDays
method will return an array of OpeningHoursDay
, which has a WeekDayName
property with the localized name of the day (according to the current culture and C#'s own localization). There is also a WeekDayNameFirstCharToUpper
property where the first character is automatically converted to uppercase because not all languages start their day names with an uppercase character - eg. Tuesday
is tirsdag
in Danish.
<table>
@foreach (OpeningHoursDay day in openingHours.GetUpcomingDays(15)) {
<tr>
<td>@day.WeekDayName</td>
<td>@day.WeekDayNameFirstCharToUpper</td>
<td>@day.Label</td>
</tr>
}
</table>
If you're instead just using openingHours.Weekdays.Values
, which returns a collection of OpeningHoursWeekdayItem
, there isn't a similar property for the localized name as the items are not coupled with a specific date. I will see if I can do something else to expose the local day name here as well ;)
With the release I've just pushed, OpeningHoursWeekdayItem
now has the WeekDayName
and WeekDayNameFirstCharToUpper
properties as well ;)
I've added
de-CH.xml
tolang
. Do I have to configure something elsewhere?