Multi-language Implementation (MVC framework)

Source: Internet
Author: User

About the MVC framework implementation of multi-language statements:

1, IIS: processing basic pictures, JS library (jquery library, CSS style, etc.) request.

2, Ihttpmodel: Processing the client request, set the Thread.currentThread.ThreadCultureInfo, so that later users can use it as standard to return the corresponding language Html,css,js file. (Note: Overriding the parent class for a controller can also be implemented, as is the case below)

3, Action: Handle Js,json file substitution work (in a multilingual place, with some kind of token substitution), and it for view, the view of the word to the engine to handle.

Note: For the model of the multi-language problem, my implementation is in the process of processing on the road

I realize this method, for the specific JS implementation of a language version, so that the JS request does not need to re-render and replace the work. 》

4, actionexecuted: For multi-language view (fixed place), multi-lingual alternative work (working with the action of the JS processing is the same).

5. Views: The view engine only handles rendering work from the background processing data, as well as the implementation of related data substitution (for customer needs).

About the MVC framework process

Request---------->iis--------->ihttpmodel-------->rout---<controllersFactory>-----> CONTROLLERS-----<actionExecuting>----->action----

<actionExecuted>--<resultExecuteing>--->view----<resultExecuted>------>response

About the code (see appendix for the original code)

Link Address: Http://url.cn/RTbENv

Poorly written places, or improvements, can be more meaning, or some better ways to solve multiple languages! Rookie, thank you here!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.