The map.php file was added since 4.5.1 to allow multiple lang keys to map to the same general lang key. I want to add my own custom maps so can this file be extended in a way similar to how cust_lang.php extends/overrides lang.php? Can I just make a cust_map.php file and, if not, shouldn’t something like this be possible?
Hi,
have a look at this blog post:
http://www.oxid-esales.com/en/news/blog/improved-language-handling-oxid-eshop-version-451
Hope it helps.
Regards
No, unfortunately not. That post talks about extending the lang files but not the map file.
well the source code in deed does not seem to have that option :
oxlang::protected function _getLanguageMap( $iLang )
$sMapFile = $myConfig->getOutDir() . '/' . $myConfig->getConfigParam( "sTheme" ) .'/' . oxLang::getInstance()->getLanguageAbbr( $iLang ) . '/map.php';
is where the beef is.
So it seems you will need to override this function and merge your custom_map.php into it …
I did not get the point…
For what reason should I have the option for a custom_map.php? If you already can use the custom_lang.php?
[QUOTE=Hebsacker;71577]I did not get the point…
For what reason should I have the option for a custom_map.php? If you already can use the custom_lang.php?[/QUOTE]
To maintain the whole purpose of the map.php for custom themes. The map.php file avoids having multiple entries of the same value in the lang.php file, as was the case prior to 4.5. This is a great improvement, but should be extended to custom themes as well. For example, say I have a new theme-specific lang key in the checkout tpl’s as well as the order email tpl’s that refer to the same thing such as…
‘ABC_PAGE_CHECKOUT_BASKETCONTENTS_NEWKEY’ => “Text”
‘ABC_EMAIL_ORDER_CUST_HTML_NEWKEY’ => “Text”
Given the presence of the map file, I should not have to put two entries of the same value in my theme specific lang file, otherwise we’re back to pre 4.5 functionality. Instead, I should have the ability the place the following in the general lang file:
‘ABC_NEWKEY’ = “Text”
And then apply the applicable additions to the map.php file:
‘ABC_PAGE_CHECKOUT_BASKETCONTENTS_NEWKEY’ => ‘ABC_NEWKEY’
‘ABC_EMAIL_ORDER_CUST_HTML_NEWKEY’ => ‘ABC_NEWKEY’
It seems to me the handling of lang files has been improved w/o the provision to maintain this improvement for custom templates.
I will bring this up in the dev mailing list.
I don´t get it either… anyway, now I have an idea what logic is behind that.
It’s a chicken-and-egg question.
I would have used an existing language-key in my new template.
Well i can understand to some extent, but even more i do understand it is not standard behavior.
If standard package should consider even more the system would become a featurecreep and also slow.
For my understanding the map.php is needed for internal compatibility and should not be blown up.
In fact your wish makes sense to you it is fine, so this would be the developer time to implement it module wise, which should be an easy task