General Category > General Questions

Country's where rsps are played

<<< (2/6) >>>

Ambokile:
Here's how it works with a SAMP server I worked on a while back.

You send the string like this:

--- Code: Java ---player.sendMessage("Hello");player.sendMessage("Welcome to Lumbridge Castle, the home of Duke Horacio.");
then in sendMessage you will have something like this:

--- Code: Java ---public void sendMessage(String message){    if (getPlayerLanguage() == MessageLanguage.English)    {        _sendMessage(message);    }    _sendMessage(LanguageHandler.translateMessage(message, language));}
Then you simply have a database to handle the translations. Something like this, maybe:
languageCodeoriginalMessagetranslatedMessagees-ESHelloHelloes-ESWelcome to Lumbridge Castle, the home of Duke Horacio.Bienvenidos al Castillo de Lumbridge, la casa del duque Horacio.
This allows you to provide an easy-to-use and scalable system for multiple languages :)

Strucker:
kudos++ to ambokile for using spanish :)

Death Style:
could just keep a 2d array of messages where the second index is the player's language

Bowser jr:

--- Quote from: Ambokile on July 29, 2014, 10:22:52 AM ---Here's how it works with a SAMP server I worked on a while back.

You send the string like this:

--- Code: Java ---player.sendMessage("Hello");player.sendMessage("Welcome to Lumbridge Castle, the home of Duke Horacio.");
then in sendMessage you will have something like this:

--- Code: Java ---public void sendMessage(String message){    if (getPlayerLanguage() == MessageLanguage.English)    {        _sendMessage(message);    }    _sendMessage(LanguageHandler.translateMessage(message, language));}
Then you simply have a database to handle the translations. Something like this, maybe:
languageCodeoriginalMessagetranslatedMessagees-ESHelloHelloes-ESWelcome to Lumbridge Castle, the home of Duke Horacio.Bienvenidos al Castillo de Lumbridge, la casa del duque Horacio.
This allows you to provide an easy-to-use and scalable system for multiple languages :)

--- End quote ---

--- Quote from: Death Style on July 29, 2014, 06:00:53 PM ---could just keep a 2d array of messages where the second index is the player's language

--- End quote ---
Use a unique identifier for each message and have some sort of database/file/whatever that connect the identifier to the localized string.
So "Greetings. Welcome to my castle." can be replaced with "NPC.dukehuracio.greeting.1" or something similar. With this you're disconnecting code and language. If you want to fix change anything about what he says, you change the language files where you'll make the change, and not the code or any other language file. You also avoid problems when 1 to 1 translations of phrases is inaccurate.


If you make a proper system you can make volunteers translate for you. Just provide them with the English language file and they can translate it. However you shouldn't have two different languages on the same server, so what is the point of having multiple languages?

HcoJustin:
Someone should hook into Google translate for their chat messages

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version
Powered by SMFPacks SEO Pro Mod |