You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TinyMCE本地化能否使用双字母语言代码‘fr’替代‘fr_FR’?

Using Two-Letter 'fr' Code for TinyMCE French Localization

Great question! The short answer is: yes, it's possible, but you'll need a small tweak since TinyMCE's default French language package uses the full fr_FR locale code. Here are two straightforward ways to make it work:

Option 1: Rename the Language File

TinyMCE matches the language option value exactly to the language file name. By default, the French localization file is named fr_FR.js (or fr_FR.min.js for the minified version).

  • Just rename this file to fr.js (or fr.min.js), keep it in your TinyMCE language directory, then set your config like this:
    tinymce.init({
      language: 'fr'
    });
    

TinyMCE will now find and load the French localization using the two-letter code.

Option 2: Map the Code with language_url

If you prefer not to rename the original file, use the language_url option to point directly to the fr_FR.js file while keeping language: 'fr' in your config:

tinymce.init({
  language: 'fr',
  language_url: '/path/to/your/tinymce/langs/fr_FR.js' // Replace with your actual file path
});

This tells TinyMCE to load the full locale file even when you specify the two-letter code.

A quick reminder: Make sure you’ve downloaded the French language package first and placed it in a location accessible to your TinyMCE instance—without the actual language file, neither method will work.

内容的提问来源于stack exchange,提问作者Paul R

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:58:37