Welcome Guest, Not a member yet? Register   Sign In
Switching contents language in CodeIgniter
#4

[eluser]gon[/eluser]
Quote:1) In language files, should English and Arabic array keys be different from each other (e.g: $lang[’welcome_en’] and $lang[’welcome_ar’])? or are they supposed to use the same key name since they’re in different files?

Using CI language files, you generate 2 files with the same name, and store them in its folder:
arabic/mytranslations.php
english/mytranslations.php

Read the user guide for details on loading the correct file.

Quote:2) How do I use the ‘yourdomain.com/ar/home’ URI structure when home is my default controller? I don’t know how that would work with other controllers either.

Sometimes I extend the CI URI library to make it work the way I want. For example, store the first uri segment in the $language var, and consider the second segment to be the first, so controllers will load as usual.

But you can try using .htaccess rules, or CI routing.

Good luck


Messages In This Thread
Switching contents language in CodeIgniter - by El Forum - 04-07-2008, 03:25 AM
Switching contents language in CodeIgniter - by El Forum - 04-07-2008, 03:39 AM
Switching contents language in CodeIgniter - by El Forum - 04-07-2008, 05:33 AM
Switching contents language in CodeIgniter - by El Forum - 04-07-2008, 05:41 AM
Switching contents language in CodeIgniter - by El Forum - 04-07-2008, 06:04 AM
Switching contents language in CodeIgniter - by El Forum - 04-08-2008, 07:57 PM
Switching contents language in CodeIgniter - by El Forum - 04-09-2008, 07:07 AM
Switching contents language in CodeIgniter - by El Forum - 04-13-2008, 05:18 AM
Switching contents language in CodeIgniter - by El Forum - 04-13-2008, 06:18 AM
Switching contents language in CodeIgniter - by El Forum - 04-13-2008, 07:21 AM
Switching contents language in CodeIgniter - by El Forum - 06-19-2008, 05:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB