░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/var/www/canvas/packages/canvas-planner/src/i18n
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: index.js
/* * Copyright (C) 2017 - present Instructure, Inc. * * This file is part of Canvas. * * Canvas is free software: you can redistribute it and/or modify it under * the terms of the GNU Affero General Public License as published by the Free * Software Foundation, version 3 of the License. * * Canvas is distributed in the hope that they will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import formatMessage from '../format-message' import getTranslations from './getTranslations' // eslint-disable-next-line import/no-extraneous-dependencies const generateId = require('format-message-generate-id/underscored_crc32') export default { init: function init(locale) { formatMessage.setup({ missingTranslation: 'ignore', generateId }) return getTranslations(locale) .then(translations => { document.documentElement.lang = locale formatMessage.addLocale({ locale, translations: {[locale]: translations} }) }) .catch(err => { /* eslint-disable no-console */ console.error(err) console.warn('Failed loading locale "%s". Falling back to English', locale) formatMessage.addLocale({ locale: 'en' }) /* eslint-enable no-console */ }) } }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📁 __tests__/
DIR
—
2023-09-24 03:39
📄 getTranslations.js
JS
1.7 KB
2023-09-24 03:39
EDIT
📄 index.js
JS
1.6 KB
2023-09-24 03:39
EDIT