Home › Forum › Problemi Vari con WP › Conversione multilingua wordpress data
-
AutorePost
-
-
23 Dicembre 2011 alle 15:27 #20147pettedemonPartecipante
Ciao a tutti,
nel mio tema ho installato wpml, e sto convertendo tutte le stringhe nel file .po. Funziona tutto perfettamente a parte la conversione delle date,
io ho questo di default
<?php printf(__(get_the_time('F jS, Y','gpp_i18n'))); ?>
ma non riesco a far recuperare la stringa dai sorgenti con il programma poedit… ho provato a cambiarla ma non la rileva, rileva invece qualsiasi minima modifica a tutte le altre stringhe…
Booooh.
-
23 Dicembre 2011 alle 15:36 #91093SteveAglAmministratore del forum
Dovrebbe essere cosà¬:
<?php printf(get_the_time(__(‘F jS, Y’,’gpp_i18n’))); ?>
Poi perchè usare una printf invece di un banale echo?
-
23 Dicembre 2011 alle 16:00 #91095pettedemonPartecipante
ciao,
anche se lo scrivo per assurdo cosà¬
<? echo _e((get_the_time('F F j Y','gpp_i18n'))); ?>
non me lo rileva
-
23 Dicembre 2011 alle 16:01 #91096pettedemonPartecipante
Se inserisco qualsiasi altra stringa me la rileva, ma get_the_time() no…
-
23 Dicembre 2011 alle 16:05 #91097pettedemonPartecipante
SE la scrivo come mi hai suggerito
<?php printf(get_the_time(__(‘F jS, Y’,’gpp_i18n’))); ?>
tu mi rileva solo il parametro anno al momento della stampa dell’articolo
-
23 Dicembre 2011 alle 16:09 #91099pettedemonPartecipante
Per la serie, traduce i mesi in italiano, ma nel momento in cui sono sulla lingua default italiano dovrebbe visualizzare la data nell’ordine italiano e non mantenere l’ordine in inglese
-
23 Dicembre 2011 alle 16:16 #91100pettedemonPartecipante
Non so se la soluzione esatta ma usando semplicemente
<? echo get_the_date(); ?>
fa la traduzione automatica se passo tra le varie lingue
Scusate è sbagliato quello che ho scritto, le traduce ma non cambia le posizioni delle cifre….
-
23 Dicembre 2011 alle 16:33 #91101SteveAglAmministratore del forum
No se3 non c’è la funzione __ non la troverai nel po, se c’è e leggi le stringhe troverai F jS, Y da localizzare come preferisci… la combinazione di caratteri F jS, Y è quella del comando date di PHP http://it.php.net/manual/en/function.date.php
Ma la domanda è… chi cavolo ha scritto quella riga di codice nel tema? Perchè è sbagliata di suo
-
23 Dicembre 2011 alle 18:01 #91106pettedemonPartecipante
l’ho trovata in un tema di graphpap…
cmq ho trovato finalmente la soluzione
<?php printf(get_the_time(__('F jS, Y','gpp_i18n'))); ?>
-
23 Dicembre 2011 alle 18:17 #91110SteveAglAmministratore del forum
No scusa ed io cosa avevo scritto come codice alla mia prima risposta? mah!
-
23 Dicembre 2011 alle 20:27 #91115pettedemonPartecipante
Non funzionava… poi ho svuotato la cache e riavviato il browser, ho fatto di tutto e adesso mi son reso conto che avevo già la soluzione perchè me l’avevi data tu!!!!
Ti ringrazio e mi scuso!
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.