Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create es.json #83

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files:
- source: /**/i18n/en/*.*
translation: /**/i18n/%two_letters_code%/%original_file_name%
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"test": "vitest",
"preview": "vite preview",
"extract": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file './extracted/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]'",
"extract-simple": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file './src/i18n/en.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple",
"extract-simple": "formatjs extract 'src/**/*.{ts,tsx}' --ignore='**/*.d.ts' --out-file 'src/i18n/en/test.json' --id-interpolation-pattern '[sha512:contenthash:base64:6]' --format simple",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"prepare": "husky"
Expand Down
2 changes: 1 addition & 1 deletion src/context/LanguageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { createContext, useContext, useState } from "react";
import { detectBrowserLanguage } from "@/utils";

import en from "@/i18n/en.json";
import en from "@/i18n/en/test.json";

const DEFAULT_LOCALE = "en";

Expand All @@ -20,7 +20,7 @@
setLocale: () => {},
});

export const useLanguage = () => useContext(LanguageContext);

Check warning on line 23 in src/context/LanguageContext.tsx

View workflow job for this annotation

GitHub Actions / test (v22.11.0)

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

Check warning on line 23 in src/context/LanguageContext.tsx

View workflow job for this annotation

GitHub Actions / test (v22.11.0)

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components

export default function LanguageProvider({
children,
Expand Down
File renamed without changes.
Loading