Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
496 views
in Technique[技术] by (71.8m points)

internationalization - How to setup CodeIgniter for a truly multi language website?

I need to setup CodeIgniter to be a truly multi language website. I've searched but I can't find a solution.

I've tested this approach but it is not working. (http://codeigniter.com/wiki/Category%3AInternationalization%3A%3AInternationalization_Views_i18n/)

Can someone give me a clue about what setup to use to get a truly multi language environment in CodeIgniter?

Best Regards,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n

If you implement this, you URLs will contain the language code. You can save your language parts in the language directory. With the function lang();

Loading language files and handling them is explained here: https://www.codeigniter.com/user_guide/libraries/language.html

The helper: https://www.codeigniter.com/user_guide/helpers/language_helper.html

Easiest way is have to some global language files which you auto load. I suggest creating a language file for every controller. So you only load the part you need instead of loading all language files.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...