Jump to content
MakeWebGames

Foreign languages


boionfire81

Recommended Posts

In keep with the theme and making the game full depth, I'm wanting to input the city descriptions in the language of the city. But such languages as chinese, arabic, and some spanish characters are not allowed. Can this be changed?

It is probably a security thing monitoring the input of the field, which is great, but can I disable it temporarily?

Link to comment
Share on other sites

Is it changeable? Yes - well, partially. At least to my knowledge, you won't get away with storing multiple different languages into different rows of one table. That's just not going to happen. You would have to create a table for each language that is currently not supported by the standard (so a Spanish table, Chinese table, etc) and change the collection collations to match.

For your particular purpose, I think it's a terrible idea to go down this route simply because of all of the overhead that would be required - plus all of the duplication, which is something you do not want to have in your code base. My suggestion would be to say "good idea, but far too much of a burden to deal with" (unless you had plenty of $$ to spend) and try something else.

~G7470

Link to comment
Share on other sites

If the text that is going to be printed is in the proper language (meaning that you didn't have to do any sort of translation), then you should be able to get away with it. Otherwise, doing a translation from English to another language through an API or code in most cases costs $$ or a lot of time. You'll just have to know which city is using what language and print out the text in that language.

~G7470

Link to comment
Share on other sites

My suggestion is to not echo any of the different language text out - meaning that I would just remove PHP from that part of the equation and just put that text into the HTML. There's no reason to get PHP involved with it if it's not needed. ;)

~G7470

Link to comment
Share on other sites

How much text are you looking to translate exactly? If it's just a word or two here and there I believe google has an API with so many translations a month for free.

You can create a function to search a translation table in your DB to see if there is a match and if not, hit the Google API and add it in.

Link to comment
Share on other sites

  • 2 weeks later...

If all you're doing is putting some text in a different language for the description store it in a text file, and output it (File_get_contents() etc...). Don't go into anything more complex.

If you're looking to translate the whole site or more then those 6 cities this would be a very inefficient way to do it, but for now I'd consider it for the simplicity.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...