Home › Forum › Plugin e temi di WP › Cambio Lingua
-
AutorePost
-
-
5 Novembre 2006 alle 18:09 #2473tegolinoPartecipante
Scusate, se volessi fare il mio blog in 2 lingue (italiano e inglese), esiste un plugin o qualcos’altro che mi fa in modo automatico la versione inglese?
-
5 Novembre 2006 alle 20:08 #41210SteveAglAmministratore del forum
Una ricerchina sul forun ti darà le risposte che cerchi l’argomento è stato affrontato molte volte.
-
5 Novembre 2006 alle 21:43 #41214tegolinoPartecipante
ho cercato e scaricato polyglot, ma è molto complesso, una volta installato nn capisco come andare avanti!!! non c’è qualcosa di più semplice?
grazie
-
7 Novembre 2006 alle 10:09 #41250cescoPartecipante
Probabilmente ti conviene scrivere qualcosa di tuo per farlo. Io mi sono scritto per conto mio un plug-in molto semplice in pochissimo tempo.
In pratica nei post racchiudo le varie traduzioni fra i tag [IT] e [/IT] per quello che voglio appaia quando seleziono la lingua italiana, [EN] e [/EN] per la lingua inglese, e cosଠvia per le altre lingue.
Ad esempio se voglio scrivere un post multilingua scrivo:
[IT]Ciao questa è una prova[/IT][EN]Hi this is a test[/EN]
e a seconda della lingua in cui decido di visualizzare il sito (decisa da una variabile passata tramite GET) visualizzo la scritta in Italiano o in Inglese. Quando invece ho bisogno di inserire una frase in più lingue nella template della pagina, richiamo la funzione “Multilingua” con le varie traduzioni per parametro. Ad esempio:
<?php echo Multilingua(“Buongiorno”, “Good Morning”, “Bonjour”); ?>
Vista la semplicità del plug-in, che si limita a sostituire il testo compreso nei tag ci ho messo meno di un’ora a scriverlo. Ci saranno sicuramente metodi più eleganti, ma a me serviva la praticità e credo di averla trovata.
-
7 Novembre 2006 alle 10:13 #41251
-
7 Novembre 2006 alle 10:54 #41254FreeplePartecipante
Ciao Casco!
Complimenti per il Plug-In!
Una domanda: come fa l’utente a scegliere la lingua?
Grazie, Ciao!
-
7 Novembre 2006 alle 14:58 #41268cescoPartecipante
E’ molto semplice, immagina di dover aggiungere il supporto multilingua al sito “www.pippo.com” e di utilizzare un tema / template grafico denominato “il_tema_di_pippo”.
Nella cartella contenente il tema (wp-content/themes/il_tema_di_pippo) basta inserire un file denominato “home.php”, in cui metteremo la classica selezione della lingua… qualche bandierina colorata e ad esempio un paio di link per aprire il sito in Italiano e Inglese.
Non appena WordPress si accorgerà dell’esistenza di home.php, lo visualizzerà sempre e comunque come pagina di apertura del nostro sito. Ovvero, ogni volta in cui in un browser aprirò il sito “www.pippo.com”, automaticamente mi apparirà la pagina web contenuta in home.php *PRIMA* di visualizzare il nostro blog wordpress vero e proprio.
Ma torniamo al funzionamento: il plug-in per poter lavorare ha bisogno di sapere in quale lingua deve visualizzare i post. Per passargli la lingua utilizziamo una variabile denominata “l” attraverso il metodo GET. Che in soldoni significa che se per aprire il mio sito internet in genere scrivo:
In questo caso dovrò aggiungere la variabile “l” all’indirizzo del mio sito. L’indirizzo da richiamare cosଠdiventerà :
Che in questo caso aprirà il sito http://www.pippo.com e gli passerà la variabile “l” con valore “it”.
Capisci bene che a questo punto per aprire il sito in Italiano e Inglese basta inserire i due link cosà¬:
(che visualizzerà il sito in Italiano)
(che visualizzerà il sito in Inglese)
-
7 Novembre 2006 alle 17:29 #41274FreeplePartecipante
Cao cesco!
Sei stato chiarissimo, grazie!!!
-
20 Febbraio 2011 alle 14:10 #81537ZaRBoR2Partecipante
il plugin non è + disponibili potresti ricaricarlo pls?
-
21 Febbraio 2011 alle 13:16 #81551ZaRBoR2Partecipante
Ho risolto con qTranslate grazie lo stesso
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.