我想获取可用的区域设置键列表。我无法找到有关如何执行此操作的任何文档。
答案 0 :(得分:3)
答案 1 :(得分:3)
查看最新的语言环境列表的一种好方法是查看“ node_modules / moment / locale”文件夹。然后,您将看到每个语言环境的js文件,甚至可以在js文件中看到该语言环境的更多详细信息。
答案 2 :(得分:1)
此功能目前尚不存在。它被请求了一段时间,并关闭了其他相关的功能。我已重新开启the issue。
答案 3 :(得分:1)
答案 4 :(得分:1)
我已经用最新的更新更新了这个列表。
原始语言环境列表:https://github.com/moment/moment/tree/develop/locale
我在下面列出了一个清单
<select id="moment-locale">
<option value="af">Afrikaans</option>
<option value="ar-dz">Arabic (Algeria)</option>
<option value="ar-kw">Arabic (Kuwait)</option>
<option value="ar-ly">Arabic (Libya)</option>
<option value="ar-ma">Arabic (Morocco)</option>
<option value="ar-sa">Arabic (Saudi Arabia)</option>
<option value="ar-tn">Arabic (Tunisia)</option>
<option value="ar">Arabic</option>
<option value="az">Azerbaijani</option>
<option value="be">Belarusian</option>
<option value="bg">Bulgarian</option>
<option value="bm">Bambara</option>
<option value="bn-bd">Bengali (Bangladesh)</option>
<option value="bn">Bengali</option>
<option value="bo">Tibetan</option>
<option value="br">Breton</option>
<option value="bs">Bosnian</option>
<option value="ca">Catalan</option>
<option value="cs">Czech</option>
<option value="cv">Chuvash</option>
<option value="cy">Welsh</option>
<option value="da">Danish</option>
<option value="de-at">German (Austria)</option>
<option value="de-ch">German (Switzerland)</option>
<option value="de">German</option>
<option value="dv">Divehi</option>
<option value="el">Greek</option>
<option value="en-au">English (Australia)</option>
<option value="en-ca">English (Canada)</option>
<option value="en-gb">English (United Kingdom)</option>
<option value="en-ie">English (Ireland)</option>
<option value="en-il">English (Israel)</option>
<option value="en-in">English (India)</option>
<option value="en-nz">English (New Zealand)</option>
<option value="en-sg">English (Singapore)</option>
<option value="eo">Esperanto</option>
<option value="es-do">Spanish (Dominican Republic)</option>
<option value="es-mx">Spanish (Mexico)</option>
<option value="es-us">Spanish (United States)</option>
<option value="es">Spanish</option>
<option value="et">Estonian</option>
<option value="eu">Basque</option>
<option value="fa">Persian</option>
<option value="fi">Finnish</option>
<option value="fil">Filipino</option>
<option value="fo">Faroese</option>
<option value="fr-ca">French (Canada)</option>
<option value="fr-ch">French (Switzerland)</option>
<option value="fr">French</option>
<option value="fy">Western Frisian</option>
<option value="gd">Scottish Gaelic</option>
<option value="gl">Galician</option>
<option value="gom-latn">gom (Latin)</option>
<option value="gu">Gujarati</option>
<option value="he">Hebrew</option>
<option value="hi">Hindi</option>
<option value="hr">Croatian</option>
<option value="hu">Hungarian</option>
<option value="hy-am">Armenian (Armenia)</option>
<option value="id">Indonesian</option>
<option value="is">Icelandic</option>
<option value="it-ch">Italian (Switzerland)</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="jv">Javanese</option>
<option value="ka">Georgian</option>
<option value="kk">Kazakh</option>
<option value="km">Khmer</option>
<option value="kn">Kannada</option>
<option value="ko">Korean</option>
<option value="ku">Kurdish</option>
<option value="ky">Kirghiz</option>
<option value="lb">Luxembourgish</option>
<option value="lo">Lao</option>
<option value="lt">Lithuanian</option>
<option value="lv">Latvian</option>
<option value="me">Montenegrin</option>
<option value="mi">Maori</option>
<option value="mk">Macedonian</option>
<option value="ml">Malayalam</option>
<option value="mn">Mongolian</option>
<option value="mr">Marathi</option>
<option value="ms-my">Malay (Malaysia)</option>
<option value="ms">Malay</option>
<option value="mt">Maltese</option>
<option value="my">Burmese</option>
<option value="nb">Norwegian Bokmål</option>
<option value="ne">Nepali</option>
<option value="nl-be">Dutch (Belgium)</option>
<option value="nl">Dutch</option>
<option value="nn">Norwegian Nynorsk</option>
<option value="pa-in">Punjabi (India)</option>
<option value="pl">Polish</option>
<option value="pt-br">Portuguese (Brazil)</option>
<option value="pt">Portuguese</option>
<option value="ro">Romanian</option>
<option value="ru">Russian</option>
<option value="sd">Sindhi</option>
<option value="se">Northern Sami</option>
<option value="si">Sinhala</option>
<option value="sk">Slovak</option>
<option value="sl">Slovenian</option>
<option value="sq">Albanian</option>
<option value="sr-cyrl">Serbian (Cyrillic)</option>
<option value="sr">Serbian</option>
<option value="ss">Swati</option>
<option value="sv">Swedish</option>
<option value="sw">Swahili</option>
<option value="ta">Tamil</option>
<option value="te">Telugu</option>
<option value="tet">Tetum</option>
<option value="tg">Tajik</option>
<option value="th">Thai</option>
<option value="tk">Turkmen</option>
<option value="tl-ph">Tagalog (Philippines)</option>
<option value="tlh">Klingon</option>
<option value="tr">Turkish</option>
<option value="tzl">Talossan</option>
<option value="tzm-latn">Central Atlas Tamazight (Latin)</option>
<option value="tzm">Central Atlas Tamazight</option>
<option value="ug-cn">Uyghur (China)</option>
<option value="uk">Ukrainian</option>
<option value="ur">Urdu</option>
<option value="uz-latn">Uzbek (Latin)</option>
<option value="uz">Uzbek</option>
<option value="vi">Vietnamese</option>
<option value="x-pseudo">Pseudo</option>
<option value="yo">Yoruba (Nigeria)</option>
<option value="zh-cn">Chinese (China)</option>
<option value="zh-hk">Chinese (Hong Kong)</option>
<option value="zh-mo">Chinese (Macau)</option>
<option value="zh-tw">Chinese (Taiwan)</option>
</select>
谢谢。
如果您发现任何问题,请告诉我。我会更新我的答案:)
答案 5 :(得分:0)
要获取所有可用的语言环境键列表,您将需要:
import moment from 'moment/min/moment-with-locales';
然后
moment.locales(); // return array of all locales keys
答案 6 :(得分:0)