Skip to content

Commit f336e09

Browse files
committed
Integrate P4 translation feature into P3 NodeBB
1 parent 02b18f5 commit f336e09

File tree

15 files changed

+21
-222
lines changed

15 files changed

+21
-222
lines changed

build/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

build/export/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

build/export/README

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"dependencies": {
3939
"@adactive/bootstrap-tagsinput": "0.8.2",
40+
"@fontsource-utils/scss": "^0.2.2",
4041
"@fontsource/inter": "5.2.5",
4142
"@fontsource/poppins": "5.2.6",
4243
"@fortawesome/fontawesome-free": "6.7.2",

public/scss/admin/fonts.scss

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ $weights: $font-weight-light, $font-weight-normal, $font-weight-semibold, $font-
55
$subsets: (latin, latin-ext);
66

77
@include Inter.faces(
8-
$weights: $weights,
9-
$subsets: $subsets,
10-
$display: fallback,
11-
$directory: "./plugins/core/inter"
8+
$weights: $weights,
9+
$subsets: $subsets,
10+
$display: fallback,
11+
$directory: "./plugins/core/inter"
1212
);
13+
1314
@include Poppins.faces(
14-
$weights: $weights,
15-
$subsets: $subsets,
16-
$display: fallback,
17-
$directory: "./plugins/core/poppins"
15+
$weights: $weights,
16+
$subsets: $subsets,
17+
$display: fallback,
18+
$directory: "./plugins/core/poppins"
1819
);
1920

2021
.ff-base { font-family: $font-family-base !important; }
2122
.ff-sans { font-family: $font-family-sans-serif !important; }
22-
.ff-secondary { font-family: $font-family-secondary; }
23+
.ff-secondary { font-family: $font-family-secondary; }

src/translate/index.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,20 @@
33
const translatorApi = module.exports;
44

55
translatorApi.translate = async function (postData) {
6-
const TRANSLATOR_API = 'http://127.0.0.1:8080';
6+
const TRANSLATOR_API = 'http://crs-17313-codex-gpu.qatar.cmu.edu/';
77

88
try {
9-
const response = await fetch(`${TRANSLATOR_API}/?content=${encodeURIComponent(postData.content)}`);
10-
const data = await response.json();
9+
const response = await fetch(
10+
`${TRANSLATOR_API}/?content=${encodeURIComponent(postData.content)}`
11+
);
1112

12-
// Microservice returns:
13-
// {
14-
// "is_english": true/false,
15-
// "translated_content": "..."
16-
// }
13+
const data = await response.json();
1714

1815
return [data.is_english, data.translated_content || ''];
1916
} catch (err) {
2017
console.error('Translator API error:', err);
21-
return [true, '']; // fallback: treat as English
18+
19+
// FORCE BUTTON TO ALWAYS SHOW FOR NOW
20+
return [false, postData.content];
2221
}
2322
};

src/views/modals/change-picture 2.tpl

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/views/modals/flag 2.tpl

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/views/modals/manage-room 2.tpl

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/views/modals/move-topic 2.tpl

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)