Support » Plugin: OMGF | Host Google Fonts Locally » OMGF on a multilingual site with different domains (WPML)

  • Hello, I tried setting up OMGF on a multilingual WordPress site with two domains, which has a .de domain name for the main language (German) and .com for the secondary language (English).

    It seems to work fine at first, however only for the main language, while all pages from secondary language/domain are shown in the browsers default font.

    How can I fix this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    How do you have the multilingual site setup? With Multisite, or a plugin like WPML?

    Thread Starter w-sky

    (@w-sky)

    Hello @daanvandenbergh

    Yes I forgot to mention: We are using WPML with seperate domain setting.
    Main language German is https://co2-pos.de/ and second language English is https://co2-pos.com/

    OMGF is active now and you can observe on our site: .de is alright, Google font used but not loaded from Google. .com will be either shown with a default font, or will be shown with the Google Font but loaded from Google. So OMGF is not fully working on the second domain.

    (EDIT: I have noticed that the behavior can be different if using Firefox or a Chrome based browser and reloading the page several times.)

    Thread Starter w-sky

    (@w-sky)

    Now it’s too late to edit my text above again. But I realized that I was wrong on one point: No Google Font is now displayed on the second domain, regardless of which browser or how often you reload. The fact that I could sometimes still see the Google Font beforehand was because it was still in the cache.

    Now how can I get OMGF working on our WPML multilingual site with different domains? By looking at sources on co2-pos.com with browser inspector, I can see that a font from co2-pos.de is loaded but still the page displays with a default font.

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi!

    OMGF isn’t compatible in that manner with WPML. At this point, it can’t distinguish between different domains when WPML is used.

    What you could do, however, is: setup your server’s CORS configuration to allow requests from one domain to the other. In other words: co2-pos.com should be able to make requests from co2-pos.de.

    Ideally OMGF should be able to write a separate stylesheet for each of the domains configured in WPML, but that’s in a work in progress at this point. Reconfiguring your server’s CORS related settings should resolve the issues you’re having.

    Thread Starter w-sky

    (@w-sky)

    Hello Daan, thanks for checking this out. I am using a managed server and can’t see anything about CORS in the server settings which are accessible to me, however I can ask the support if it’s possible to edit the CORS configuration.

    I can set the root folder for the second domain (which is: same root folder for both domains). I do have access to the allow_url_fopen and allow_url_include settings, will that help?

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hmmm, CORS is configered at server level, when running on Apache it would be in your apache2.conf file. Running Nginx it’d be in a server block somewhere in your /etc/nginx directory.

    In short, yes, I think you should contact support to ask if they can enable it for you 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘OMGF on a multilingual site with different domains (WPML)’ is closed to new replies.