mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) i18
Summary: Adding initial work for localization support. Summary in https://grist.quip.com/OtZKA6RHdQ6T/Internationalization-and-Localization Test Plan: Not yet Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3633
This commit is contained in:
@@ -51,6 +51,7 @@ import log from 'app/server/lib/log';
|
||||
import {localeFromRequest} from 'app/server/lib/ServerLocale';
|
||||
import {fromCallback} from 'app/server/lib/serverUtils';
|
||||
import {Sessions} from 'app/server/lib/Sessions';
|
||||
import {i18n} from 'i18next';
|
||||
|
||||
export interface CommOptions {
|
||||
sessions: Sessions; // A collection of all sessions for this instance of Grist
|
||||
@@ -58,6 +59,7 @@ export interface CommOptions {
|
||||
hosts?: Hosts; // If set, we use hosts.getOrgInfo(req) to extract an organization from a (possibly versioned) url.
|
||||
loginMiddleware?: GristLoginMiddleware; // If set, use custom getProfile method if available
|
||||
httpsServer?: https.Server; // An optional HTTPS server to listen on too.
|
||||
i18Instance?: i18n; // The i18next instance to use for translations.
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -229,7 +231,7 @@ export class Comm extends EventEmitter {
|
||||
let reuseClient = true;
|
||||
if (!client?.canAcceptConnection()) {
|
||||
reuseClient = false;
|
||||
client = new Client(this, this._methods, localeFromRequest(req));
|
||||
client = new Client(this, this._methods, localeFromRequest(req), this._options.i18Instance);
|
||||
this._clients.set(client.clientId, client);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user