Game Schedules
[resolved] Translating to a New Language (6 posts)

  1. Mark O'Donnell
    Plugin Author

    Posted 2 years ago #

    This is an e-mail I received from shoalsummitsoltions.com today and moved it here.


    im using your Game Schedules Plugin and tried to do a localisation in German. I used PoEdit and translated the default.po/mo files that a found in the LANG dir.

    I edited the PHP File in this:

    //      MSTW localization domain
            $mstw_domain = 'mstw-loc-domain-de_DE.mo';
    // ----------------------------------------------------------------
    // Set up localization
    add_action( 'init', 'mstw_load_localization' );
    function mstw_load_localization( ) {
            global $mstw_domain;
        load_plugin_textdomain( $mstw_domain, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
    } // end custom_theme_setup

    But i dont have success?

    Could you tell me what am i missing or maybe doin wrong?



  2. Mark O'Donnell
    Plugin Author

    Posted 2 years ago #

    Hi Christian,
    First note that I only enabled internationalization on the user side, not the admin site (edit screens, etc.).

    You almost have it, but you're working a bit too hard. You should NOT make any edits to the .php files to create a new translation. Put them back the way they were. Then:

    • Open the lang/default.po file, enter the German translations, then save it as lang/mstw-loc-domain-de_DE.po. (Two files will be saved the .po and a .mo. The .po file is editable, the .mo is not.)
    • Next edit your wp-config file, which should be in the root directory of your WordPress site. Find the line:
      define ('WPLANG', '');

      and change it to

      define ('WPLANG', 'de_DE');

    Let me know if this works for you. And if you will please send me the de_DE.po file, I will include it in the next release.


  3. Snookerlounge
    Posted 2 years ago #

    Hello Mark,

    thanks for the advice!

    I reinstalled the original files and now it works like it should.

    Regarding the German Lang File i could send it to you but i think it makes not that much sense because i use it in a very specific way, e.g. as for OPPONENT the correct translation would be „Gegner“ – but i call it „Turnier“ (Tourney), because i use it for Billards.

    One more thing:

    In the Countdown widget it would be fine to have a possibility to set a number of games that will show up instead of only 1 game a time. Is that doable and how?


  4. Snookerlounge
    Posted 2 years ago #

    One more thing:

    I change the time format from Month Day Year ---> Day Month Year (is more convinient in Europe).

    No i get an Error that says :

    Warning: date() expects parameter 2 to be long, string given in /wp-content/plugins/game-schedules/mstw-game-schedule.php on line 1282

    I dunno wether or not this has something to do with the date format change?

    Any suggestions?

  5. Snookerlounge
    Posted 2 years ago #

    I solved the Error message - seemed, that i had forgotten to enter the correct time for the event.

    Now the error is gone.

  6. Mark O'Donnell
    Plugin Author

    Posted 2 years ago #

    Great. Glad to hear that.

    Yes, you have to be very careful about the time format. The code is brittle - I need to add more robust error checking.

    In the FAQ for version 2.1 (released today) I added some information on setting the date-time group format in various places.

    So I am calling both of these topics resolved.


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic