Use time translations

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
hah
Registered User
Posts: 85
Joined: Sat Feb 13, 2010 11:49 am
Location: Pernik, Bulgaria
Name: Alex Georgiev
Contact:

Use time translations

Post by hah » Wed Nov 17, 2010 8:16 pm

Hello I want to display some time with php.
The day time date("D M d, Y g:i a", $row['time']),, its in English and I want to display it in other language as in the posts.How to do that?

For example Wed Nov 17, 2010 10:11 pm => Сря Ное 17, 10:11 (bg).

User avatar
_Vinny_
Style Customisations
Style Customisations
Posts: 8355
Joined: Tue Aug 11, 2009 12:45 am
Location: Brazil
Name: Marcus Vinicius
Contact:

Re: Use time translations

Post by _Vinny_ » Thu Nov 18, 2010 11:43 pm

Well, I think that's changed in the language file in language/en/common.php:

Code: Select all

        'Sunday'    => 'Sunday',
        'Monday'    => 'Monday',
        'Tuesday'    => 'Tuesday',
        'Wednesday'    => 'Wednesday',
        'Thursday'    => 'Thursday',
        'Friday'    => 'Friday',
        'Saturday'    => 'Saturday',

        'Sun'        => 'Sun',
        'Mon'        => 'Mon',
        'Tue'        => 'Tue',
        'Wed'        => 'Wed',
        'Thu'        => 'Thu',
        'Fri'        => 'Fri',
        'Sat'        => 'Sat',

        'January'    => 'January',
        'February'    => 'February',
        'March'        => 'March',
        'April'        => 'April',
        'May'        => 'May',
        'June'        => 'June',
        'July'        => 'July',
        'August'    => 'August',
        'September' => 'September',
        'October'    => 'October',
        'November'    => 'November',
        'December'    => 'December',

        'Jan'        => 'Jan',
        'Feb'        => 'Feb',
        'Mar'        => 'Mar',
        'Apr'        => 'Apr',
        'May_short'    => 'May',    // Short representation of "May". May_short used because in English the short and long date are the same for May.
        'Jun'        => 'Jun',
        'Jul'        => 'Jul',
        'Aug'        => 'Aug',
        'Sep'        => 'Sep',
        'Oct'        => 'Oct',
        'Nov'        => 'Nov',
        'Dec'        => 'Dec', 

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Use time translations

Post by Erik Frèrejean » Thu Nov 18, 2010 11:53 pm

Use the format_date method in the $user object, it handles the translation of the date output.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

User avatar
hah
Registered User
Posts: 85
Joined: Sat Feb 13, 2010 11:49 am
Location: Pernik, Bulgaria
Name: Alex Georgiev
Contact:

Re: Use time translations

Post by hah » Sat Nov 20, 2010 3:34 pm

Yes I found the functions from viewtopic, but I forgot to post here.
Thanks. :)

Locked

Return to “[3.0.x] MOD Writers Discussion”