Noel Boss Posted October 28, 2019 Share Posted October 28, 2019 Has anyone tried renaming the default language name from "default" to something else like "en" ? Are there unintended side effects or restrictions or anything else to consider? There is $languages->findNonDefault(); and $languages->getDefault(); that suggest that renaming should be possible without breaking the core, but I suspect, some modules ore maybe even the core are using $languages->find('name=default') or the inverse and thus break things all over the place… Has anyone pulled this off? Link to comment Share on other sites More sharing options...
dragan Posted October 28, 2019 Share Posted October 28, 2019 Apparently you can't. May I ask why you want to do this? Is changing the title not enough? Link to comment Share on other sites More sharing options...
Noel Boss Posted October 29, 2019 Author Share Posted October 29, 2019 Technically I can, directly in the DB… And it also apparently works… But I don't know in how many ways it could break. Want to rename it, because I want it to be semantically correct and because I don't want to add a new field. I need it to display labels like "en" "de" and I could just use the name to do so instead of adding another field or hardcoding it… 1 Link to comment Share on other sites More sharing options...
AndZyk Posted October 29, 2019 Share Posted October 29, 2019 I use the default name and make a substr with only the first two characters. Works for "de" and "en", but probably not for every language. ? 1 Link to comment Share on other sites More sharing options...
kixe Posted October 29, 2019 Share Posted October 29, 2019 As far I can see it is possible to change it in the DB. After a quick research I couldn't find any place where this would cause problems (maybe in 3d party modules?). But still I wouldn't do that. If you just want the value for the label, why not taking it from the homepage name, representing the language in the url. foreach ($languages as $l) echo $pages->get(1)->localName($l); 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now