Raised This Month: $ Target: $400
 0% 

Solved [HELP] Translations, Can i do this?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 09-16-2016 , 16:26   [HELP] Translations, Can i do this?
Reply With Quote #1

Can i use %N formatting in translation?
Like this:
Code:
...
ReplyToCommand(client, "%t", "CMD_YourName", client);
...
Code:
"Phrases"
{
      "CMD_YourName"
      {
            "#format"      "{1:N}"
            "en"           "[SM] Your name is: {1}"
      }
}
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here

Last edited by PeEzZ; 09-17-2016 at 07:50.
PeEzZ is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-16-2016 , 18:03   Re: [HELP] Translations, Can i do this?
Reply With Quote #2

You could have just tested this (or read the documentation) in the time you've waited for an answer.
__________________
asherkin is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 09-16-2016 , 18:18   Re: [HELP] Translations, Can i do this?
Reply With Quote #3

'N' isn't listed as a valid format specifier, so no.
Kolapsicle is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-16-2016 , 19:01   Re: [HELP] Translations, Can i do this?
Reply With Quote #4

Quote:
Originally Posted by Kolapsicle View Post
'N' isn't listed as a valid format specifier, so no.
%N is a format specifier unique to SM, it gets replaced with given client's name.
__________________
WildCard65 is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 09-16-2016 , 23:19   Re: [HELP] Translations, Can i do this?
Reply With Quote #5

Quote:
Originally Posted by WildCard65 View Post
%N is a format specifier unique to SM, it gets replaced with given client's name.
OP is talking about use within translation files.
Kolapsicle is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 09-16-2016 , 23:23   Re: [HELP] Translations, Can i do this?
Reply With Quote #6

Quote:
The format string is comprised of comma delimited sections, each section enclosed in brackets. Each section has an index and a format specifier, which are separated with a colon. Format specifiers follow the general rules of formatting, however, only the following types are currently allowed:
  • d/i: Digits/Integer display
  • x: Hexadecimal display
  • f: Floating point display
  • s: String display
  • c: Character display (UTF-8 compatible)
  • t: include and translate another Phrases

Note that currently, the special "%T" format type is not allowed inside a language translation string. but you still can use %t inside the format string
https://wiki.alliedmods.net/Translat...Mod_Scripting)
https://wiki.alliedmods.net/Translat...Mod_Scripting)
https://wiki.alliedmods.net/Translat...Mod_Scripting)
https://wiki.alliedmods.net/Translat...Mod_Scripting)
https://wiki.alliedmods.net/Translat...Mod_Scripting)

As stated above, you will obtain answers must more quickly if you just look up shit yourself, or simply experiment.
__________________

Last edited by ddhoward; 09-16-2016 at 23:24.
ddhoward is offline
PeEzZ
Senior Member
Join Date: Jan 2014
Location: Hungary
Old 09-17-2016 , 04:33   Re: [HELP] Translations, Can i do this?
Reply With Quote #7

I had no time yesterday, but i tested now and this is working
__________________
I MAKING MY PLUGINS/MAPS STILL, BUT I DON'T HAVE ENOUGH TIME, PLEASE STAND BY.
Sorry for my bad english, correct me if i'm wrong.
Magyarok írjanak PM-et ha fontos!

If you want, you can donate for me here
My plugins here / My maps here
PeEzZ 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 12:55.


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