Tag content with international language codes - GOV.UK

文章推薦指數: 80 %
投票人數:10人

Use the World Wide Web Consortium (W3C) guidance to: show you how to annotate language on the web, for both HTML and XML formats; declare the ... Skiptomaincontent CookiesonGOV.UK Weusesomeessentialcookiestomakethiswebsitework. We’dliketosetadditionalcookiestounderstandhowyouuseGOV.UK,rememberyoursettingsandimprovegovernmentservices. Wealsousecookiessetbyothersitestohelpusdelivercontentfromtheirservices. Acceptadditionalcookies Rejectadditionalcookies Viewcookies Youcanchangeyourcookiesettingsatanytime. Hidethismessage Coronavirus(COVID-19) Latestupdatesandguidance Home Government Governmentefficiency,transparencyandaccountability Openstandardsforgovernment CabinetOffice CentralDigital&DataOffice Contents 1.Summaryofthestandard’suseforgovernment 2.Howthisstandardmeetsuserneeds 3.Howtousethestandard Printthispage ©Crowncopyright2020 ThispublicationislicensedunderthetermsoftheOpenGovernmentLicencev3.0exceptwhereotherwisestated.Toviewthislicence,visitnationalarchives.gov.uk/doc/open-government-licence/version/3orwritetotheInformationPolicyTeam,TheNationalArchives,Kew,LondonTW94DU,oremail:[email protected]. Wherewehaveidentifiedanythirdpartycopyrightinformationyouwillneedtoobtainpermissionfromthecopyrightholdersconcerned. Thispublicationisavailableathttps://www.gov.uk/government/publications/open-standards-for-government/language-tags UsetheISO639-1:2002languagecodesstandardtoaddconsistent,internationallyrecognisedlanguagecodestoyourdata. 1.Summaryofthestandard’suseforgovernment TheISO639-1standarduses2lettercodestorepresentthenamesofmorethan500internationallyrecognisedlanguages.Itdoesnotrepresentlanguagesthatareexclusivelyformachines.Usethisstandardtomakesureyoureferencelanguagesinaconsistentwayacrossyourdatasets. ThegovernmentchoosesstandardsusingtheopenstandardsapprovalprocessandtheOpenStandardsBoardhasfinalapproval.Readmoreabouttheprocessforlanguagecodes. 2.Howthisstandardmeetsuserneeds Usethisstandardforconsistentlanguagetagging.Forexample,whenusingcross-platformcharacterencodingtomakesuredifferentsystemscorrectlyidentifylanguages. Whensystemscanconsistentlyidentifywhichlanguagesyou’veuseditcanhelpuserswho: wanttotradewithUKbusinesses plantotraveltotheUKfromabroad liveintheUKbutdonotspeakEnglish ThegovernmentalsohasalegalrequirementtotranslateinformationintoWelsh.Thisstandardprovidesaconsistentwayoftaggingthisinformationsoit’seasiertofind. Usingthisstandardmeans: userscanfindinformationinthelanguagetheyneed servicesandcontenthaveconsistentlanguagetags screenreaderscanidentifywhichlanguagethecontentisin 3.Howtousethestandard Whenyou’republishingcontentinmultiplelanguagesyoumustusethisstandard’s2lettercodesinthetagsormetadata. YoumustuselanguagetagsintherelevantHTMLandXMLdocumentmetadata. Thisstandardsdoesnotcover: standardmethodsforattachinglanguagetagstootherformats,suchasJSON methodsofpresentingauserwithtext,inparticular,HTTPlanguagenegotiationortheURLsuffixschemecurrentlyusedbyGOV.UK UsetheWorldWideWebConsortium(W3C)guidanceto: showyouhowtoannotatelanguageontheweb,forbothHTMLandXMLformats declarethelanguageofawebpageoraportionofawebpageusingHTMLlangattribute declarethelanguageofabodyoftextusingthe‘xml:lang’attribute Youcanalsogetalistof: 2and3letterlanguagetagsontheInternetAssignedNumbersAuthority(IANA)website extendedlanguagetagswithscriptsubtagsinRFC5646,ifyouneedtoaddinformationtothelanguagetag tagsandtheircountrynamesontheUSlibraryofcongresswebsite Contents Printthispage Isthispageuseful? Maybe Yesthispageisuseful Nothispageisnotuseful Thankyouforyourfeedback Reportaproblemwiththispage Close HelpusimproveGOV.UK Don’tincludepersonalorfinancialinformationlikeyourNationalInsurancenumberorcreditcarddetails. Whatwereyoudoing? Whatwentwrong? Send Close HelpusimproveGOV.UK TohelpusimproveGOV.UK,we’dliketoknowmoreaboutyourvisittoday.We’llsendyoualinktoafeedbackform.Itwilltakeonly2minutestofillin.Don’tworrywewon’tsendyouspamorshareyouremailaddresswithanyone. Emailaddress Sendmethesurvey



請為這篇文章評分?