mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
refactor(v2): simplify code by removing wip i18n & translation (#1431)
* refactor(v2): remove i18n & versioning + cleaner code * totally remove i18n and versioning from plugin
This commit is contained in:
parent
0813920349
commit
373d17ee72
123 changed files with 170 additions and 4162 deletions
|
@ -113,7 +113,7 @@ describe('load utils', () => {
|
|||
test('idx', () => {
|
||||
const a = {};
|
||||
const b = {hello: 'world'};
|
||||
const env = {
|
||||
const obj = {
|
||||
translation: {
|
||||
enabled: true,
|
||||
enabledLanguages: [
|
||||
|
@ -139,13 +139,13 @@ describe('load utils', () => {
|
|||
expect(idx(a, [('b', 'c')])).toBeUndefined();
|
||||
expect(idx(b, ['hello'])).toEqual('world');
|
||||
expect(idx(b, 'hello')).toEqual('world');
|
||||
expect(idx(env, 'typo')).toBeUndefined();
|
||||
expect(idx(env, 'versioning')).toEqual({
|
||||
expect(idx(obj, 'typo')).toBeUndefined();
|
||||
expect(idx(obj, 'versioning')).toEqual({
|
||||
enabled: false,
|
||||
versions: [],
|
||||
});
|
||||
expect(idx(env, ['translation', 'enabled'])).toEqual(true);
|
||||
expect(idx(env, ['translation', variable]).map(lang => lang.tag)).toEqual([
|
||||
expect(idx(obj, ['translation', 'enabled'])).toEqual(true);
|
||||
expect(idx(obj, ['translation', variable]).map(lang => lang.tag)).toEqual([
|
||||
'en',
|
||||
'ja',
|
||||
]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue