Jump to content

[SOLVED] Default Multi-language Install Not Working


happywire
 Share

Recommended Posts

[solution]

=========================================================

Using devilbox to develop locally.

Installing the Beginner, Intermediate and Blank sites from the setup menu works perfect.
The sites load, all pages load, can access the admin panel, all fine.

However when installing the Multi-language site, the one I can pick during the setup procedure, things do not work.

The English Home page works.
The English About page,

https://wiremultilang.loc/en/about/ 

tells me

Quote

The page isn’t redirecting properly.
This problem can sometimes be caused by disabling or refusing to accept cookies.

Same for the English Sitemap,

https://wiremultilang.loc/en/site-map/

.

I have allowed all cookies and can see them when checking in the browser cookies and site data, using Firefox 65.0.1 64-bit on Ubuntu 18.04.2 LTS.

Clicking "German" on the Home page,

https://wiremultilang.loc/de/

, shows me the German version of the 404 page.
Clicking "Finish" on the Home page,

https://wiremultilang.loc/fi/

, shows me the Finish version of the 404 page.

What could be the issue here?
Thank you for your guidance or any help you could supply.

Link to comment
Share on other sites

I never had problems with multilang install... but I'm using Laragon locally.

The above error or warning message is somewhat misleading. Don't ever edit files inside wire/. What you should do instead, is go to setup > languages and then spot the according JSON file to translate, e.g.

http://localhost/pw/admin/setup/language-translator/edit/?language_id=1012&textdomain=wire--modules--languagesupport--languagesupport-module

(or are these underlined strings direct links to these settings?)

In my case, the locale was already there.

However, I don't think this is the reason why you get these strange 404 errors. Did you install one profile after another in the same directory? Maybe there are some leftovers from previous profiles / installs. Check the .htaccess file. Maybe you need to adjust some settings there. Maybe delete everything inside site/assets/cache/ folder, delete your browser cookies, log out of admin, and retry.

  • Like 2
Link to comment
Share on other sites

1 hour ago, dragan said:

What you should do instead, is go to setup > languages and then spot the according JSON file to translate

This is something I have to do each time on my virtual server and I guess it has to be done to have correct locale definitions depending on user's language choice.

For each language click on "Find Files to Translate" and from the list "Translateable files in /wire/" select "/modules/LanguageSupport/LanguageSupport.module" and click submit.

In the field for "C" enter the correct locale setting (something like "de_DE.utf8" for german). The exact string depends on your particular system. I know we had a topic to list installed locales somewhere...

Edit: This may help:

print_r(\ResourceBundle::getLocales(''));

 

Link to comment
Share on other sites

54 minutes ago, dragan said:

or are these underlined strings direct links to these settings?

The English link goes to

https://wiremultilang.loc/processwire/setup/language-translator/edit/?language_id=1010&textdomain=wire--modules--languagesupport--languagesupport-module&filename=wire/modules/LanguageSupport/LanguageSupport.module

The German link goes to

https://wiremultilang.loc/processwire/setup/language-translator/edit/?language_id=1012&textdomain=wire--modules--languagesupport--languagesupport-module&filename=wire/modules/LanguageSupport/LanguageSupport.module

The Finish link goes to

https://wiremultilang.loc/processwire/setup/language-translator/edit/?language_id=1013&textdomain=wire--modules--languagesupport--languagesupport-module&filename=wire/modules/LanguageSupport/LanguageSupport.module

Is there something I need to do inside those files?

The only link that looks different is the German link, there are some values that are given, both the English and Finish one are completely empty.
Also everything is blanked out on all 3 language links when I follow those.

Screenshot_20190310_171456.thumb.png.414adf760d4be2786792d0d529d4acf0.png

 

1 hour ago, dragan said:

Did you install one profile after another in the same directory?

No. They are all in separate directories, see the screenshot for the folder structure please.
The WWW folder is the devilbox root dir.
Each project is inside an htdocs dir.
They are kept separate, strictly separate I would assume, given the level of quality of devilbox.
So far never had an issue regarding that.

