Language codes for simplified Chinese and traditional Chinese?

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

Are there standards for which 2 letter codes to use for these languages? mydomain.com/zh mydomain.com/?. Share. Home Public Questions Tags Users Collectives ExploreCollectives FindaJob Jobs Companies Teams StackOverflowforTeams –Collaborateandshareknowledgewithaprivategroup. CreateafreeTeam WhatisTeams? Teams CreatefreeTeam CollectivesonStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore LanguagecodesforsimplifiedChineseandtraditionalChinese? AskQuestion Asked 10years,10monthsago Active 1year,4monthsago Viewed 111ktimes 85 29 Wearecreatingmulti-languagesubsitesonourwebsite. Iwouldliketousethe2-letterlanguagecodes.SpanishandFrenchareeasy.TheywillgetURLslike: mydomain.com/es mydomain.com/fr butIrunintoaproblemwithTraditionalandSimplifiedchinese.Aretherestandardsforwhich2lettercodestousefortheselanguages? mydomain.com/zh mydomain.com/? utf-8internationalizationcjkchinese-locale Share Follow editedNov12'17at10:45 STF 1,43733goldbadges1818silverbadges3232bronzebadges askedFeb3'11at22:16 jephperrojephperro 5,9822424goldbadges8686silverbadges121121bronzebadges 1 2 YousaySpanishandFrenchareeasy,buttheCLDRdatabaselists26and47country-specificvariantsrespectivelyforeach!Itjustdependsuponhowmuchtheresourcesyouareprovidingaredependentuponthedifferences. – Patanjali Jan7'17at4:38 Addacomment  |  3Answers 3 Active Oldest Votes 181 @dkarpgivesanexcellentgeneralanswer.IwilladdsomeadditionalspecificsregardingChinese: ThereareseveralcountrieswhereChineseisthemainwrittenlanguage.Themajordifferencebetweenthemiswhethertheyusesimplifiedortraditionalcharacters,buttherearealsominorregionaldifferences(invocabulary,etc).Thestandardwaytodistinguishthesewouldbewithacountrycode,e.g.zh_CNformainlandChina,zh_SGforSingapore,zh_TWforTaiwan,orzh_HKforHongKong. MainlandChinaandSingaporebothusesimplifiedcharacters,andtheothersusetraditionalcharacters.SinceChinaandTaiwanarethetwowiththebiggestpopulations,justzh_CNandzh_TWareoftenusedtodistinguishthesimplifiedandtraditionalcharacterversionsofawebsite. Moretechnicallycorrectbutnotcommonlyusedinpractice,however,wouldbetousezh_HANSfor(generic)simplifiedChinesecharacters,andzh_HANTfortraditionalChinesecharacters,exceptforrarecaseswhenitismeaningfultodistinguishdifferentcountries. Share Follow editedJul25'20at5:54 HendyIrawan 18.5k1010goldbadges9898silverbadges108108bronzebadges answeredFeb4'11at4:40 ToddOwenToddOwen 14.6k77goldbadges4949silverbadges5151bronzebadges 5 11 Thisisagreatanswer--well-writtenandprobablynotsomethingmostpeopleknow.Anditdrawsanicelinebetweenwhat'smoretechnicallycorrect(zh_HANS)andwhat'sactuallyoutthereingeneraluse(zh_CN).YoucandoaGooglesearchforthetwoterms--it'saboutan7-to-1differenceinfavorofzh_CN,whichishonestlylessthanIexpected. – dkarp Feb4'11at13:08 11 Actually,thedifferenceinURLsisaslargeasIexpected.inurl:zh_CNgives4.3Mhits;inurl:zh_HANSgives20K.Still,areallyinformativeanswer. – dkarp Feb4'11at13:15 3 ThedifferencebetweenHANSandHANTismuchlessusefulthanCNandTW,asthedifferenceismorethanthecharacters,butregion-specificusage.E.g.subroutineistranslatedas子程序inmainlandChina,butas子程式inTaiwan.Inthisexample,thecharactersarethesameinSimplifiedandTraditionalChinese,butthetranslationshouldstillbedifferent. – YongweiWu Oct8'19at8:53 Iamtryingtounderstandwhyitstartswithzh,notch,hopefullynotbecausezhaofamily – AlexBinZhao Oct19at23:37 @AlexBinZhaoThelanguagecode"zh"comesfromtheChinesenameforChinese,"Zhōngwén"(中文).YoucanfindalistofallISO639-1languagecodeshere:en.wikipedia.org/wiki/List_of_ISO_639-1_codes – ToddOwen Oct20at16:48 Addacomment  |  39 Thereisindeedastandardrepresentationforthis.Aspeoplehaverunintotheexactsameproblemyouareseeing--samelanguage,butdifferentdialectsorcharacters--they'veextendedthetwo-letterlanguagecodewithatwo-letterregioncode.SoyoumighthaveauniversalFrenchpageatmydomain.com/fr,butinternationalizingforFrenchCanadianreadersmightleaveyouwithamydomain.com/fr_CA(Canada)andmydomain.com/fr_FR(France).Someplatformsuseadashinsteadofanunderscoretoseparatethelanguageandregioncodes(hencefr-CAandfr-FR). ThestandardlocaleforsimplifiedChineseiszh_CN.ThestandardlocalefortraditionalChineseiszh_TW. IhesitatetopointyoutowardstheactualBCP47standardsdocuments,asthey're,uh,alittleheavyonthedetailandalittlelightonthereadability.Justgowithstandardlocaleidentifiers,liketheonesinusedbyJava,andyou'llbefine. Share Follow editedDec30'16at14:39 Tsundoku 2,20911goldbadge1515silverbadges2929bronzebadges answeredFeb4'11at4:01 dkarpdkarp 14.1k66goldbadges5555silverbadges6262bronzebadges 0 Addacomment  |  3 Languageisdependentuponwhereitisspoken(doh!),solanguageandlocalecodesreflectthatreality.zhisthebasiclanguagecode,butbecausetherearetwomajorformsofit,therearezh_Hansandzh_Hant,buttheyarestillonlylanguagecodes,notlocales. Location-specific Tofullyspecifywhichlanguageisusedinaparticularlocation,thecountrycodestillhastobesuffixed,somakingzh_Hans_HKandzh_Hant_HKforsimplifiedandtraditionalChinese,respectively,bothasspokeninHongKong. Actually,therealityisthatsomethingmorespecificthancountrycodeisoftenrequiredinmanycountries,butthatislikelytoexponentiallyincreasethecomplexityandmaintenanceofdatabaseslikeCLDR,plusthesupportinfrastructuretofeedintoit,likeIPtolocationdetailsextraction,isnotgenerallyavailableoraccurateenough. Fixedtext Now,ifthecodeisjusttospecifywhichsetoffixedstringstouseintheuserinterface,orevenwholepagessetsonasite,acountrysuffixisnotreallynecessary,unlesstherearemorethanafewplaceswherethelanguagevariessignificantlyenough(location-basedinfo)tobothercreatingawholeseparateresourceset. Thelargertheresourceset,themorelikelythatalanguagecodebaseduponlocale[inthiscontext,justalanguageattribute,ratherthanatruelocale,soyoucancallitwhatyoulike!]willberequired,butatleastyouonlyhavetodothatwhennecessary. On-the-flyvalues However,ifwantingtoformatparticularvariablevalues,likedates,times,currenciesandnumbers,on-the-fly,localesbecomeimportant,becauseallthetoolsthatsupportsuchfunctionality(likethosebaseduponUnicodeCLDRdata)expectthem.Thelocalefortheseneedstobeaseparatesettingtothecodeforwhichanin-house-generatedUIlanguageissettouse,unlessyouwanttocreatearesourcesetforeveryknownlocale,andmaintainthemadnauseum! Browserlanguagetools Notethatwhenspecifyinglocaleforawebpagethatcanbeedited,asininputboxes,andspellcheckinattributesorcsshasbeenenabledforthefield,thebrowser'slanguagetoolswillspellcheckthefieldaccordingtothatlocale. Criteria Youhavetobeclearaboutwhattheresourcesetisproviding,soconsider: Fixedstrings?Languageonly. Formattingon-the-fly?Locale. Spellcheckingintheviewingenvironment?Locale. Wholepages/subsite?Languageonly,elselocale(asalanguagevariant)ifsignificantlydifferentcontentrequired. Spreadsheettominimisemaintenanceoverhead IuseaspreadsheettoholdUIstringswhereeachlanguagecodehasaparentcode,sothatthecellforitsversionofastringhasaformulathatgetsitsstringfromtheparent.Tocreateacustomstringforthatlanguageandstring,Ijustoverwritethecellformulawiththeexacttext.Thatminimisestheamountofresourcemaintenance.Irunamacroattheendthatgeneratesacompleteresourcefileforeachlanguage. Share Follow editedAug7'20at11:30 answeredJan7'17at4:09 PatanjaliPatanjali 73399silverbadges1313bronzebadges 1 Mythinkingisifyourprogramminglanguage(likeJava)orlanguage-matchingframeworkcansupportzh-hans_CNtypeformatthengoforit.Ifitdoesn't,thenhavingtheCountryimpliesthe'script',likeHansisassumedforzh_CN,zh_SG,andHantisassumedforzh_TW,zh_HK.Sothescriptpartcanbeleftoff.Ifyoursystemdoes'thavecountry-matchingatall,likeithasen/fr/de/esformostlanguages....thenitmighthavethezh_hans/zh_hanttypeformatatleastforcertainlangs(likeDrupalismostlythiswaysoiallowmymobileappstosendupthisinfotomatchinmyDrupalCMSAPI) – armyofda12mnkeys Jan22'19at21:33 Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedutf-8internationalizationcjkchinese-localeoraskyourownquestion. TheOverflowBlog Bestpracticescanslowyourapplicationdown Bestpracticesforwritingcodecomments FeaturedonMeta ProvidingaJavaScriptAPIforuserscripts Congratulationstothe59sitesthatjustleftBeta A/BtestingontheAskpage Linked 19 ConversionfromSimplifiedtoTraditionalChinese 2 CanIuseonlyzh-Hans/zh-HantresxfilesforChineseifIdon'tneedtosupportlocale-specificvariations? Related 15 Chineselanguagecodes 1 WinFormsControlpositioninSimplifiedChinese 75 SimplifiedandTraditionalChinesevsRegions 3 HowdoIdistinguishSimplifiedandTraditionalChineseinC#? 1 Emulatordoesnotdisplaylocalisedsimplifiedchinesetextinwindowsphone 1 ChangingthelanguagemanuallytoSimplifiesChinese 0 WordPressSimplifiedChineselanguagecode 2 LocalizationofOSXservicemenuentrydoesnotworkforSimplifiedChinese 9 HowtogetChineselocaletodisplayinchineseasspecificallysimplifiedortraditional HotNetworkQuestions Willatrophy'trigger'doneonanotherplatformmakeitsothetrophyisnotpossibletogetonPS4? Howtonotatelackofpedalforameasure? WithFTLtechnologyisitpossibletoleaveafteranotherandyetarrivebeforeit? Firstdaya2022UScongresscouldvotetoshutdownJan6thcommission?Howquicklyaftercouldthecommissionbeeffectivelycurtailedorshutdown? Isthereanalgorithmwhosetimecomplexityisbetweenpolynomialtimeandexponentialtime? CanIthrowdynamitefrominsidetheeffectsofsanctuary? Howtoseparatetheregionsenclosedbycurves Whyischurrodoughcreatedwithboilingwater? Whywouldadigitalinputrequireapulldowninsteadofadirectconnectiontotheinputvoltage? Validationoncustomfield WhydounavailableseatsfollowmeonDelta WhyisitthatafterMirroringaMesh,itshowsupasTransparentinUnity? HowmuchgreaseshouldIusetopackhubs? Howcouldpearsbeusedasammunition? InFIDEtournaments,doIhavetherighttoresignonmyfirstmoveorwithin10moves? ManagingR&Dprojectsthatdon'thavea100%chanceofsuccess AnUnnaturalPuzzle AreEnchantmentPointsofferedforAncientHuntslostforever? IsitreasonabletocalculateTDDFTexcitationenergiesatageometryoptimizedwithadifferentmethod? Howtokeeppipelinefilesinaseparaterepositoryforazuredevopspipeline? Whatdoes"broadcast"meanhere? Whatmaterialpropertiesareunpredictable(notreproducible)butcanbemeasuredconsistentlyandatalowcost? Whythebandstructureofaslabisnotsmooth? Howdoballbearingsnotcrackfromaloadconcentratedonaninfinitesimallysmallpoint? morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?