SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 26/03/2013, 12:54 AM   #31
Bombo
Huge Clucker
 
Bombo's Avatar
 
Join Date: Jun 2012
Posts: 304
Reputation: 73
Default Re: imessage - fast multilanguage strings

Quote:
Originally Posted by legodude View Post
this is very interesting, it doesnt support formatting does it?
It assumes the formatting within the framework of format() function:

istrings.txt:
Code:
[MULTISTRING]
en {Hello, %s!};
es {Hola, %s!};
gamemode.pwn:
PHP Code:
new str[256];
new 
mes[256];
...
imessage(mes"MULTISTRING""en");
format(strsizeof(str), mes"John");
... 
But there are some types of string which can not be formatted in such a way. I still don't know the reason why, so it was said nothing about formatting possibility.


Quote:
Originally Posted by Y_Less View Post
That doesn't answer the question of why it was done that way in the first place instead of researching existing solutions.
You are wrong, researching existing solutions had been done at first. The result is:
y_languages' format of text strings was designed for compatibility with y_ini. But it is hard to use for translators and redactors. For example, translation from French to Polish - it's a real mockery of translator because of different code pages. You can not have two strings (original and translation) in a single file.

P.S. I've added benchmarks +test code.
__________________
[Tool/Web/Other] SA:MP multiloader
[Plugin] Automatic chat translator
[GameMode] DayZ+ [0.3z]
[Plugin] imessage - fast multilanguage strings
[Tool/Web/Other] player search service
Bombo is offline   Reply With Quote
Old 26/03/2013, 01:07 AM   #32
Gamer_Z
High-roller
 
Join Date: Jun 2009
Posts: 1,861
Reputation: 1370
Default Re: imessage - fast multilanguage strings

Quote:
Originally Posted by Bombo View Post
For example, translation from French to Polish - it's a real mockery of translator because of different code pages. You can not have two strings (original and translation) in a single file.
if you use the correct UTF encoding you can just display all the characters you want in one file.


as for the benchmarks...
https://code.******.com/p/gpb/wiki/D...guageSpeedTest

in this example it creates a file in the format, of which each entry is identified by a hex number, so, to access the 1000th element, you would provide #0003E8 (or 10000th - #002710) in the get functions and voila .

Also little typo: "dinamic -> dynamic".
Gamer_Z is offline   Reply With Quote
Old 27/03/2013, 06:13 PM   #33
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,515
Reputation: 2927
Default Re: imessage - fast multilanguage strings

Quote:
Originally Posted by Bombo View Post
You can not have two strings (original and translation) in a single file.
That's pretty much the point. Say two people translate your code to Latvian and Polish separately and each give you a modified version of the original file with their new language. Now you have to go through and manually copy all the changes from one to the other. Then repeat the process for every new language. Keeping the translations separate is how most software does things as it allows for far more modularability.
Y_Less is offline   Reply With Quote
Old 01/10/2014, 11:04 AM   #34
xDarkuzSx
Banned
 
Join Date: Mar 2013
Posts: 434
Reputation: 18
Default Respuesta: imessage - fast multilanguage strings

this plugin don't supports strings?
xDarkuzSx is offline   Reply With Quote
Old 01/03/2015, 05:25 PM   #35
wahyumahadir
Little Clucker
 
Join Date: Dec 2012
Location: Indonesia
Posts: 49
Reputation: 1
Default Re: imessage - fast multilanguage strings

why in my server this script not working ?
wahyumahadir is offline   Reply With Quote
Old 02/03/2015, 01:15 PM   #36
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Home
Posts: 3,119
Reputation: 650
Default Re: imessage - fast multilanguage strings

How can we know why ?
__________________
Find me on GitHubSEF community (Official NEF Successor) • Ko ko nut.
Kaperstone is offline   Reply With Quote
Old 14/06/2015, 12:22 AM   #37
nevahudo
Little Clucker
 
Join Date: Jun 2015
Posts: 6
Reputation: 0
Default Re: imessage - fast multilanguage strings

what a mess i managed get it work btw by filterscripts thanks, but it shows up only the filterscript file.
everything that is in my script, i need to redeclare, why?

what is variable for current id player language? cause i need to redelcare a PlayerLang etc

it dosent show up a text

Code:
GetIString error: something wrong with language (NULL, etc.)
the code:
Code:
#include <imessage>
new PlayerLang[MAX_PLAYERS][4]; //player language

  new imes[254];
  imessage(imes, "WELCOME_MESSAGE", PlayerLang[playerid]);
  SCM(playerid, 0xC0C0C0FF, imes);

Last edited by nevahudo; 14/06/2015 at 08:14 PM.
nevahudo is offline   Reply With Quote
Old 16/06/2015, 12:03 PM   #38
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 871
Reputation: 47
Default Re: imessage - fast multilanguage strings

Serbian is not spelled like this, it Srpski!
__________________
Quote:
Originally Posted by ThaiLuan View Post
Code:
C:\Users\Administrator\Downloads\Viet-RP\gamemodes\3mien.pwn(112016) : fatal error 101: cannot write to file: "disk full"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Help me! How to fix error
CoaPsyFactor is offline   Reply With Quote
Old 26/12/2016, 01:28 AM   #39
iSanchez
Huge Clucker
 
Join Date: Nov 2014
Posts: 259
Reputation: 4
Default Re: imessage - fast multilanguage strings

Quote:
Originally Posted by Bombo View Post
It assumes the formatting within the framework of format() function:

istrings.txt:
Code:
[MULTISTRING]
en {Hello, %s!};
es {Hola, %s!};
gamemode.pwn:
PHP Code:
new str[256];
new 
mes[256];
...
imessage(mes"MULTISTRING""en");
format(strsizeof(str), mes"John");
... 
But there are some types of string which can not be formatted in such a way. I still don't know the reason why, so it was said nothing about formatting possibility.




You are wrong, researching existing solutions had been done at first. The result is:
y_languages' format of text strings was designed for compatibility with y_ini. But it is hard to use for translators and redactors. For example, translation from French to Polish - it's a real mockery of translator because of different code pages. You can not have two strings (original and translation) in a single file.

P.S. I've added benchmarks +test code.
which types of strings cannot be formatted?
iSanchez is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] imessage - очень быстрый доступ к строчкам Bombo Релизы/Releases 15 27/03/2013 08:59 AM
MultiLanguage Textdraw ko2 Scripting Help 1 09/11/2012 03:24 PM
Multilanguage System NicoBellic Scripting Help 1 18/02/2012 11:45 AM
Multilanguage help YoUnG_MoNeY Help Archive 7 03/07/2011 12:30 AM
Multilanguage option YoUnG_MoNeY Help Archive 7 02/07/2011 12:10 AM


All times are GMT. The time now is 08:13 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.