@asafarim/shared-i18n 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/demo/package.json +1 -1
- package/demo/public/Icon Dropdown_Limited Languages.png +0 -0
- package/demo/public/Select Dropdown_Text Only.png +0 -0
- package/demo/src/App.tsx +4 -0
- package/demo/src/components/Logo.tsx +7 -0
- package/demo/src/index.css +37 -1
- package/demo/tsconfig.json +1 -1
- package/demo/vite-env.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Lightweight, simple translation module for any React + TypeScript app, built on top of i18next and react-i18next. It ships with sensible defaults (English and Dutch) but can support any language by adding JSON files to your locales folder.
|
|
4
4
|
|
|
5
|
+
* see Demo at: [https://alisafari-it.github.io/shared-i18n/](https://alisafari-it.github.io/shared-i18n/)
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- 🌍 Works in any React + TypeScript project (monorepo or standalone)
|
|
@@ -172,7 +174,9 @@ interface LanguageSwitcherProps {
|
|
|
172
174
|
|
|
173
175
|
- **buttons** — Individual buttons for each language (default)
|
|
174
176
|
- **select** — Native dropdown select element
|
|
177
|
+

|
|
175
178
|
- **icon-dropdown** — Custom dropdown showing flag emojis with language codes
|
|
179
|
+

|
|
176
180
|
|
|
177
181
|
### Examples
|
|
178
182
|
|
package/demo/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/demo/src/App.tsx
CHANGED
|
@@ -7,9 +7,12 @@ import StatusCard from './components/StatusCard'
|
|
|
7
7
|
import OverviewSection from './components/OverviewSection'
|
|
8
8
|
import GetStartedSection from './components/GetStartedSection'
|
|
9
9
|
import LanguageSwitcherDemo from './components/LanguageSwitcherDemo'
|
|
10
|
+
import Logo from './components/Logo'
|
|
10
11
|
|
|
11
12
|
type TabType = 'overview' | 'getStarted' | 'demo'
|
|
12
13
|
|
|
14
|
+
|
|
15
|
+
|
|
13
16
|
export default function App() {
|
|
14
17
|
const { t } = useTranslation('demo')
|
|
15
18
|
const [activeTab, setActiveTab] = useState<TabType>('overview')
|
|
@@ -17,6 +20,7 @@ export default function App() {
|
|
|
17
20
|
return (
|
|
18
21
|
<div className="app-container">
|
|
19
22
|
<header className="app-header">
|
|
23
|
+
<Logo />
|
|
20
24
|
<div className="header-content">
|
|
21
25
|
<h1>{t('title')}</h1>
|
|
22
26
|
<p className="subtitle">{t('subtitle')}</p>
|
package/demo/src/index.css
CHANGED
|
@@ -566,4 +566,40 @@ body {
|
|
|
566
566
|
opacity: 1;
|
|
567
567
|
max-height: 500px;
|
|
568
568
|
}
|
|
569
|
-
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.logo {
|
|
572
|
+
width: 70px;
|
|
573
|
+
height: 70px;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.logo img {
|
|
577
|
+
width: 100%;
|
|
578
|
+
height: 100%;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
/* Mobile adjustments */
|
|
584
|
+
@media (max-width: 768px) {
|
|
585
|
+
.logo {
|
|
586
|
+
width: 50px;
|
|
587
|
+
height: 50px;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/* Tablet adjustments */
|
|
592
|
+
@media (min-width: 769px) and (max-width: 1024px) {
|
|
593
|
+
.logo {
|
|
594
|
+
width: 60px;
|
|
595
|
+
height: 60px;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/* Desktop adjustments */
|
|
600
|
+
@media (min-width: 1025px) {
|
|
601
|
+
.logo {
|
|
602
|
+
width: 70px;
|
|
603
|
+
height: 70px;
|
|
604
|
+
}
|
|
605
|
+
}
|
package/demo/tsconfig.json
CHANGED
package/demo/vite-env.d.ts
CHANGED