summary:'Install a locale from an uploaded strings file',
description:
'The body is the locale package itself — one of the `<tag>.json` files published at `requarks/wiki-locales` — sent as `application/json` rather than as a multipart form. For an installation that cannot reach the internet, where `/locales/fetch` has nothing to read and a locale has no row to be installed from; this creates the row as well as filling it.\n\nThe file name is the identity, exactly as it is upstream: `fr-FR.json` installs `fr-FR`, so a renamed file installs the wrong locale and a name that is not a language tag is refused. So is a body that is not one flat object of strings, and so is `en`, which ships with the wiki.\n\nNo hash is recorded, since nothing was downloaded — a later run of `/locales/fetch` on an instance that does reach upstream will therefore re-download the locale.',
tags:['Locales'],
consumes:['application/json'],
querystring:{
type:'object',
properties:{
fileName:{
type:'string',
minLength: 1,
maxLength: 255,
description:'The name of the uploaded file, e.g. `fr-FR.json`.'
}
},
required:['fileName']
},
response:{
200:{
description:'Locale installed successfully',
type:'object',
properties:{
ok:{type:'boolean'},
code:{
type:'string',
description:'The locale the file was installed as, read off its name.'
"admin.audit.actions.updateUser":"Updated a user",
"admin.audit.actions.updateUser":"Updated a user",
"admin.audit.actions.updateUserDefaults":"Changed the user defaults",
"admin.audit.actions.updateUserDefaults":"Changed the user defaults",
"admin.audit.actions.uploadAsset":"Uploaded a file",
"admin.audit.actions.uploadAsset":"Uploaded a file",
"admin.audit.actions.uploadLocale":"Installed a locale from a file",
"admin.audit.actions.verifyEmail":"Confirmed an email address",
"admin.audit.actions.verifyEmail":"Confirmed an email address",
"admin.audit.actions.watchPage":"Started watching a page",
"admin.audit.actions.watchPage":"Started watching a page",
"admin.audit.allActions":"Any action",
"admin.audit.allActions":"Any action",
@ -693,12 +694,16 @@
"admin.locale.downloadNew":"Install New Locale",
"admin.locale.downloadNew":"Install New Locale",
"admin.locale.downloadTitle":"Download Locale",
"admin.locale.downloadTitle":"Download Locale",
"admin.locale.editAliases":"Edit Locale Aliases",
"admin.locale.editAliases":"Edit Locale Aliases",
"admin.locale.fetch":"Fetch Locales",
"admin.locale.fetch":"Fetch Updates",
"admin.locale.fetchHint":"Check for new and updated locales.",
"admin.locale.fetchHint":"Check for new and updated locales.",
"admin.locale.forcePrefix":"Force Locale Prefix",
"admin.locale.forcePrefix":"Force Locale Prefix",
"admin.locale.forcePrefixHint":"Paths without a locale code will always be redirected to the primary locale.",
"admin.locale.forcePrefixHint":"Paths without a locale code will always be redirected to the primary locale.",
"admin.locale.install":"Install",
"admin.locale.install":"Install",
"admin.locale.installFailed":"Failed to install the locale.",
"admin.locale.installFailed":"Failed to install the locale.",
"admin.locale.installFile":"Install from file...",
"admin.locale.installFileFailed":"Failed to install the locale from this file.",
"admin.locale.installFileHint":"Install a locale package (.json) downloaded from the Wiki.js locales repository, for a wiki that cannot reach the internet.",