Home » Blog » Come aggiungere una nuova lingua al sito WordPress senza plugin

Come aggiungere una nuova lingua al sito WordPress senza plugin

Vi é mai capitato di pensare a come risolvere un problema o migliorare il vostro sito Worpress senza ricorrere all’installazione di nuovi plugin? La soluzione c’é ed é anche molto semplice per quanto riguarda un sito WordPress multilingua.

Innanzitutto bisogna fare una ricerca dei vari codici linguistici. Li trovate nelle tabelle qui sotto

ISO 639-1 Language Codes

ISO 639-1 defines abbreviations for languages:

https://www.w3schools.com/tags/ref_language_codes.asp

LanguageISO Code
Abkhazianab
Afaraa
Afrikaansaf
Akanak
Albaniansq
Amharicam
Arabicar
Aragonesean
Armenianhy
Assameseas
Avaricav
Avestanae
Aymaraay
Azerbaijaniaz
Bambarabm
Bashkirba
Basqueeu
Belarusianbe
Bengali (Bangla)bn
Biharibh
Bislamabi
Bosnianbs
Bretonbr
Bulgarianbg
Burmesemy
Catalanca
Chamorroch
Chechence
Chichewa, Chewa, Nyanjany
Chinesezh
Chinese (Simplified)zh-Hans
Chinese (Traditional)zh-Hant
Chuvashcv
Cornishkw
Corsicanco
Creecr
Croatianhr
Czechcs
Danishda
Divehi, Dhivehi, Maldiviandv
Dutchnl
Dzongkhadz
Englishen
Esperantoeo
Estonianet
Eweee
Faroesefo
Fijianfj
Finnishfi
Frenchfr
Fula, Fulah, Pulaar, Pularff
Galiciangl
Gaelic (Scottish)gd
Gaelic (Manx)gv
Georgianka
Germande
Greekel
Greenlandickl
Guaranign
Gujaratigu
Haitian Creoleht
Hausaha
Hebrewhe
Hererohz
Hindihi
Hiri Motuho
Hungarianhu
Icelandicis
Idoio
Igboig
Indonesianid, in
Interlinguaia
Interlingueie
Inuktitutiu
Inupiakik
Irishga
Italianit
Japaneseja
Javanesejv
Kalaallisut, Greenlandickl
Kannadakn
Kanurikr
Kashmiriks
Kazakhkk
Khmerkm
Kikuyuki
Kinyarwanda (Rwanda)rw
Kirundirn
Kyrgyzky
Komikv
Kongokg
Koreanko
Kurdishku
Kwanyamakj
Laolo
Latinla
Latvian (Lettish)lv
Limburgish ( Limburger)li
Lingalaln
Lithuanianlt
Luga-Katangalu
Luganda, Gandalg
Luxembourgishlb
Manxgv
Macedonianmk
Malagasymg
Malayms
Malayalamml
Maltesemt
Maorimi
Marathimr
Marshallesemh
Moldavianmo
Mongolianmn
Nauruna
Navajonv
Ndongang
Northern Ndebelend
Nepaline
Norwegianno
Norwegian bokmålnb
Norwegian nynorsknn
Nuosuii
Occitanoc
Ojibweoj
Old Church Slavonic, Old Bulgariancu
Oriyaor
Oromo (Afaan Oromo)om
Ossetianos
Pālipi
Pashto, Pushtops
Persian (Farsi)fa
Polishpl
Portuguesept
Punjabi (Eastern)pa
Quechuaqu
Romanshrm
Romanianro
Russianru
Samise
Samoansm
Sangosg
Sanskritsa
Serbiansr
Serbo-Croatiansh
Sesothost
Setswanatn
Shonasn
Sichuan Yiii
Sindhisd
Sinhalesesi
Siswatiss
Slovaksk
Sloveniansl
Somaliso
Southern Ndebelenr
Spanishes
Sundanesesu
Swahili (Kiswahili)sw
Swatiss
Swedishsv
Tagalogtl
Tahitianty
Tajiktg
Tamilta
Tatartt
Telugute
Thaith
Tibetanbo
Tigrinyati
Tongato
Tsongats
Turkishtr
Turkmentk
Twitw
Uyghurug
Ukrainianuk
Urduur
Uzbekuz
Vendave
Vietnamesevi
Volapükvo
Wallonwa
Welshcy
Wolofwo
Western Frisianfy
Xhosaxh
Yiddishyi, ji
Yorubayo
Zhuang, Chuangza
Zuluzu

