Jump to content
Noel Boss

Change default language name

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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…

  • Like 1

Share this post


Link to post
Share on other sites

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. 😀

  • Like 1

Share this post


Link to post
Share on other sites

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);

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...