Raised This Month: $51 Target: $400
 12% 

Solved FormatTime


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PastyBully
Junior Member
Join Date: Dec 2016
Old 12-20-2017 , 12:30   FormatTime
Reply With Quote #1

Hello guys,
I post this message because I have a problem and I can't solved him. I use FormatTime for print a date (day month year) and I can not translate the month in a other lang that the english, and it is a problem because I am french and I want to create a french Server.

PS : Sorry for my english

Thanks you beforehand for your help

PastyBully

Last edited by PastyBully; 12-20-2017 at 14:39.
PastyBully is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 12-20-2017 , 12:57   Re: FormatTime
Reply With Quote #2

Maybe this?

*Pseudocode.
PHP Code:
char[32SomeThing;
FormatTime(SomeThing...);
ProcessMonthName(SomeThingsizeof(SomeThing));

function 
ProcessMonthName(SomeThingsize) {
    
//if(SomeThing[0] == 'J' && SomeThing[0] == 'a') { // optimization :D - IF MONTH IS FIRST IN STRING
        
ReplaceString(SomeThingsize"January""Janvier"false);
   
// } 
/* etc...
January    
February    
March    
April    
May    
June    
July    
August    
September    
October    
November    
December
*/

If you will have finished function, please post it here. Thank you.
__________________

Last edited by neatek; 12-20-2017 at 12:58.
neatek is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-20-2017 , 13:14   Re: FormatTime
Reply With Quote #3

neatek's solution might work, but I believe it's better to grab the month and then do a translation file instead of hard coding your months.
__________________
Want to check my plugins ?
Arkarr is offline
neatek
AlliedModders Donor
Join Date: Jul 2010
Location: Russia
Old 12-20-2017 , 13:19   Re: FormatTime
Reply With Quote #4

Quote:
Originally Posted by Arkarr View Post
neatek's solution might work, but I believe it's better to grab the month and then do a translation file instead of hard coding your months.
Yep, i thought about it, but i wrote a fast solution.

PHP Code:
function ProcessMonthName(MONTH_NAME_IN_ENGsize) {
    
Format(MONTH_NAME_IN_ENGsize"%T"MONTH_NAME_IN_ENGLANG_SERVER);
}

char[32month;
Format(monthsizeof(month), "January");
ProcessMonthName(month);
// and now we maybe will have - Janvier 
In translation file:
PHP Code:
"Phrases"
{
    
//Example: "Hello, Bail!"
    
"January"
    
{
        
"en"        "January"
        "fr"        "Janvier"
    
}

Maybe it will work
Play around with this...
__________________

Last edited by neatek; 12-20-2017 at 13:27.
neatek is offline
PastyBully
Junior Member
Join Date: Dec 2016
Old 12-20-2017 , 14:18   Re: FormatTime
Reply With Quote #5

Thank you for your answers,
I successfull to translate, I use a translation file who translate my month.

Again thank you for your answers

Pasty
PastyBully is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode