Handling different languages
#1

Hello. A lot of my users have thrown around the idea of supporting multiple languages in server to help foreign (non English speakers) understand things.

I've looked around, and I am looking for the most efficient & effective way of doing this, if such a way exists.
To clarify, I am not looking for #if defined stuff, I am looking for so each player can set what language they want to view it in, so it needs to be something PAWN can handle and change in game, and not frozen at what it is compiled in.

I'd be aiming to support probably 3 to 5 languages, if that helps with choosing the most efficient method
Thanks guis.
Reply
#2

Use y_text.
Reply
#3

Preferably without using anything by ******...
Reply
#4

Well,you can make a command for setting player language,and then use like this:
pawn Код:
//put here the command for setting language
new Language[MAX_PLAYERS];
//to set language use Language[playerid] = languageid here;
and when sending messages:
if(Language[playerid] == 1)//his language is english and do the same for the other languages.
Reply
#5

Quote:
Originally Posted by R0
Посмотреть сообщение
Well,you can make a command for setting player language,and then use like this:
pawn Код:
//put here the command for setting language
new Language[MAX_PLAYERS];
//to set language use Language[playerid] = languageid here;
and when sending messages:
if(Language[playerid] == 1)//his language is english and do the same for the other languages.
That'd be a massive long ass list of ifs and else ifs, surely there is a better way?
Reply
#6

You said: "the most efficient & effective way of doing this"

And the most efficient and effective way is y_text.
Reply
#7

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
You said: "the most efficient & effective way of doing this"

And the most efficient and effective way is y_text.
This is true. Just go with y_text.
Reply
#8

You can use any translator API to translate texts and send to player. Bing translator allows you to connect with their API, you'll have to register to get an API ID.

EDIT : I just found this plugin while searching, some if it's natives could also help you - https://sampforum.blast.hk/showthread.php?tid=479169. So then translation could be done according to the language player has chosen.
Reply
#9

So far what I am getting from this is, "a lot of effort for not much gain", so I think I shall pass on this, thanks anyway guys.

Quote:
Originally Posted by Sithis
Посмотреть сообщение
This is true. Just go with y_text.
The only way you would see something by ****** on my server would be if someone shot me then hacked into the SVN account and added it themselves.
Reply
#10

Quote:
Originally Posted by Redirect Left
Посмотреть сообщение
So far what I am getting from this is, "a lot of effort for not much gain", so I think I shall pass on this, thanks anyway guys.


The only way you would see something by ****** on my server would be if someone shot me then hacked into the SVN account and added it themselves.
dofl

Just use ****** translate to convert a string from one language to another while retrieving the converted string.

English ---> https://translate.******.com/?hl=en
French ---> https://translate.******.com/?hl=fr

So basically a player picks their language and the hl tag will be pre-defined to translate such texts from English to their language. You should create a function which replaces SendClientMessage to be able to send the translated message to the play.

I remember seeing a filterscript that uses ****** translate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)