Guest Posted September 13, 2005 Share Posted September 13, 2005 Hey guys, for those of you who are modding CC3, you know that modding the lang.XX.inc.php file can be a bit of a pain. It's 2200+ lines of code. And for the more involved mods, it will have to be edited or added to in several places. Then there's the issue of upgrades. When brooky releases his next incarnation, that fill will likely have changes that need to be incorporated. And with the scope of that file, it could become a daunting task to inform all your customers on what they need to do. So to help alleviate this problem, I've come up with a upgrade-safe method which will make language additions MUCH easier and cleaner. You don't have to touch the lang.XX.inc.php file at all. Simply edit the /language/XX/config.inc.php file and add one line as such: <?php $langName = "English"; $charsetIso = "iso-8859-1"; $strftime = "%A %e, %B %Y"; include("3rdPartyLang.inc.php"); ?> This lets you then add in the 3rdPartyLang.inc.php file and put in all the new text that you want. Here's a small exacmple: <?php $newlang['admin']['customers'] = array ( // Begin lines added for Goober's Discount Group mod. 'discount_group' => "Discount Group", 'no_discount_group' => "No Discount Group", // End lines added for Goober's Discount Group mod. ); $lang['admin']['customers'] = array_merge($lang['admin']['customers'], $newlang['admin']['customers']); $newlang['admin']['nav'] = array( // Line added for Sir William's Category Order mod. 'reorder_categories' => "Reorder Categories", // Line added for Goober's Discount Group mod. '3rdparty' => "3rd Party", ); $lang['admin']['nav'] = array_merge($lang['admin']['nav'], $newlang['admin']['nav']); ?> This not only keeps you upgrade-safe, it puts all your new text in one place where it's easier to support and maintain. Since array_merge will also replace existing array keys, this can also be used to change existing text within CC3. So if your mod requires that some of the stock text be different, it will still be different after an upgrade. Anyway, that's my proposal and contribution to the CC modding community. It works like a charm and will save you lots of time and energy. Quote Link to comment Share on other sites More sharing options...
goober999 Posted September 13, 2005 Share Posted September 13, 2005 Sir William, This is a Great idea, I know it will help me out alot. I will use it. Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.