返回介绍

Localization options

发布于 2019-05-06 06:50:02 字数 10274 浏览 917 评论 0 收藏 0

directionality

This option allows you to set the base direction of directionally neutral text (i.e., text that doesn’t have inherent directionality as defined in Unicode) within the editor. This is similar to the use of the 'dir' attribute when using content editable elements by themselves.

Type: String

Default Value: 'ltr'

Possible Values: 'ltr', 'rtl'

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  directionality : 'ltr'
});

language

This option allows you to specify the language that TinyMCE’s user interface will appear in. That is, the toolbar buttons and menu items. By default, TinyMCE will use US English as the language of the interface.

If you wish to use a language other than English, please follow these steps:

  1. Download the language pack you wish to use from here.
  2. Unpack the language file into your tinymce/langs folder.
  3. Set the language option in your TinyMCE configuration to the language code in the list below (which you’ll also find on the language pack download page.
  4. Confirm that the language has been set successfully by loading TinyMCE.

Please note, the language code you set in your TinyMCE configuration must match the filename of the language file. If the language file is not found, TinyMCE will not load.

Type: String

Default Value: en_US

Example

In this example we will set the editor language to Swedish.

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  language: 'sv_SE'
});

The available language codes for use with this option are as follows:

LanguageCode
Arabicar
Arabic (Saudi Arabia)ar_SA
Armenianhy
Azerbaijaniaz
Basqueeu
Belarusianbe
Bengali (Bangladesh)bn_BD
Bosnianbs
Bulgarian (Bulgaria)bg_BG
Catalanca
Chinese (China)zh_CN
Chinese (Taiwan)zh_TW
Croatianhr
Czechcs
Danishda
Divehidv
Dutchnl
English (Canada)en_CA
English (United Kingdom)en_GB
Estonianet
Faroesefo
Finnishfi
French (France)fr_FR
Gaelic, Scottishgd
Galiciangl
Georgian (Georgia)ka_GE
Germande
German (Austria)de_AT
Greekel
Hebrew (Israel)he_IL
Hindi (India)hi_IN
Hungarian (Hungary)hu_HU
Icelandic (Iceland)is_IS
Indonesianid
Italianit
Japaneseja
Kabylekab
Kazakhkk
Khmer (Cambodia)km_KH
Korean (Korea)ko_KR
Kurdishku
Kurdish (Iraq)ku_IQ
Latvianlv
Lithuanianlt
Luxembourgishlb
Malayalamml
Malayalam (India)ml_IN
Mongolian (Mongolia)mn_MN
Norwegian Bokmål (Norway)nb_NO
Persianfa
Persian (Iran)fa_IR
Polishpl
Portuguese (Brazil)pt_BR
Portuguese (Portugal)pt_PT
Romanianro
Russianru
Serbiansr
Sinhala (Sri Lanka)si_LK
Slovaksk
Slovenian (Slovenia)sl_SI
Spanishes
Spanish (Mexico)es_MX
Swedish (Sweden)sv_SE
Tajiktg
Tamilta
Tamil (India)ta_IN
Tatartt
Thai (Thailand)th_TH
Turkishtr
Turkish (Turkey)tr_TR
Uighurug
Ukrainianuk
Ukrainian (Ukraine)uk_UA
Vietnamesevi
Vietnamese (Viet Nam)vi_VN
Welshcy

If a language you need is not available, you may wish to translate it yourself. To contribute to translating TinyMCE, go to our Transifex translation page and sign up, then request to join a team or create a new team if your language are not listed.

language_url

When using the language option to set the user interface language you may choose to place any language pack(s) in a directory other than the default. If you do this you need to provide a simple URL to where the language file is located. We recommend using a site absolute URL.

Type: String

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  language_url : '/languages/fi.js'  // site absolute URL
});

You can find and download languages here.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文