packages/canvas-rce/doc/I18n.md
Each locale has two I18n files that are needed: A Canvas-managed JSON file that contains translations for our custom text, and a Tiny-managed JavaScript file for native TinyMCE menus and content:
canvas-lms/packages/translations/lib/canvas-rceformatMessage via formatMessage.addLocale({<locale code>: <translation keys/values>})canvas-rce/src/translations/tinymcetinymce.I18n via tinymce.addI18n(<locale code>, <translation keys/values>Rather than import these two files into RCE individually, canvas-rce has some build tooling to copy the Canvas-managed translations over to JavaScript files (located in canvas-rce/src/translations/locales) and then mix in the Tiny-managed translations (via an import).
In the end, this results in a single JavaScript file per locale that can be imported into RCE. To handle importing the correct "combined" locale file, the build tooling also generates a helper function called getTranslations() (located at canvas-rce/src/getTranslations.js)
The "combined" locale files live in canvas-rce/src/translations/locales
For more details on the build process see canvas-rce/scripts/installTranslations.js
Adding a new locale takes a few steps to ensure things work with the I18n build tooling and runtime importing.
canvas-rce/src/translations/tinymcecanvas-rce/src/rce/editorLanguage.jsrecognized array in canvas-rce/src/rce/normalizeLocale.jsyarn installTranslations to generate the "combined" locale filegit add the new Tiny-managed locale file added in step 2git add the new generated "combined" locale file found in canvas-rce/src/translations/localesgit add the rest of the modified files, commit, and push \o/