Welcome Guest, Not a member yet? Register   Sign In
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]

Add URI Language Identifier to core?
#35

CI4 could implement this core feature as:

1) Rule: The URI language identifier (if present) must be first segment in route path.
  for example: http://localhost/es-US/controller/action
2) The user must configure if the URI lang feature is enabled. If it is not enabled, CI4 must treat route path as always, unchanged.
3) if the URI lang feature is enabled, the user must configure the regexp that the URI lang must match to be considered as a language identifier. This is because URI lang may be not specified in the URI.
  for example: http://localhost/es-US/controller/action is a valid URI and http://localhost/controller/action is valid too!
4) The route handler: if first segment in route matches the regexp defined then it can be stored somewhere inside the CI instance and continue processing the rest of the route as always, unchanged.
5) The application gets the stored language for the request and executes whatever must be done, (probably loads a language file...)

Here I link to a post (of my own) with this proposition implemented using just URI Callbacks.

http://forum.codeigniter.com/thread-62100.html

regards!
Reply


Messages In This Thread
RE: Add URI Language Identifier to core? - by Guido - 06-17-2015, 11:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB