froot Posted July 21, 2020 Share Posted July 21, 2020 I have a site with two languages english and german. Default language is set to english, but should be set to german. Is there an easy way to swap them? Many thanks Link to comment Share on other sites More sharing options...
bernhard Posted July 21, 2020 Share Posted July 21, 2020 https://www.google.com/search?q=site:processwire.com+change+default+language 1 Link to comment Share on other sites More sharing options...
kongondo Posted July 21, 2020 Share Posted July 21, 2020 With bells and whistles ? 3 Link to comment Share on other sites More sharing options...
froot Posted July 21, 2020 Author Share Posted July 21, 2020 the thing is, the entire project is basically finished and all strings translated to german, except that the default language should be german and english secondary. I didn't think that would be a problem later on and should be considered from the very start. Now it so far seems like a big hassle, most solutions suggested here assume that not much progress has been done on the project anyway or the required default language not even created. (Another solution: I'd be fine with switching the strings manually, however, the url then still stay /de/ for english and /en/ for german, don't know how to change that.) Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted July 21, 2020 Share Posted July 21, 2020 Hey, @fruid! You can try this algorithm of actions: Export all the strings from German language. Import the exported German strings to default language, making it German. Remove all translations from the secondary language, making it untranslated => English. Maybe rename things here and there for the convenience. Change the name of the secondary page to en. 2 Link to comment Share on other sites More sharing options...
froot Posted July 21, 2020 Author Share Posted July 21, 2020 @Ivan Gretsky thanks for the input, but I think I tried that and couldn't figure out how to change the /en/ to /de/ and vice versa. Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted July 21, 2020 Share Posted July 21, 2020 Aren't en and de just the titles names of corresponding language pages? So just change the name of the secondary language page to en. 2 Link to comment Share on other sites More sharing options...
froot Posted July 21, 2020 Author Share Posted July 21, 2020 I thought so too but now I came to doubt that Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted July 21, 2020 Share Posted July 21, 2020 Just try it. I think it will work. I fixed my advice above a bit to make it more clear. 1 Link to comment Share on other sites More sharing options...
froot Posted July 21, 2020 Author Share Posted July 21, 2020 getting closer to the issue I think… I renamed the default language to deutsch/german, deleted all the json files in there. But I can't upload the german .json files nor the complete .zip file to this language. I'm getting errors:Refused file wire …… .json because it is already on the file system and owned by a different field. I even deleted the other secondary language, first only the json strings in there, now the entire language package. Still can't upload. Thanks for help! Link to comment Share on other sites More sharing options...
horst Posted July 21, 2020 Share Posted July 21, 2020 2 hours ago, fruid said: Refused file wire …… .json because it is already on the file system and owned by a different field. Check the site/assets/files/{ID-OF-YOUR-LANGUAGES}/ directories and delete all zip or json files belonging to the languages. Looks like there's some junk left over from all your trying. ? Or you messed a bit with the core and site translation files (?) Edit: you may go under fields -> filter; allow system fields; YES, then you see the fields language_files and language_files_site. If you click to edit them, you can on tab input and tip the checkbox near Overwrite existing files (at least while experimenting). 1 Link to comment Share on other sites More sharing options...
froot Posted July 22, 2020 Author Share Posted July 22, 2020 (edited) @horst Followed all your advice, deleted the .zip and .json files in those /assets/files/ folders, checked the "overwrite existing files" as suggested for the mentioned fields. Now I at least can upload the german language package to the default language entry. I deleted all the files within the secondary language (now called english). However, the frontend still /de/ in the URL for the english site and nothing for the default language german (which is fine). How to change that? The page contents and custom fields are mixed up as well (I might just swap that manually since it's not that big of a site). Thanks so far! EDIT: now I deleted the secondary language because I thought re-installing might fix the issue, also since english doesn't require any files to work. But now it doesn't work in the frontend, all links to default language. Edited July 22, 2020 by fruid Link to comment Share on other sites More sharing options...
horst Posted July 22, 2020 Share Posted July 22, 2020 Ah, you are talking of the secondary languages path name. So, as it is the Homepage, what resides in the root, you previously have set it and now have to change it in the homepage under Settings Tab > Name: 3 Link to comment Share on other sites More sharing options...
froot Posted July 23, 2020 Author Share Posted July 23, 2020 @horst yes, that did it! All good now. Danke vielmals! 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