Poll: URI language identifier in core?
You do not have permission to vote in this poll.
yes
52.38%
22 52.38%
no
26.19%
11 26.19%
maybe
21.43%
9 21.43%
Total 42 vote(s) 100%
* You voted for this item. [Show Results]

  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add URI Language Identifier to core?

#1
(I just start using CI for a few weeks and I like it. Hope it's not a stupid question/request.)

Although there are a solution on the Github wiki (https://github.com/bcit-ci/CodeIgniter/w...Identifier), I think it should be in the core for nicer localization and SEO.

How you guys think?
Reply

#2
What exactly are you proposing? "URI language identifier in core" is too vague.
The article you reference seems to suggest changing the routing (which would not work for everyone) and enhancing the Lang class.

Are you suggesting that something like this be built in so that all CI sites should do this?
Reply

#3
The purpose is to make URL like http://www.apple.com/ (English), http://www.apple.com/fr (French), http://www.apple.com/hk (Hong Kong). This is one of the best way for handling multilingual website I think.
I didn't mean to force everyone who making multilingual site to follow this. Using cookie or query string are good way too but I personally think that these are not elegant enough. It will be nice if CI provide us with this choice and make this as a build in solution.
Reply

#4
I prefer the usual url layout example.com/class/function/ID (where class is the controller) and work with resource files.
So no need for a 'language segment'.

I am curious what others think. What are the advantages of this approach?
Reply

#5
I read the Wiki material in the past, but I didn't like it. I've got another implementation for CI3.

http://iridadesign.com/starter-public-edition-4/www/ - The default language English. There is an option for hiding the language segment for the default language, you can use it especially if the site supports only one language.
http://iridadesign.com/starter-public-edition-4/www/en/ - English again.
http://iridadesign.com/starter-public-edition-4/www/bg/ - Bulgarian
http://iridadesign.com/starter-public-edition-4/www/fr/ - French
http://iridadesign.com/starter-public-edition-4/www/pl/ - Polish
etc ...

A key precondition: The language segment is transparent for the routing system. Once it has been read it disappears from the internal array(s) that contain URI segments. Don't patch the routes.php configuration file about language support.
Reply

#6
1 SEO tip
if
/ - is english
/en must not exists - else you will have duplicate content (you can handle this case with canonicals but its not a good option..)

For the thread - yes there is a need of supporting locale inside the router by default.
There is always locale - 1 default or many it doesn't matter. Even if its not displayed (if its 1 only) you again have language which you will output.
So CI must provide fast and easy way to catch and handle language/locale by its routers..
Best VPS Hosting : Digital Ocean
Reply

#7
@sv3tli0

I generate the links according to your recommendation. "Hidden" routes are not good indeed, duplicates that I am causing could be blocked easily, I suppose.

Speaking of SEO...
http://iridadesign.com/starter-public-ed...itemap.xml - the root entry.
http://iridadesign.com/starter-public-ed...itemap/xml - an entry specific to a particular module, this one declares language translations.


Edit 13-APR-2015:
@sv3tli0
Thank you very much! I have just put 301 redirections for solving the duplicate content problem.
Reply

#8
For SEO with duplicate content, don't redirect, use canonical URLs:
http://moz.com/learn/seo/canonicalization
Reply

#9
From what I've read, both of canonical URLs and 301 redirects are possible methods, I hesitate. Now I did redirection, code for this is within the router and it is dirty, because there is no controller instance created, I don't like it.

Maybe canonicalization would be better, and for making it easy, base controller (for example) should propose a default method for generation of canonical URL. TODO.

Edit: I got in favor for canonicalization, because it would deal with more duplicates:
http://site.com/
http://site.com/index.php
http://site.com/welcome
http://site.com/welcome/
http://site.com/welcome/index
http://site.com/welcome/index/
Reply

#10
I voted No, because I do not want the framework to dictate how I choose to handle multi-language implementations.

It depends so much on the site itself, that I have used several approaches in the past with CI, all of them easy enough to implement.

There is no clear or set answer as to how to handle multi language implementations. It depends on the needs of the client.

Paul.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.