Jump to content

Using an empty language pack as the default (front end) language.


Jason Huck
 Share

Recommended Posts

What's the best way to create a processwire site with a bilingual (Danish and English) front end, where Danish is the default language (no language code in the URLs) and English is the secondary language (URLs prefixed with /en/)?

There is no language pack available for Danish, and the site administrators don't mind if the back end is in English only. I'd like to use the built-in multilingual features of processwire as much as possible.

I started out with an English installation and added an empty language pack for Danish, but it's apparently a bit of a pain to actually switch the default front end language after the fact. I can't remove the language prefix (/da/) for the Danish URLs (under Pages -> Home -> Settings). If I try, it just adds /en/ there. And, URLs without a prefix still default to English.

Should I:

(a) start with a new installation and select Danish as the default language from the beginning? Can I even do that when there isn't a real language pack to use, or will it cause problems? (If this is what I need to do, is there a way to hack an exported site profile to switch the default language so I don't have to start over completely from scratch?)

(b) hack the current installation somehow to switch the default language without starting over?

© resign myself to having a language code prefix for both languages? (I don't want to introduce a bunch of redirects into the equation.)

(d) something else?

Suggestions appreciated!

Jason

Link to comment
Share on other sites

Just to be clear: it's not required to install a language pack. A language pack is nothing more than strings already translated. ProcessWire will not depend on that, it will always use the default if a translation if missing. 

Do you have lots of data already? If you don't, you can do the following:

On setup > languages

1 - Change 'default' language title to Danish

2 - Change 'da' language name to 'en' and its title to English 

In every page, copy the content from one language tab (on every field) to the other. (yeah, I know...)

===========

You can also use the module Migrator to export everything to a json file, open it and find/replace things there (I never tried, though)

  • Like 4
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...