Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Numeric keys get reindexed when loading multiple language files #292

Closed
frankmichel opened this Issue Aug 25, 2011 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

frankmichel commented Aug 25, 2011

When loading multiple language files via $this->lang->load() and there are numeric keys in any of the language files these keys will be reindexed leading to an error when trying to load a language line with the original key.

This is due to line #114 in system/core/Lang.php where array_merge() should be replaced by $this->language + $lang.

See also: http://www.vancelucas.com/blog/php-array_merge-preserving-numeric-keys/

Contributor

derekjones commented Aug 25, 2011

The logical operator || does not conform to CodeIgniter's coding style guidelines, as it is too easily mistaken for ll (those are two lowercase Ls) or 11 in the most common web fonts. ref: http://codeigniter.com/user_guide/general/styleguide.html#logical_operators

Could I ask you to resubmit your pull request with this corrected, or with just the array_merge() fix alone? Thanks!

@derekjones derekjones closed this Aug 25, 2011

Contributor

frankmichel commented Aug 25, 2011

thanks, derek. i changed and updated the pull request!

derekjones added a commit that referenced this issue Aug 25, 2011

Merge pull request #293 from frankmichel/develop
fix for issue #292 with multiple language files

Dentxinho pushed a commit to Dentxinho/CodeIgniter that referenced this issue Sep 28, 2012

Merge pull request #292 from slav123/2
updated polish translation

sviande pushed a commit to sviande/CodeIgniter that referenced this issue Jan 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment