Salta la navigazione

Questo thread è stato risolto. Ecco una descrizione del problema e della soluzione.

Problem:
The client is developing a site with WPML and needs to set Italian as the default language after initially creating content in English. They are concerned about potential issues with changing the default language in WPML and how to configure the site so that visitors who enter

https://mysite.com

are redirected to the Italian version of the site.
Solution:
We recommend setting Italian as the default language from the start and translating the theme from there. Theme strings will still be identified as English, but this will not affect the content. If the client has not yet created content, this is the best approach to avoid issues later on.
.

If this solution is not relevant due to being outdated or not applicable to the client's case, or if further assistance is needed, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that the latest versions of themes and plugins are installed. If the issue persists, the client should open a new support ticket: Contact WPML support.

Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.

La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.

Nessun supporter è disponibile a lavorare oggi sul forum Italian. Sentitevi liberi di creare ticket e li gestiremo il prima possibile quando saremo online. Grazie per la comprensione.

Etichettato: 

Questo ticket contiene 25 risposte, ha 2 voci.

Ultimo aggiornamento da Laura 1 mese, 2 settimane fa.

Assistito da: Laura.

Autore Messaggi
Marzo 5, 2024 a 9:11 am #15373203

dariod-33

We are developing a landing page that uses WPML to manage the various languages. The first two languages we will apply are Italian and English. For practical reasons we started producing the site in English because it is based on an English WordPress theme, but when we have translated the theme into Italian and publish the landing page, the default language MUST be Italian and from that moment on the contents will be developed first in Italian. IN the past we have had very bad experiences with WPML in changing the default language along the way. Your plug-in gets confused and becomes difficult to manage translations because it still sees the pages initially produced as English in the original language. I wanted to understand if the situation had changed and now it is possible to change the default language without too many problems, avoiding the asymmetries that once existed between "original" texts and translated texts.

Marzo 5, 2024 a 10:13 am #15373563

Laura
Supporter

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Hi,

thanks for contacting us.

Our procedure hasn't changed, and the original language of pages remain the one they're created in, no matter if you change the default language. This is a given because you can create unique content in each language, and automatically change language origin switch default language could create other issues.

If the default language must be Italian, I'd suggest setting directly Italian as default language and translate the theme - especially if you don't have content yet. Usually theme strings are still identified as being in English because it's the "default" language in IT.

Marzo 5, 2024 a 11:46 am #15374253

dariod-33

OK; in this case I would need to handle the matter in another way. I leave ENGLISH as the default language in terms of content creation, but I set the WPML Settings so that the directory is also applied to the default language, i.e.

link nascosto (English)
link nascosto (Italian)
link nascosto (Chinese)

then I have to figure out how to get everyone to write

link nascosto

ends up in

link nascosto

and not in the default language. And how they should be set up

WordPress Address (URL)
Site Address (URL)

What is the correct way for WPML ?

Marzo 5, 2024 a 12:17 pm #15374384

Laura
Supporter

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

HomeURL and SiteURL is still link nascosto, you don't need to change anything if you use directory for the default language.

If you choose this option, please remember to set up a root page or you might have issues.
Once you create the root, you should be able to set up a 301 redirect to link nascosto
You can see our documentation here https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/#setting-up-the-root-page

Let me know if you have other questions.

Marzo 5, 2024 a 1:43 pm #15374771

dariod-33

I've read, but there's something I don't understand. You're telling me to create a root page, which at this point can even be empty, since I'll redirect it to link nascosto, but what happens if someone clicks on a link like link nascosto? What I expect is that it would go to link nascosto. Is that correct? And what about internal links? If I write `<a href="/mypage">Pippo</a>` or if I select the MyPage in a WordPress menu, does it go to the Italian version? And if in the footer of an English page there's a link to the homepage, link nascosto, does it go to link nascosto?

The point is that:

1. If I go to link nascosto from a browser or an external link, I must go to link nascosto
2. If I go to link nascosto from a browser or an external link, I must go to link nascosto
3. If I go to link nascosto from an internal page in English, I must go to link nascosto
4. If I go to link nascosto from an internal page in English, I must go to link nascosto

Marzo 5, 2024 a 2:56 pm #15375172

dariod-33

Can you confirm to me that if I add this to .htaccess I do not need a root page or I can also create an empty one, but it would be useless?

# Custom redirection for language-specific directories
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^we.accompany.eu$ [NC]
RewriteCond %{REQUEST_URI} !^/(en|it|es|fr|de|zh)(/|$)
RewriteRule ^(.*)$ /it/$1 [L,R=301,QSA]
</IfModule>

Marzo 5, 2024 a 3:03 pm #15375198

Laura
Supporter

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

link nascosto will return 404, as any page you try to open without language directory (except root).

If internal link are hardcoded they're not translated automatically. If instead you use functions like

home_url

then yes you go to the current language with the directory added, so if English is the default it will return link nascosto

Points 1-2 can't be achived out of the box, as I said it will return 404 so you'll have to set redirections as appropriate
Poins 3-4 shouldn't even exist, unless you hardcode links, it's how WPML should work. It adds automatically the directory for the default language.

Please let me know if you have further questions.

Marzo 5, 2024 a 3:49 pm #15375372

Laura
Supporter

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

No I can't confirm you can avoid to create a root page. It's a requirement if you want to use directory per language. Make it empty but it must exists.

As for the rewrite rule code, custom coding is beyond what our support can do. Especially when it comes to rewrite rules which are a pretty sensitive subject.
I can tell you'd need to remove IT from

RewriteCond %{REQUEST_URI} !^/(en|it|es|fr|de|zh)(/|$)

because it will likely create a redirect loop but you should test the code first.

Marzo 5, 2024 a 4:14 pm #15375489

dariod-33

OK; I followed the instructions and even without changing the .htaccess it works. I sill keep ENGLISH as default language for a while. But now I have a SEVERE problem. I do not know what WPML is doing but it garbaged completely my site. If I edit the HOME page by BeBuilder the page is OK, but if I see the page or generate the preview, the page is garbaged. I suspect there is something wrong or missing in Settings' Custom Fields Translation.

This is really bad because the site is planned to be published on March 15th. The situation is critical. I suspect a side effect between Betheme and WPML, even if both of you guarantee perfect compatibility between theme and plug-in.

I must provide you with credential to check settings because the site is in stealth mode by UNDER CONSTRUCTION Plug-in. This is really urgent.

Marzo 5, 2024 a 4:15 pm #15375491

dariod-33

Ma lei parla anche in Italiano? È a Roma come me?????

Marzo 5, 2024 a 4:36 pm #15375647

dariod-33

I moved back to no directory for default page and restored HOME as home page, but now I have the HOME page ONLY in English. Even if stribg translations in Italian are still available. My Italian Home Page is disappeared!

Marzo 5, 2024 a 4:50 pm #15375772

Laura
Supporter

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Sì questo è il forum italiano quindi parliamo anche italiano.

In che senso le stringhe in String Translation sono ancora disponibili? I contenuti del page builder NON vanno MAI tradotti in String Translation.

Quanto a BeTheme, al momento abbiamo 2 bug aperti
https://wpml.org/errata/betheme-bebuilder-content-not-available-in-translation-editor/
https://wpml.org/errata/betheme-global-header-footer-translation-not-displaying-on-secondary-language/
e c'è da fare questa procedura per assicurare la compatibilità con Muffin Builder https://wpml.org/documentation/theme-compatibility/create-multilingual-wordpress-websites-using-betheme-and-wpml/#ensuring-compatibility-with-muffin-builder

Marzo 5, 2024 a 5:22 pm #15375871

dariod-33

OK, meglio in italiano, così mi è più facile spiegare. Intanto, per quanto riguarda la questione della serializzazione della memoria di BeTheme, è la prima cosa che ho fatto un paio di settimane fa quando ho installato il tema e il WPML. Finora ha sempre funzionato tutto bene e la pagina HOME era regolarmente tradotta. Ho avuto anche io il problema con il FOOTER ma è bastato rendere traducibile il nome e impostarto nel BeBuilder nelle opzioni della pagina in italiano.

Il problema grosso è avvenuto oggi pomeriggio. Per qualche motivo, nella versione italiana, i titoli che corrispondevano ad <h2 class="title">, ovvero di fatto tutti i titoli degli elementi di BeBuilder, non ereditavano il colore, per cui in inglese erano bianchi e in italiano neri. Ho modificato un setting nella pagina dei Settings Custom Field Translation ed è successo un casino.

In pratica, se entro in edit nella pagina HOME vedo tutto perfetto, ma quando la visualizzo ci sono un sacco di cose che non funzionano: si tratta chiaramente di un problema di CSS (sfondi che non si vedono, colori e font sbagliati). Sia in inglese che in italiano.

È una cosa che è facile da capire solo se uno entra nel sito. Serve che un vostro sviluppatore a cui darò delle credenziali entri nel sito e vada nella pagina Home. Servono le credenziali perché se no il sito non è visibile.

Bisogna andare sulla pagina UNDER CONSTRUCTION; cliccare in basso a destra sulla W di WordPress e immettere le credenziali. Se mi date un indirizzo di posta vi posso creare una utenza. Deve essere ADMIN o basta EDITOR?

È veramente urgente perché mi è saltato il lavoro di diverse settimane e stavamo per pubblicare il sito.

Sono a disposizione del vostro sviluppatore se gli/le servono istruzioni per muoversi nel sito. Per sicurezza ho fatto una copia di backup della pagina HOME, ma credo che tutto si possa risolvere risistemando i settings sui custom field. Purtroppo non è chiaro cosa sono e come impostarli. Sul vostro sito non ho trovato info a riguardo. Posso chiaramente comunicare sia in italiano che in inglese.

È molto importante: ci siamo assicurati dopo una lunga analisi di temi e plugin quale fosse la coppia più compatibile, ovvero BeThem e WPML, e adesso non posso dire che non funziona nulla per un effetto collaterale. Grazie.

Marzo 5, 2024 a 5:22 pm #15375874

dariod-33

PS Ma questo forum è pubblico? Sarebbe opportuno che questa thread non sia visibile a TUTTI!

Marzo 5, 2024 a 5:41 pm #15375978

Laura
Supporter

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Sì, il thread è pubblico ma i link non sono visibili. Quando apri un ticket c'è l'opzione per rendere il ticket privato.

Qual è l'impostazione che è stata modificata? Nei temi che sono già compatibili non c'è bisogno di modificare nulla quindi può darsi che sia stata questa modifica a causare il problema.

Puoi usare una mail fake per l'account, ma deve essere di amministrazione.
Ti abilito una risposta privata per le credenziali

dariod-33 ha confermato che il problema è stato risolto su 2024-03-07 09:07:31.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.