mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-12 00:03:16 +00:00
Merge pull request #2889 from overleaf/jpa-ns-disable-spell-check-at-runtime
[misc] disable spellcheck for unsupported languages at runtime GitOrigin-RevId: 4214981930992abac054e78ce138adacaa99b801
This commit is contained in:
parent
cedb075b34
commit
f024483aa0
1 changed files with 30 additions and 0 deletions
|
@ -29,6 +29,28 @@ module.exports = {
|
||||||
_nameIsAcceptableLength
|
_nameIsAcceptableLength
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const unsupportedSpellcheckLanguages = [
|
||||||
|
'am',
|
||||||
|
'hy',
|
||||||
|
'bn',
|
||||||
|
'gu',
|
||||||
|
'he',
|
||||||
|
'hi',
|
||||||
|
'hu',
|
||||||
|
'is',
|
||||||
|
'kn',
|
||||||
|
'ml',
|
||||||
|
'mr',
|
||||||
|
'or',
|
||||||
|
'ss',
|
||||||
|
'ta',
|
||||||
|
'te',
|
||||||
|
'uk',
|
||||||
|
'uz',
|
||||||
|
'zu',
|
||||||
|
'fi'
|
||||||
|
]
|
||||||
|
|
||||||
async function joinProject(req, res, next) {
|
async function joinProject(req, res, next) {
|
||||||
const projectId = req.params.Project_id
|
const projectId = req.params.Project_id
|
||||||
let userId = req.query.user_id
|
let userId = req.query.user_id
|
||||||
|
@ -53,6 +75,14 @@ async function joinProject(req, res, next) {
|
||||||
if (project.deletedByExternalDataSource) {
|
if (project.deletedByExternalDataSource) {
|
||||||
await ProjectDeleter.promises.unmarkAsDeletedByExternalSource(projectId)
|
await ProjectDeleter.promises.unmarkAsDeletedByExternalSource(projectId)
|
||||||
}
|
}
|
||||||
|
// disable spellchecking for currently unsupported spell check languages
|
||||||
|
// preserve the value in the db so they can use it again once we add back
|
||||||
|
// support.
|
||||||
|
if (
|
||||||
|
unsupportedSpellcheckLanguages.indexOf(project.spellCheckLanguage) !== -1
|
||||||
|
) {
|
||||||
|
project.spellCheckLanguage = ''
|
||||||
|
}
|
||||||
res.json({
|
res.json({
|
||||||
project,
|
project,
|
||||||
privilegeLevel,
|
privilegeLevel,
|
||||||
|
|
Loading…
Reference in a new issue