ISO Country Codes

https://www.w3schools.com/tags/ref_country_codes.asp

CountryISO Code
AFGHANISTANAF
ALBANIAAL
ALGERIADZ
AMERICAN SAMOAAS
ANDORRAAD
ANGOLAAO
ANTARCTICAAQ
ANTIGUA AND BARBUDAAG
ARGENTINAAR
ARMENIAAM
ARUBAAW
AUSTRALIAAU
AUSTRIAAT
AZERBAIJANAZ
BAHAMASBS
BAHRAINBH
BANGLADESHBD
BARBADOSBB
BELARUSBY
BELGIUMBE
BELIZEBZ
BENINBJ
BERMUDABM
BHUTANBT
BOLIVIABO
BOSNIA AND HERZEGOVINABA
BOTSWANABW
BOUVET ISLANDBV
BRAZILBR
BRITISH INDIAN OCEAN TERRITORYIO
BRUNEI DARUSSALAMBN
BULGARIABG
BURKINA FASOBF
BURUNDIBI
CAMBODIAKH
CAMEROONCM
CANADACA
CAPE VERDECV
CAYMAN ISLANDSKY
CENTRAL AFRICAN REPUBLICCF
CHADTD
CHILECL
CHINACN
CHRISTMAS ISLANDCX
COCOS (KEELING) ISLANDSCC
COLOMBIACO
COMOROSKM
CONGOCG
CONGO, THE DEMOCRATIC REPUBLIC OF THECD
COOK ISLANDSCK
COSTA RICACR
CÔTE D’IVOIRECI
CROATIAHR
CUBACU
CYPRUSCY
CZECH REPUBLICCZ
DENMARKDK
DJIBOUTIDJ
DOMINICADM
DOMINICAN REPUBLICDO
ECUADOREC
EGYPTEG
EL SALVADORSV
EQUATORIAL GUINEAGQ
ERITREAER
ESTONIAEE
ETHIOPIAET
FALKLAND ISLANDS (MALVINAS)FK
FAROE ISLANDSFO
FIJIFJ
FINLANDFI
FRANCEFR
FRENCH GUIANAGF
FRENCH POLYNESIAPF
FRENCH SOUTHERN TERRITORIESTF
GABONGA
GAMBIAGM
GEORGIAGE
GERMANYDE
GHANAGH
GIBRALTARGI
GREECEGR
GREENLANDGL
GRENADAGD
GUADELOUPEGP
GUAMGU
GUATEMALAGT
GUINEAGN
GUINEA-BISSAUGW
GUYANAGY
HAITIHT
HEARD ISLAND AND MCDONALD ISLANDSHM
HONDURASHN
HONG KONGHK
HUNGARYHU
ICELANDIS
INDIAIN
INDONESIAID
IRAN, ISLAMIC REPUBLIC OFIR
IRAQIQ
IRELANDIE
ISRAELIL
ITALYIT
JAMAICAJM
JAPANJP
JORDANJO
KAZAKHSTANKZ
KENYAKE
KIRIBATIKI
KOREA, DEMOCRATIC PEOPLE’S REPUBLIC OFKP
KOREA, REPUBLIC OFKR
KUWAITKW
KYRGYZSTANKG
LAO PEOPLE’S DEMOCRATIC REPUBLIC (LAOS)LA
LATVIALV
LEBANONLB
LESOTHOLS
LIBERIALR
LIBYAN ARAB JAMAHIRIYALY
LIECHTENSTEINLI
LITHUANIALT
LUXEMBOURGLU
MACAOMO
MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OFMK
MADAGASCARMG
MALAWIMW
MALAYSIAMY
MALDIVESMV
MALIML
MALTAMT
MARSHALL ISLANDSMH
MARTINIQUEMQ
MAURITANIAMR
MAURITIUSMU
MAYOTTEYT
MEXICOMX
MICRONESIA, FEDERATED STATES OFFM
MOLDOVA, REPUBLIC OFMD
MONACOMC
MONGOLIAMN
MONTENEGROME
MONTSERRATMS
MOROCCOMA
MOZAMBIQUEMZ
MYANMARMM
NAMIBIANA
NAURUNR
NEPALNP
NETHERLANDSNL
NETHERLANDS ANTILLESAN
NEW CALEDONIANC
NEW ZEALANDNZ
NICARAGUANI
NIGERNE
NIGERIANG
NIUENU
NORFOLK ISLANDNF
NORTHERN MARIANA ISLANDSMP
NORWAYNO
OMANOM
PAKISTANPK
PALAUPW
PALESTINIAN TERRITORY, OCCUPIEDPS
PANAMAPA
PAPUA NEW GUINEAPG
PARAGUAYPY
PERUPE
PHILIPPINESPH
PITCAIRNPN
POLANDPL
PORTUGALPT
PUERTO RICOPR
QATARQA
RÉUNIONRE
ROMANIARO
RUSSIAN FEDERATIONRU
RWANDARW
SAINT HELENASH
SAINT KITTS AND NEVISKN
SAINT LUCIALC
SAINT PIERRE AND MIQUELONPM
SAINT VINCENT AND THE GRENADINESVC
SAMOAWS
SAN MARINOSM
SAO TOME AND PRINCIPEST
SAUDI ARABIASA
SENEGALSN
SERBIARS
SEYCHELLESSC
SIERRA LEONESL
SINGAPORESG
SLOVAKIASK
SLOVENIASI
SOLOMON ISLANDSSB
SOMALIASO
SOUTH AFRICAZA
SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDSGS
SPAINES
SRI LANKALK
SUDANSD
SURINAMESR
SVALBARD AND JAN MAYENSJ
SWAZILANDSZ
SWEDENSE
SWITZERLANDCH
SYRIAN ARAB REPUBLICSY
TAIWANTW
TAJIKISTANTJ
TANZANIA, UNITED REPUBLIC OFTZ
THAILANDTH
TIMOR-LESTETL
TOGOTG
TOKELAUTK
TONGATO
TRINIDAD AND TOBAGOTT
TUNISIATN
TURKEYTR
TURKMENISTANTM
TURKS AND CAICOS ISLANDSTC
TUVALUTV
UGANDAUG
UKRAINEUA
UNITED ARAB EMIRATESAE
UNITED KINGDOMGB
UNITED STATESUS
UNITED STATES MINOR OUTLYING ISLANDSUM
URUGUAYUY
UZBEKISTANUZ
VANUATUVU
VENEZUELAVE
VIET NAMVN
VIRGIN ISLANDS, BRITISHVG
VIRGIN ISLANDS, U.S.VI
WALLIS AND FUTUNAWF
WESTERN SAHARAEH
YEMENYE
ZAMBIAZM
ZIMBABWEZW

Step 1. Aggiornare il linguaggio come nell’esempio qui sotto

<html lang=”en_GB”>

</html>

Step 2. Utilizzare hreflang tag sia nella pagina originale e sia nella pagina tradotta

<link rel="alternate" hreflang="it" href="https://example.com/ciao" />
<link rel="alternate" hreflang="en" href="https://example.com/hello" />

Step 3. Cambiare il file header per ogni lingua e scegliere il template nella lingua scelta dall barra laterale.

Lascia un commento