Jump to content
happywire

[SOLVED] Default Multi-language Install Not Working

Recommended Posts

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.

Share this post


Link to post
Share on other sites

I am seeing this when I log into the Admin Panel.
Is there something in the Docs about how to solve this?

Screenshot_20190310_152403.png

Share this post


Link to post
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

Share this post


Link to post
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(''));

 

Share this post


Link to post
Share on other sites
1 hour ago, dragan said:

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

Yes, they are 🙂 @Autofahrn this might also be a hint for you 😉 

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, bernhard said:

@Autofahrn this might also be a hint for you

sure, but after editing the first, the warning went away... 😉

  • Like 1

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Since the video format is not supported and I cannot edit the above post here is the short video of what I did according to the replies.
 

https://ufile.io/zb9gq

 

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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 😉 

Share this post


Link to post
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..

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
22 hours ago, happywire said:

Does anyone know how I could edit the title of this thread to

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

Share this post


Link to post
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?

Share this post


Link to post
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.

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.

  • Similar Content

    • By usualCommission
      Hey everyone,
      I'm pretty experienced with pagination and haven't seen this before. I have my pages pulled using $pages->find, which is working fine however using renderPager() generates pagination where the links do not work. Here are some details.
      All templates needing pagination have pagination enabled in the admin. URL Segments are not enabled. Clicking on the "Next" or numbered links merely reloads the current page. The link href values are properly being output with the urls being /page2, /page3, /page4, etc. Manually entering the paginated urls has the same effect of reloading the current page with no new content. Pages are being returned from the ->find function properly and with the proper limit. A few other details:
      ProcessWire v3.0.98 Multi-language is enabled, 2 languages implemented. Pagination does not work on either language Have very few modules installed (few enough to list), none of which I could see interfering: ProFields, ProDrafts, ListerPro, DB Backups, Cronjob DB Backup, Upgrades, Upgrade Checker, Force Password Change, Markup Sitemap XML I'm stumped. For the sake of being overly-thorough, here's the code:
      <?php $articleTemplates = [ 'template_news_article', 'template_news_video', 'template_news_press_release' ]; $searchParams = [ 'template=' . implode('|', $articleTemplates), 'sort=-published', 'limit=' . $pages->get('template=template_news')->list_count ]; $articles = $pages->find(implode(',', $searchParams)); echo $articles->renderPager(); ?>  
    • By swampmusic
      Trying to figure out work flow for translators on a new website and have hit a brick wall.
      Site was launched in Spanish, now the translators want to add in other languages.
      I presumed that when you tick the "active" language checkbox on settings for the home page, then the new language would not appear on the public facing website, but translators would be able to work with the pages in the admin and view their work.
      Finally, once all translation had been completed, we could activate the language from the home page.
      I have searched thru the forums and found older articles from 2015 here.
      https://processwire.com/talk/topic/11100-disable-a-language-on-a-multilanguage-site/ https://processwire.com/talk/topic/10467-allow-translators-to-work-on-hidden-language/ This seems a really messy hack, or did i miss something ?
      Does anyone know if there has been an update within Processwire since 2015  to make this better/easier, or other articles explaining how to achieve it ?
      We were looking for a solution that the client can use from within Admin. Not via .htaccess or similar that would require tech skills.
      Many thanks for reading 🙂
       
    • By Sanyaissues
      Update: The render behavior of the profile is correct. My mistake was to use TextLanguage in the fields  when i just need the user to see labels according of his language (that can be achieved with the text field type).
      Hi,
      I'm using LoginRegister to allow users to edit their users profiles in the front-end, and some of the user fields are type TextLanguage (to allow multiple languages).
      The problem is that when I render the Profile Edit, the inputfields shows in all the installed languages. That doesn't happen when I render the login or register forms.
      How can i prevent that the TextLanguage inputfields render in both languages?
      My code
      <?php $user->language = $languages->get("default"); $input->get->profile = 1; $profileForm = $modules->get('LoginRegister')->set('renderStyles', false)->execute(); ?> and later... <?= $profileForm ?> The output for an multilanguage inputfield:
      <div class="InputfieldContent "> <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname" data-language="1029"> <label for="Inputfield_profile_firstname" class="LanguageSupportLabel detail">English</label> <input id="Inputfield_profile_firstname" class="InputfieldMaxWidth" name="profile_firstname" type="text" maxlength="2048"> </div> <div class="LanguageSupport" id="langTab_Inputfield_profile_firstname__1031" data-language="1031"> <label for="Inputfield_profile_firstname__1031" class="LanguageSupportLabel detail">Spanish</label> <input id="Inputfield_profile_firstname__1031" class="InputfieldMaxWidth" name="profile_firstname__1031" type="text" maxlength="2048"> </div> </div>  
    • By yinken
      Hi everyone,
      I am using ProcessWire to run a multi-site environment using the Multisite module by Soma.
      It's working great with one small caveat. It always defaults to the English version of the site. So when you access the base url (somedomain.com) it always redirects to somedomain.com/en/. In my particular case I need it to go to the Germany version somedomain.com/de/.
      Some things I've tried:
      I've tried fiddling around with the AutoDetectLanguage module to have a user redirected based on the detected browser language - didn't work. I've also tried messing with a module that changes what the default homepage is (smth like DefaultHomepage I believe), but that also had no affect. I used the Redirect module to have the root ('/') redirected to specific language URL ('/de/) - also didn't work My guess is that it has something to do with the default language in the setup which is set to english, but I am not sure.
      Has anyone else come accross this issue?
      Thanks in advance.
    • By Gideon So
      Hi,
      I have a website with multi-languages support and a frontend form for course registration. If a user choose English which is not the default language, the page title only save to the English tab of the page title.
      How can I save the page title to the default language through API??
      Gideon
×
×
  • Create New...