* Adding a few missing langs.
* Remove unused extra language issue.
return res.redirect(`/404?err=${errCode}`);
}
- let acceptLang = req.headers["accept-language"]
- ? req.headers["accept-language"].split(",")[0]
- : "en";
- let lang = site.my_user
- ? site.my_user.local_user.lang == "browser"
- ? acceptLang
- : "en"
- : acceptLang;
-
let isoData: IsoData = {
path: req.path,
site_res: site,
routeData,
- lang,
};
const wrapper = (
console.log(`http://${hostname}:${port}`);
});
-function setForwardedHeaders(
- headers: IncomingHttpHeaders
-): { [key: string]: string } {
+function setForwardedHeaders(headers: IncomingHttpHeaders): {
+ [key: string]: string;
+} {
let out = {
host: headers.host,
};
import { bg } from "./translations/bg";
import { ar } from "./translations/ar";
import { ko } from "./translations/ko";
+import { id } from "./translations/id";
+import { nb_NO } from "./translations/nb_NO";
+import { zh_Hant } from "./translations/zh_Hant";
// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
const resources = {
th,
bg,
ar,
- ko
+ ko,
+ id,
+ nb_NO,
+ zh_Hant,
};
function format(value: any, format: any): any {
path: string;
routeData: any[];
site_res: GetSiteResponse;
- // Lang and theme
- lang: string;
- // communities?: ListCommunitiesResponse;
}
export interface ILemmyConfig {
import "moment/locale/da";
import "moment/locale/hr";
import "moment/locale/bg";
+import "moment/locale/id";
+import "moment/locale/nb";
import {
UserOperation,
{ code: "gl" },
{ code: "hr" },
{ code: "hu" },
+ { code: "id" },
{ code: "ka" },
{ code: "ko" },
{ code: "km" },
{ code: "fa" },
{ code: "ja" },
{ code: "oc" },
+ { code: "nb_NO" },
{ code: "pl" },
{ code: "pt_BR" },
{ code: "zh" },
{ code: "nl" },
{ code: "it" },
{ code: "bg" },
+ { code: "zh_Hant" },
];
export const themes = [
lang = "th";
} else if (lang.startsWith("bg")) {
lang = "bg";
+ } else if (lang.startsWith("id")) {
+ lang = "id";
+ } else if (lang.startsWith("nb")) {
+ lang = "nb";
} else {
lang = "en";
}