Internationalization and localization (i18n) for CodeIgniter 3.0? |
(12-28-2014, 12:34 AM)karthik_code Wrote: Here is a workout for CI 2.1 https://github.com/bcit-ci/CodeIgniter/w...ation-i18n Though the code could use some cleanup and modernization, it would probably work with 3.0 with the following modifications: Change the site_url() method in MY_Config to accept a second argument and pass that argument to the parent's site_url() method: PHP Code: class MY_Config extends CI_Config Don't use the provided language helper (or update it to work properly with the arguments expected by the CI 3.0 language helper). You would probably be better off using printf()/sprintf() to handle placeholders in your localized strings anyway. Most of the functions in the MY_Lang file don't override existing functions, so you may be able to use that unmodified, but I would recommend: - rename the MY_Lang() function to __construct() - add the public visibility keyword to the load() method - remove the default value from the load() method's $langfile argument |
Messages In This Thread |
Internationalization and localization (i18n) for CodeIgniter 3.0? - by karthik_code - 12-27-2014, 04:02 AM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by sneakyimp - 12-27-2014, 04:59 PM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by ivantcholakov - 12-27-2014, 09:36 PM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by freddy - 04-23-2015, 12:58 AM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by karthik_code - 12-28-2014, 12:34 AM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by mwhitney - 12-30-2014, 02:39 PM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by abbasmeran - 03-04-2015, 02:40 PM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by abbasmeran - 03-04-2015, 02:41 PM
RE: Internationalization and localization (i18n) for CodeIgniter 3.0? - by olivedev - 02-20-2018, 02:51 AM
|