Skip to content

Commit

Permalink
[FIX] i18 bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ismoilovdevml committed Jan 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 394dbaa commit 84806bd
Showing 64 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion components/core/Tutorial/Header.tsx
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { useRouter } from 'next/router';

import React, { useEffect, useState } from 'react';

import tutorials from 'pages/tutorials/article/_meta.en-US.json';
import tutorials from 'pages/tutorials/article/_meta.en-UZ.json';

import { JsonLd, Tutorial } from 'types/tutorial';

4 changes: 2 additions & 2 deletions components/react/docs/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useRouter } from 'next/router';

const TITLE_WITH_TRANSLATIONS: Record<string, string> = {
'en-US': 'livepeer.js',
'en-UZ': 'livepeer.js',
};

export function Header() {
const { locale, defaultLocale = 'en-US' } = useRouter();
const { locale, defaultLocale = 'en-UZ' } = useRouter();
const resolvedLocale = locale || defaultLocale;
const title = TITLE_WITH_TRANSLATIONS[resolvedLocale];

4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -12,8 +12,8 @@ const withNextra = require('nextra')({
/** @type {import('next').NextConfig} */
const config = {
i18n: {
locales: ['en-US'],
defaultLocale: 'en-US',
locales: ['en-UZ'],
defaultLocale: 'en-UZ',
},
reactStrictMode: true,
typescript: {
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Card';
import guides from './ci-cd/_meta.en-US.json';
import guides from './ci-cd/_meta.en-UZ.json';

# CI/CD

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Card';
import guides from './database/_meta.en-US.json';
import guides from './database/_meta.en-UZ.json';

# Database

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pages/guides/k8s.en-US.mdx → pages/guides/k8s.en-UZ.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Card';
import guides from './k8s/_meta.en-US.json';
import guides from './k8s/_meta.en-UZ.json';

# Kubernetes (k8s)

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Card';
import guides from './konteyner/_meta.en-US.json';
import guides from './konteyner/_meta.en-UZ.json';

# Konteynerlash

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Tab, Tabs } from 'nextra-theme-docs';
import Card, { Cards } from '@components/core/Card';
import cicdGuides from './ci-cd/_meta.en-US.json';
import konteynerGuides from './konteyner/_meta.en-US.json';
import k8sGuides from './k8s/_meta.en-US.json';
import databaseGuides from './database/_meta.en-US.json';
import webserverGuides from './web-server/_meta.en-US.json';
import cicdGuides from './ci-cd/_meta.en-UZ.json';
import konteynerGuides from './konteyner/_meta.en-UZ.json';
import k8sGuides from './k8s/_meta.en-UZ.json';
import databaseGuides from './database/_meta.en-UZ.json';
import webserverGuides from './web-server/_meta.en-UZ.json';

# Qo'llanmalar

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Card';
import guides from './web-server/_meta.en-US.json';
import guides from './web-server/_meta.en-UZ.json';

# Web Server

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Tutorial/Card';
import developingGuides from './article/_meta.en-US.json';
import developingGuides from './article/_meta.en-UZ.json';

## Barcha Dokumentatsiyalar

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card, { Cards } from '@components/core/Tutorial/Card';
import developingGuides from './article/_meta.en-US.json';
import developingGuides from './article/_meta.en-UZ.json';

## Barcha Dokumentatsiyalar

10 changes: 5 additions & 5 deletions theme.config.tsx
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@ import { GithubSponsors } from '@components/icons/github-sponsors';
const github = 'https://github.com/ismoilovdevml/devops-journey';

const TITLE_WITH_TRANSLATIONS = {
'en-US': 'DevOps Journey',
'en-UZ': 'DevOps Journey',
} as const;

const EDIT_LINK_WITH_TRANSLATIONS = {
'en-US': "GitHub-da o'zgartirish ",
'en-UZ': "GitHub-da o'zgartirish ->",
} as const;

import { DocsThemeConfig, useConfig, useTheme } from 'nextra-theme-docs';
@@ -87,7 +87,7 @@ const config: DocsThemeConfig = {
: frontMatter?.image || '/banner.png';
const folder = theme === 'light' ? '/light' : '/dark';

const composedTitle = `${title} DevOps Journey`;
const composedTitle = `${title} - DevOps Journey`;

return (
<>
@@ -173,14 +173,14 @@ const config: DocsThemeConfig = {
<>
{
EDIT_LINK_WITH_TRANSLATIONS[
(locale as keyof typeof EDIT_LINK_WITH_TRANSLATIONS) ?? 'en-US'
(locale as keyof typeof EDIT_LINK_WITH_TRANSLATIONS) ?? 'en-UZ'
]
}
</>
);
},
},
i18n: [{ locale: 'en-US', text: 'English' }],
i18n: [{ locale: 'en-UZ', text: 'O\'zbek' }],
gitTimestamp: ({ timestamp }) => (
<>Last updated on {timestamp.toLocaleDateString()}</>
),

0 comments on commit 84806bd

Please sign in to comment.