Skip to content

Commit

Permalink
added translate fields to posts for api
Browse files Browse the repository at this point in the history
  • Loading branch information
annashiheart committed Nov 13, 2024
1 parent 33a5bea commit 63e7237
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dump.rdb

dist/
yarn.lock
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
reporter: dot
timeout: 25000
exit: true
bail: true
bail: false
Binary file removed dump.rdb
Binary file not shown.
4 changes: 4 additions & 0 deletions public/openapi/components/schemas/PostObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ PostObject:
description: A topic identifier
content:
type: string
isEnglish:
type: boolean
translatedContent:
type: string
uid:
type: number
description: A user identifier
Expand Down
4 changes: 4 additions & 0 deletions public/openapi/write/posts/pid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ get:
type: boolean
downvoted:
type: boolean
isEnglish:
type: boolean
translatedContent:
type: string
put:
tags:
- posts
Expand Down
4 changes: 2 additions & 2 deletions src/translator.js → src/translate/translator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function warn(msg) {
}
}

module.exports = require('../public/src/modules/translator.common')(require('./utils'), (lang, namespace) => {
const languages = require('./languages');
module.exports = require('../../public/src/modules/translator.common')(require('../utils'), (lang, namespace) => {
const languages = require('../languages');
return languages.get(lang, namespace);
}, warn);

0 comments on commit 63e7237

Please sign in to comment.