boionfire81 Posted March 16, 2016 Share Posted March 16, 2016 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? Quote Link to comment Share on other sites More sharing options...
Zettieee Posted March 17, 2016 Share Posted March 17, 2016 It's a database issue. Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 17, 2016 Author Share Posted March 17, 2016 Is it changeable? Right now learning to read/write php. Mysql would break my brain lol Quote Link to comment Share on other sites More sharing options...
G7470 Posted March 18, 2016 Share Posted March 18, 2016 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 Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 18, 2016 Author Share Posted March 18, 2016 I just have about 6 or 7 cities where I'd like their description to show in their own language. If the database isn't possible, what about coding it via an print statement with the link coded as well. Basically not dynamic. Quote Link to comment Share on other sites More sharing options...
G7470 Posted March 18, 2016 Share Posted March 18, 2016 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 Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 18, 2016 Author Share Posted March 18, 2016 Yeah, probably end up going that route. Just curious how php handles chinese lol! Quote Link to comment Share on other sites More sharing options...
G7470 Posted March 18, 2016 Share Posted March 18, 2016 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 Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 19, 2016 Share Posted March 19, 2016 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. Quote Link to comment Share on other sites More sharing options...
SRB Posted March 21, 2016 Share Posted March 21, 2016 GetText API works for global text replacement within language files. Prepare for headaches if you don't know much about PHP though. Quote Link to comment Share on other sites More sharing options...
Dominion Posted April 4, 2016 Share Posted April 4, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.