Skip to content

Commit

Permalink
fix typo in getKibanaTranslationPaths
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Oct 27, 2020
1 parent 42d58b4 commit b3f89eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/legacy/server/i18n/get_kibana_translation_paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import { I18N_RC } from './constants';
import { fromRoot } from '../../../core/server/utils';

jest.mock('./get_translation_paths', () => ({ getTranslationPaths: jest.fn() }));
import { getKibanaTranslatoinPaths } from './get_kibana_translation_paths';
import { getKibanaTranslationPaths } from './get_kibana_translation_paths';
import { getTranslationPaths as mockGetTranslationPaths } from './get_translation_paths';

describe('getKibanaTranslatoinPaths', () => {
describe('getKibanaTranslationPaths', () => {
const mockConfig = { get: jest.fn() };

beforeEach(() => {
Expand All @@ -33,7 +33,7 @@ describe('getKibanaTranslatoinPaths', () => {

it('calls getTranslationPaths against kibana root and kibana-extra', async () => {
mockConfig.get.mockReturnValue([]);
await getKibanaTranslatoinPaths(mockConfig);
await getKibanaTranslationPaths(mockConfig);
expect(mockGetTranslationPaths).toHaveBeenNthCalledWith(1, {
cwd: fromRoot('.'),
glob: `*/${I18N_RC}`,
Expand All @@ -47,7 +47,7 @@ describe('getKibanaTranslatoinPaths', () => {

it('calls getTranslationPaths for each config returned in plugin.paths and plugins.scanDirs', async () => {
mockConfig.get.mockReturnValueOnce(['a', 'b']).mockReturnValueOnce(['c']);
await getKibanaTranslatoinPaths(mockConfig);
await getKibanaTranslationPaths(mockConfig);
expect(mockConfig.get).toHaveBeenNthCalledWith(1, 'plugins.paths');
expect(mockConfig.get).toHaveBeenNthCalledWith(2, 'plugins.scanDirs');

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/server/i18n/get_kibana_translation_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { fromRoot } from '../../../core/server/utils';
import { I18N_RC } from './constants';
import { getTranslationPaths } from './get_translation_paths';

export async function getKibanaTranslatoinPaths(config: Pick<KibanaConfig, 'get'>) {
export async function getKibanaTranslationPaths(config: Pick<KibanaConfig, 'get'>) {
return await Promise.all([
getTranslationPaths({
cwd: fromRoot('.'),
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/server/i18n/i18n_mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { i18n, i18nLoader } from '@kbn/i18n';
import { basename } from 'path';
import { Server } from 'hapi';
import type { UsageCollectionSetup } from '../../../plugins/usage_collection/server';
import { getKibanaTranslatoinPaths } from './get_kibana_translation_paths';
import { getKibanaTranslationPaths } from './get_kibana_translation_paths';
import KbnServer, { KibanaConfig } from '../kbn_server';
import { registerLocalizationUsageCollector } from './localization';

Expand All @@ -32,7 +32,7 @@ export async function i18nMixin(
) {
const locale = config.get('i18n.locale') as string;

const translationPaths = await getKibanaTranslatoinPaths(config);
const translationPaths = await getKibanaTranslationPaths(config);

const currentTranslationPaths = ([] as string[])
.concat(...translationPaths)
Expand Down

0 comments on commit b3f89eb

Please sign in to comment.