Skip to content

Commit

Permalink
fix: always prefix lang for non-default language in disk storage modu…
Browse files Browse the repository at this point in the history
…le (#1000)
  • Loading branch information
NGPixel committed Aug 31, 2019
1 parent 7a582f7 commit eac1212
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/modules/storage/disk/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = {
async created(page) {
WIKI.logger.info(`(STORAGE/DISK) Creating file ${page.path}...`)
let fileName = `${page.path}.${getFileExtension(page.contentType)}`
if (WIKI.config.lang.namespacing && WIKI.config.lang.code !== page.localeCode) {
if (WIKI.config.lang.code !== page.localeCode) {
fileName = `${page.localeCode}/${fileName}`
}
const filePath = path.join(this.config.path, fileName)
Expand All @@ -68,7 +68,7 @@ module.exports = {
async updated(page) {
WIKI.logger.info(`(STORAGE/DISK) Updating file ${page.path}...`)
let fileName = `${page.path}.${getFileExtension(page.contentType)}`
if (WIKI.config.lang.namespacing && WIKI.config.lang.code !== page.localeCode) {
if (WIKI.config.lang.code !== page.localeCode) {
fileName = `${page.localeCode}/${fileName}`
}
const filePath = path.join(this.config.path, fileName)
Expand All @@ -77,7 +77,7 @@ module.exports = {
async deleted(page) {
WIKI.logger.info(`(STORAGE/DISK) Deleting file ${page.path}...`)
let fileName = `${page.path}.${getFileExtension(page.contentType)}`
if (WIKI.config.lang.namespacing && WIKI.config.lang.code !== page.localeCode) {
if (WIKI.config.lang.code !== page.localeCode) {
fileName = `${page.localeCode}/${fileName}`
}
const filePath = path.join(this.config.path, fileName)
Expand All @@ -88,7 +88,7 @@ module.exports = {
let sourceFilePath = `${page.sourcePath}.${getFileExtension(page.contentType)}`
let destinationFilePath = `${page.destinationPath}.${getFileExtension(page.contentType)}`

if (WIKI.config.lang.namespacing && WIKI.config.lang.code !== page.localeCode) {
if (WIKI.config.lang.code !== page.localeCode) {
sourceFilePath = `${page.localeCode}/${sourceFilePath}`
destinationFilePath = `${page.localeCode}/${destinationFilePath}`
}
Expand All @@ -108,7 +108,7 @@ module.exports = {
objectMode: true,
transform: async (page, enc, cb) => {
let fileName = `${page.path}.${getFileExtension(page.contentType)}`
if (WIKI.config.lang.namespacing && WIKI.config.lang.code !== page.localeCode) {
if (WIKI.config.lang.code !== page.localeCode) {
fileName = `${page.localeCode}/${fileName}`
}
WIKI.logger.info(`(STORAGE/DISK) Dumping ${fileName}...`)
Expand Down

0 comments on commit eac1212

Please sign in to comment.