Welcome Guest, Not a member yet? Register   Sign In
Nesting [extending] of language files
#1

[eluser]Unknown[/eluser]
I extended CI_Validation class and it's not possible to do the same with corresponding language file in the same way (i.e. by placing a file which extends basic language data).

I think it should be possible to extend default language files.

Steps to reproduce:
When I place a file with name validation_lang.php into directory system\application\language\english\ this file's content replaces content of original system\language\english\validation_lang.php

Expected result:
First, load system\language\english\validation_lang.php
Second, load system\application\language\english\validation_lang.php if exists
#2

[eluser]xwero[/eluser]
The application directory file doesn't overwrite the system directory file. The application directory file is loaded that is all.
Code:
// system/libraries/Language.php snippet
if (file_exists(APPPATH.'language/'.$idiom.'/'.$langfile))
        {
            include(APPPATH.'language/'.$idiom.'/'.$langfile);
        }
        else
        {
            if (file_exists(BASEPATH.'language/'.$idiom.'/'.$langfile))
            {
                include(BASEPATH.'language/'.$idiom.'/'.$langfile);
            }
So extending the language files isn't part of the framework yet. But here is the feature request with a solution.
#3

[eluser]Unknown[/eluser]
Thank you for the solution. I think it must be used in next versions as part of core.




Theme © iAndrew 2016 - Forum software by © MyBB