Skip to content

Commit

Permalink
fix: disable localization
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Jul 9, 2024
1 parent a370542 commit a635d3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions apps/staking/lib/locale-server.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import 'server-only';

import { getLocale, getMessages, getRequestConfig as i18nGetRequestConfig } from 'next-intl/server';
import { getMessages, getRequestConfig as i18nGetRequestConfig } from 'next-intl/server';
import { headers } from 'next/headers';
import { getLangDir } from 'rtl-detect';
import { defaultTranslationValues } from './locale-defaults';
import { matchClosestLocale } from './locale-util';
import { DEFAULT_LOCALE, matchClosestLocale } from './locale-util';

export const getServerSideLocale = () => {
const acceptLanguage = headers().get('accept-language');
return matchClosestLocale(acceptLanguage);
};

export const getLocalizationData = async () => {
const locale = await getLocale();
// TODO: remove when we add localized strings
// const locale = await getLocale();
const locale = DEFAULT_LOCALE;
const direction = getLangDir(locale);
const messages = await getMessages();
return { locale, direction, messages };
};

const getRequestConfig: ReturnType<typeof i18nGetRequestConfig> = i18nGetRequestConfig(async () => {
const locale = getServerSideLocale();
// TODO: remove when we add localized strings
// const locale = getServerSideLocale();
const locale = DEFAULT_LOCALE;
return {
locale,
messages: (await import(`../locales/${locale}.json`)).default,
Expand Down
8 changes: 4 additions & 4 deletions packages/sent-staking-js/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ export class SessionStakingClient {
}

public async getOpenNodes(): Promise<SSBResponse<GetOpenNodesResponse>> {
return {
body: { nodes: [] },
status: 200,
statusText: 'MOCK',
const options: SSBRequestOptions = {
url: `${this.baseUrl}/nodes/open`,
method: 'GET',
};
return this.request<GetOpenNodesResponse>(options);
}

/**
Expand Down

0 comments on commit a635d3c

Please sign in to comment.