Screenshot_20190310_171301.png.6761f6f25e36e17f61a059f45824d66b.png

Hang on.
Inside the wiremultilang dir there is a .htaccess file and a htaccess.txt file.
Is that normal?
I checked them. They are identical.

Link to comment
Share on other sites

I still believe it's an .htaccess / server config issue. It's strange that on some sites you actually see /http404 in the URL. Or maybe mod_security: 

did you check your server error logs? And the PW logs? Turn debug mode on and install Tracy Debugger to maybe get more infos.

Link to comment
Share on other sites

I get 21 of these then the browser shows the error about the "The page isn’t redirecting properly".

172.16.238.1 - - [10/Mar/2019:20:33:28 +0100] "GET /en/about/ HTTP/2.0" 301 0 "https://wiremultilang.loc/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"

Gonna have a look at mod_security now.
Should I try and disable that in .htaccess?
Or is there a default .htaccess that I could use for the multi-language profile?

Link to comment
Share on other sites

Hi happywire,

7 minutes ago, happywire said:

Or is there a default .htaccess that I could use for the multi-language profile?

You should not have to change anything for multi-language-support on your system.

Did you follow the instructions here exactly? https://processwire.com/docs/multi-language-support/multi-language-urls/

Last but not least: Welcome to PW and the forum ? 

Link to comment
Share on other sites

Yeah. Happy greetings everyone. ?

Found out about PW just a couple days ago, by chance, read the docs and fell in love. ?

Can't wait to get work done with this once I have made myself familiar with the various profiles and learned the basics.
So far all profiles work, well, except the multi-language one, but with time I expect results here.
Fingers crossed.

Going to follow that link, turn debug on and get Tracy Debugger going.

Reporting back..

Link to comment
Share on other sites

41 minutes ago, bernhard said:

You could also try https://laragon.org/ instead of the devilbox. It's super easy and you would then know if the problem is the dev setup or something else.

Linux.

After using Windows for 2 decades I started using Linux start of this year.
Never looked back. Well I do and wonder why I have not started using it earlier.
Albeit I have a dual-boot setup with Windows 10 available I cannot abstain from all the tools I have right under my fingertips.
Given PW is so versatile, modular and powerful I am sure for what I plan to do with it devilbox will come in very handy.
No, don't get me wrong, I am not saying Windows is bad, I spent a long time with it.

Link to comment
Share on other sites

OK! ? Sorted! ?

By default devilbox uses PHP_SERVER=7.2, HTTPD_SERVER=nginx-stable and MYSQL_SERVER=mariadb-10.3 when you up the containers.
This is the config in the .env file.
https://devilbox.readthedocs.io/en/latest/getting-started/change-container-versions.html#change-web-server-version

But it seems ProcessWire does not like either of those (to be tested which one exactly).

One I changed the .env file to use
PHP 7.2
alongside
HTTPD_SERVER=apache-2.4
and
MYSQL_SERVER=mysql-5.7
it all works 100% out of the box.

Screenshot_20190310_223130.thumb.png.a8e110919e28991ff51cdf48e4d6adbc.png

Given devilbox has all the tools I need now and will need pretty soon and even more so ProcessWire is a real beauty, given it is so versatile, modular, lightweight and really just anything you want it to be I will be loving to work with it. In fact I would not even call that work, it will be tremendous fun.

Just have a look at all this.

https://github.com/dadish/skyscrapers-app

https://medium.com/icf-church-developers/processwire-vue-js-a-lovestory-d4d5bca365

https://github.com/dadish/ProcessGraphQL

And there is not even a need for a frontend framework, something these days pretty any dev jumps onto.
For smaller sites something like this is just super neat.

https://webdesign.tutsplus.com/tutorials/how-to-create-an-ajax-driven-theme-for-processwire--cms-26579

And for the simple things I have lined up GraphQL will/might not even be needed.

But given that fact you can just take ProcessWire in the backend, do anything you like with it and are then totally free in the frontend, well that is what I already really love about it.??

p.s.
Found a small typo on line 68 of the created config.php inside the /site/ dir.
It is variables and not varibles.

