Back to Question Center
0

Semalt: harshen + yankin darajar da HTML5 lang attribute

1 answers:

Ina aiki a kan shafin yanar gizon da zai samar da bayanan da ke ciki bayan harshen + yanki kamar yadda aka bayyana akan wannan W3. Org shafi (e. g - r50 lampade alogene. en-CA don ƙunshiyar ƙasar Faransanci, da kuma fr-FR don abun ciki na Faransanci). Yayin da muke la'akari da abun ciki ga kowane harshen + yanki don zama na musamman, yana da mahimmanci a gare mu cewa injunan bincike suna ganewa da kuma sadar da abun ciki yadda ya kamata.

Ta hanyar kallon Intanit (e. g. wannan tambaya), yana nuna cewa mafi yawan mutane sun bada shawarar yin amfani da harshen harshen ISO639 a cikin HTML lang attributa don bayyana harshen harshe Duk da haka ba zan iya samun tabbacin wannan ba a cikin ƙayyadaddun HTML5 wanda ba ze samar da misali ba game da dabi'un da aka yarda.

Daga can na yi ƙoƙarin samun amsoshin amsawa ta hanyar kallon abin da shafin yanar gizo yake yi. Na dubi abin da Facebook yake yi: suna bayar da sassan yanar gizon su na Fransian da Farananci tare da (dan kadan) abubuwa daban-daban, yayin da adadin HTML lang ya kasance ɗaya:

en-CA
URL: http: // fr-ca. com
HTML lang sune:
fassarar kalmar 'imel': imel

fr-FR
URL: http: // fr-fr. com /
HTML lang sune:
fassarar kalmar 'email': Adireshin imel

Menene hanyar da aka bada shawarar / hanyar daidaitawa ta kwatanta abubuwan da aka gano ta hanyar amfani da harshen + yankin a cikin HTML5?

February 5, 2018
.

Babban mahimmanci:

An daidaita siginar alamar harshe ta IETF BCP 47 . A baya shiwajibi ne don tuntuɓar lambobin lambobi a cikin takardun ISO daban-dabansamo subtags masu kyau, amma yanzu zaka buƙatar duba cikin IANASiffar rikodin Subtag . Za mu bayyana sabon rajista a ƙasa.

Wannan labarin yana ba da shawara game da yadda za a zaɓa abubuwan da ketagulla. Don cikakkun bayanai game da manufofin da aka tsara a BCP 47, duba Alamun harshe a HTML da XML .

Akwai kayayyakin aikin da ke samar da ƙarin taimako yayin daneman bincike, kamar Rubutun Richard Ishida SubtagNemi kayan aiki .

Tabbatar kana da harshen da ya dace. Wani lokaci, yana biya don duba wasuhanyoyi. Mark Davis, co-marubucin BCP47, ya rubuta "Sau da yawa ba haka bashare abin da aka gano ma'anar harshe don amfani. Alal misali, abin da mafi yawan mutaneKira Punjabi a Pakistan yana da lambar 'lah', da kuma suna'Lahnda'. Akwai wasu lokuta da dama ana amfani da wannan sunaharsuna daban, ko kuma inda sunan da mutane ke nema bada aka jera a cikin rijistar IANA org / w / index. php? title = Musamman% 3aSearch & search = & fulltext = Bincike "rel =" ƙare "> Wikipedia . Ana amfani da Ethnologuelambobi guda uku kamar wasika na BCP47, amma zaka buƙaci

.

HTML5 baya nufin canzawa da amfani da lambobin harshe

Babu wata hujja game da abubuwan da ke binciken abubuwan da za su iya ba da hankali ga kowane furci na harshen harshe, kamar harshen halaye

Yana da wuya a zargi su saboda wannan, tun da yake wannan ya samar da kyakkyawan sakamako fiye da amincewa da harsuna . Alal misali, yawancin kayan aiki da aka tsara suna samar da lang = "en" ba tare da la'akari da ainihin abun ciki ba, ba tare da gaya wa marubucin ba.

[Wannan ba matakina ba ne, don haka ina kawai nuna takardun shaida a nan, amma ga alama kun manta da wani abu. ]

Siffar HTML5 na buƙatar cewa lang darajar zama mai aiki BCP 47 tag . A cikin wannan takardun, yanayin da ya dace ya kasance a sashi na 3. 4:

Alal misali, aiwatarwa zai iya tsara tasirin harsunan karawa zuwa jeri na asali. Wani yiwuwar zai kasance don aiwatarwa don dawo da alamar da aka fara daidai da ASCII-order. Idan harsunan harshe sun kasance "* -CH" ("CH" yana wakiltar Siwitsalanci) kuma saitin alamun sun haɗa da "de-CH" (Jamusanci kamar yadda aka yi amfani da ita a Switzerland), "fr-CH" (Faransanci, Switzerland), kuma " -CH "(Italiyanci, Switzerland), to, za a mayar da sunan" de-CH ".

wanda idan ka dubi shi ne ainihin abin da ka samo daga HTML 4 jimlar RFC1766, kawai a cikin mafi girma daki-daki.