I am lost on multi-language implementation. How to handle it? Session, Cookies, File, ...other ways?
Overview Website is a user content website, like a social network. We will have system content controlled by us and user content translated by users. Languages supported will be system controlled. To start there will be the top 20 supported languages. There are two user types (Non-user and logged-in user). Both user types have pages as not all pages are behind a log-in. Non users can still view many public pages or profile pages that are public.
Requirement
I want to access a public page in French (as an example) directly without having to hit the site in english then change the language to french. (optional)
For user content -> If I want to translate an English content to Italian, I am looking to translate only that 1 content (example status update) not the entire page. So page is in English but I can input Italian for that one content without converting the entire page into Italian.
Search for content based on language from one place. If I am reading reviews, I want to load only German reviews from the menu but not change other page content.
I want to view all wall posts that are in German, can I do it straight from my profile by changing the language or do I have to logout of that language session and login with a new session for the new language,开发者_高级运维 if session based?
I am seeking to be able to change language on any page, for any content without having the user to login or logout.
- I need to perform analytics for internal purposes based on language type. (like number of wall posts by people by network X who posted content in Chinese. So I will need to track per language per content.)
Other I am still not sure if the content will be database or file driven but first I am looking into how I can best handle multi-language for scalability yet keep it user friendly.
Suggestions?
This was probably not answered because of this section of the faq: "Your questions should be reasonably scoped. If you can imagine an entire book that answers your question, you’re asking too much." https://stackoverflow.com/faq
Translation engine+search engine+user engine+analytics engine? Try learning and implementing one at a time. I'm going to answer it just in case someone sees this and is still interested, but I'm not an expert in this area neither, so I'll list what I did and think.
1st, create the language engine. A simple "Language" drop-down menu somewhere should be enough so far (for the visitors) with the database, cookies, session and code correctly done. Create it as you like it, what you listed is rather complex but perfectly achievable.
2nd, add the user engine, including database, log in/log out forms, code and everything needed and put both of them together. Each user needs to have a column in the "user" table with their preferred language. Modify slightly the language engine to support users. This must be easy to implement now.
3rd, (and still new for me), create the search engine.
4th, implement the analytics engine. I'd recommend using an external one, since it's much easier and complete.
But, as stated, this is just my opinion.
精彩评论