* Recommended. This enables API varibles like $pages to also be accessed as pages(),
  • Like 1
Link to comment
Share on other sites

Looking at your Devilbox config NGINX seems to be the problem. Or at least was the problem.

As far as I know it's not supported - but others are using it (with custom configs).

PHP 7.2 is working perfectly - at least from what I can tell.

Regarding MySQL I personally use the 5.6 version(s).

 

Oh... and regarding ProcessWire... it gets better and better the longer you use and play around with it. ?

  • Like 1
Link to comment
Share on other sites

On 3/10/2019 at 11:17 PM, wbmnfktr said:

As far as I know it's not supported - but others are using it (with custom configs).

Yeah, I see there is an NGINX thread about a config to use.
Though I see it is not definite and seems incomplete and/or not performant/good practice.
So I am keeping my hands off that for now.

Rather invest time in learning ProcessWire well than try to make it work with something that it does not come out of the box by default.
Given the use case for a client with a high-traffic site I am sure there will also be a solution to get it running with NGINX.
Who knows, perhaps Cytopia is willing to help.

I am making a documentation on how to get ProcessWire to work with devilbox, once I contributed that to devilbox I might have some leeway to ask Cytopia kindly to look into a well written NGINX config given I can find up to date and correct documentation from the ProcessWire dev team on what dirs and files exactly can be served and what should never be be seen on the outside.

Link to comment
Share on other sites

5 minutes ago, happywire said:

Rather invest time in learning ProcessWire well than try to make it work with something that it does not come out of the box by default.

Sounds like a good plan ? 

4 minutes ago, happywire said:

Given the use case for a client with a high-traffic site I am sure there will also be a solution to get it running with NGINX.

I guess you already read about https://processwire.com/store/pro-cache/ ? ? 

Quote

Using ApacheBench with the homepage of the Skyscrapers site profile, we completed 500 requests (10 concurrent) to the homepage. The amount of time occupied to complete each of these was as follows:

  • 29 seconds: no cache enabled
  • 6 seconds: built-in cache enabled
  • 0.017 seconds: ProCache enabled

 

Link to comment
Share on other sites

Does anyone know how I could edit the title of this thread to "SOLVED - Default Multi-language Install Not Working With Devilbox"?
If a mod or someone with enough permissions reads this, kindly edit the title like this, thank you.

  • Like 1
Link to comment
Share on other sites

3 minutes ago, bernhard said:

Sounds like a good plan ? 

I guess you already read about https://processwire.com/store/pro-cache/ ? ? 

 

Yes, a fellow agency showed me the huge performance gain, going to get an unlimited license pretty soon. ProCache rocks hard full stop.

Nevertheless running ProcessWire production ready with NGINX in a Docker container each with their own process ID where you just drop the site source into it and deploy is something I will also definitely try and get going. But that is left for another day.

  • Like 1
Link to comment
Share on other sites

14 hours ago, kongondo said:

You can do it by editing your first post :-).

That is the thing. I cannot see any button to edit the post. Only the share button.

Screenshot_20190313_230355.thumb.png.fbfb9d4e30523b69d8809e0929587d9d.png

I also tried to "like" other people's posts or give "thanks" but for that I also don't find clicking on the heart icon does not do anything.

Also when I am in my profile I cannot change or add any more info.
Now that is perhaps due to being on "Starter" status, not sure either.
One way or another I am under the impression that these features are only unlocked for users that have a "higher rank", not sure. is that so?

Link to comment
Share on other sites

14 hours ago, kongondo said:

You can do it by editing your first post :-).

Screenshot_20190313_231236.png.923f44a360705eb4816d97e9e2c24a38.png

This is what I see when I try to edit my profile.
Perhaps that is due to not having enough reputation?
Then I see other users that are brand new and have a profile picture for example.
So yeah, not sure what is going on.
Don't mind too much about the profile
But being able to edit the title so that other users can see that there is a solution to the thread and hence perhaps find the solution, that is what I am after.
Helping others find the right info.
Thx.

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

×
×
  • Create New...