WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: ICS Calendar] Danish months? (15 posts)

  1. nardus
    Member
    Posted 5 years ago #

    How do I get the script to write danish months?

    Under "Formatting" I use "j. F Y" as my date-format but the month shows up in english. How do I change this?

    Kristian

    http://wordpress.org/extend/plugins/wordpress-ics-importer/

  2. yetanotherpunter
    Member
    Posted 5 years ago #

    I love this plugin, it is a real Godsend but I, too, have this problem.

    Did you find a solution?

  3. dolfelt
    Member
    Posted 5 years ago #

    I have added this support just for you. You can now set a locale, however you must now use the strftime function and have that locale installed on your server. For Danish, the locale should be something like nl_NL

    Enjoy!

  4. snoofox
    Member
    Posted 5 years ago #

    For me the localization does not work (de_DE), do you have to put something else somewhere? My wp_config carries the de_DE as well...

  5. dolfelt
    Member
    Posted 5 years ago #

    Ok, I fixed the locale settings (v1.2.1). Sorry about the error. It was only working on my machine I guess. Now it should work for everyone.

    Also, I have included a list of supported locales if you are running on a Linux web server.

    Locale for nardus would be nl_NL.UTF-8
    Locale for snoofox would be de_DE.UTF-8

    Remember, you can also put something like de_DE,de_DE.UTF-8 into the box to try multiple locales.

  6. nardus
    Member
    Posted 5 years ago #

    Hmm, I still can't get it to work. I have tried to put da_DA.UTF-8,da_DA (I'm Danish and not Dutch) but months still shows in english. Any ideas?

  7. dolfelt
    Member
    Posted 5 years ago #

    Are you changing the date function to strftime? The date function does not support Locales. Also, are you using a linux server? Because if you are, you can see the list of acceptable Locales.

    If you are using a Windows Server, try using danish or dan. You can also check out this site for Windows Server Locales: http://msdn.microsoft.com/en-us/library/39cwe7zf.aspx

    Sorry about the Danish/Dutch mixup :-). Hope you get this to work!

  8. nardus
    Member
    Posted 5 years ago #

    Thank you for the quick response.

    I'm using strftime (Format: %e. %B %Y and %H:%M).

    The site is running on a Free BSD server.

    If I'm clicking on "Show / Hide Supported Locales - Only works on Linux" the list is empty. I have tried using bouth Danish and Dan without any luck.

    No problem about the Danish/Dutch mixup. It happends from time to time :-)

  9. dolfelt
    Member
    Posted 5 years ago #

    I would say that it is possible that your server does not have locales installed. I am not sure why this is, but I would contact your System Admin and ask them if they have a Danish locale and what the string for it is.

    Hope this helps.

    Daniel
    http://www.fullimpact.net

  10. yetanotherpunter
    Member
    Posted 5 years ago #

    Thankyou so much this works well for me, except that it does not put the month in my language. It changes the days, and the details pop up box but the month remains in English. I cannot see where the code is to change it.

    Am i Just being thick?

    Ben

    URL is http://eglise-reformee-mantes.org//wordpress/?page_id=101

  11. kretzschmar
    Member
    Posted 5 years ago #

    On my instllation it works like charme BUT only for the event page. The Widget doesn't translate at all.

    Maybe you just haven't looked into this one. I would love to have german date and time in the Widget too. Please add support or this.

  12. kretzschmar
    Member
    Posted 5 years ago #

    Sorry, it only works for the list and not for the calendar.

  13. yetanotherpunter
    Member
    Posted 5 years ago #

    Ok so on the callendar the month name is gennerated by line 187 of cal-functions.php

    jQuery("#ics-calendar-header-text").html("' . $today['month'] . ' ' . $today['year'] .' ");

    I dont know jQuery at all and cannot find a 'Date,' 'Today,' 'month,' or 'year' function in any of the jQuery files bundled with the plugin.

    I believe that it is in changing this line that our solution is found but i cant seem to think how.

    Anyone got any ideas?

    Ben

  14. yetanotherpunter
    Member
    Posted 5 years ago #

    Ok so i now have a partial fix for the displaying the months at the top of the callendar in another language.

    Modify line 187 to say

    jQuery("#ics-calendar-header-text").html("' . strftime( "%B" , strtotime($today['month'])) . ' ' . $today['year'] .' ");
    								';

    This works for the the first time the page is loaded but months revert to english when you browse next or previous months.

  15. yetanotherpunter
    Member
    Posted 5 years ago #

    SOLUTION - but its not neat.

    See post above, and insert a 'setlocale' arround line 49.

    Hurrah!

Topic Closed

This topic has been closed to new replies.

About this Topic