Jason Huck Posted March 15, 2016 Posted March 15, 2016 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
BitPoet Posted March 15, 2016 Posted March 15, 2016 Option b has been done before, so maybe you could try the solution in that thread (on a copy) before going the "hard way".
Sergio Posted March 15, 2016 Posted March 15, 2016 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) 4
Jason Huck Posted March 16, 2016 Author Posted March 16, 2016 Thank you Sérgio, that's a perfect solution for this particular situation! 1
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