Skip to content

Commit

Permalink
fix translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Dec 17, 2021
1 parent c39d463 commit d7a5733
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions packages/docusaurus-theme-translations/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import path from 'path';
import fs from 'fs-extra';

function getDefaultLocalesDirPath(): string {
const parentDirPath = path.join(__dirname, '..');
const pkg = JSON.parse(
fs.readFileSync(path.join(parentDirPath, 'package.json'), 'utf8'),
);
return path.join(parentDirPath, pkg.files[0]);
return path.join(__dirname, '../locales');
}

// Return an ordered list of locales we should try
Expand Down
3 changes: 1 addition & 2 deletions packages/docusaurus-theme-translations/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ const {extractThemeCodeMessages} = require('./update');
const path = require('path');
const fs = require('fs-extra');
const {mapValues, pickBy} = require('lodash');
const pkg = require('./package.json');

// Seems the 5s default timeout fails sometimes
jest.setTimeout(15000);

describe('theme-translations package', () => {
test(`to have base messages files contain EXACTLY all the translations extracted from the theme. Please run "yarn workspace @docusaurus/theme-translations update" to keep base messages files up-to-date.`, async () => {
const baseMessagesDirPath = path.join(__dirname, pkg.files[0], 'base');
const baseMessagesDirPath = path.join(__dirname, 'locales/base');
const baseMessages = pickBy(
await fs
.readdirSync(baseMessagesDirPath)
Expand Down

0 comments on commit d7a5733

Please sign in to comment.