Skip to content

Commit 0a0c24d

Browse files
committed
add docusaurus
1 parent bec8386 commit 0a0c24d

260 files changed

Lines changed: 26366 additions & 27206 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
_site/
2-
.sass-cache
3-
Gemfile.lock
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

Gemfile

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.

README.md

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,80 @@
1-
# Galio Framework official website
2-
Galio's official website is open source and a tool for and by the community. Submit isseus and pull requests for site ideas or copy edits.
1+
# Galio
32

4-
## Under the Hood
3+
Galio is cool
54

6-
The site is made with Jekyll, an open source static site generator. This means Jekyll takes the content we want te be on the site and turns them into HTML files automatically. GitHub provides free hosting for repositories, called GitHub pages, and that's how the site is hosted.
5+
Galio is a React Native framework that provides pre-built components and beautiful cross-platform templates to speed up your mobile app development. This documentation site is built with Docusaurus.
76

8-
## Contributing
7+
## Features
98

10-
If you see an error or a place where content should be updated or improved, just fork this repository to your account, make the change you'd like and then submit a pull request. If you're not able to make the change, file an [issue](https://github.com/galio-org/galio-org.github.io/issues/new).
9+
* **Rich set of customizable components:** Accordion, Block, Button, Card, Checkbox, DeckSwiper, Icon, Input, Navbar, Radio, Slider, Switch, Text, ToastNotification
10+
* **Comprehensive documentation:** Detailed guides and API references for each component.
11+
* **Examples:** Ready-to-use examples to showcase the usage of different components.
12+
* **Easy to get started:** Simple installation and setup process.
13+
* **Internationalization:** Supports multiple languages (English and Spanish).
1114

12-
----
15+
## Getting Started
1316

14-
## To Set up Locally
17+
### Installation
1518

16-
You can take all the files of this site and run them just on your computer as if it were live online, only it's just on your machine.
19+
```bash
20+
yarn
21+
```
22+
23+
or
24+
25+
```bash
26+
npm
27+
```
28+
29+
### Local Development
30+
31+
```bash
32+
yarn start
33+
```
34+
35+
or
36+
37+
```bash
38+
npm start
39+
```
40+
41+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1742

18-
#### Requirements
43+
## Build
1944

20-
* [Jekyll](http://jekyllrb.com/)
21-
* [Ruby](https://www.ruby-lang.org/en/)
22-
* [Git](http://git-scm.com/)
45+
```bash
46+
yarn build
47+
```
48+
49+
or
50+
51+
```bash
52+
npm run build
53+
```
54+
55+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
56+
57+
## Deployment
2358

24-
After installing all dependencies, clone the repository and run the following commands:
59+
Using SSH:
2560

2661
```bash
27-
gem install bundler # first time only
28-
bundle install # first time only
29-
bundle exec jekyll serve
62+
USE_SSH=true yarn deploy
3063
```
31-
Open `http://localhost:4000` in your browser
3264

33-
----
65+
Not using SSH:
66+
67+
```bash
68+
GIT_USER=<Your GitHub username> yarn deploy
69+
```
70+
71+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
72+
73+
## License
74+
75+
[MIT](LICENSE)
76+
77+
## Links
3478

35-
Don't see what you're looking for? Create an [issue](https://github.com/galio-org/galio-org.github.io/issues/new), we'll do our best to help you out.
79+
* [Starter Kit](https://github.com/galio-org/galio-starter-kit)
80+
* [GitHub Repository](https://github.com/galio-org/galio-org.github.io)

TRANSLATION_GUIDE.md

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# Galio Translation Guide
2+
3+
This guide explains how to manage translations for the Galio Docusaurus project.
4+
5+
## Current Setup
6+
7+
The project is configured with:
8+
- **Default locale**: English (`en`)
9+
- **Additional locale**: Spanish (`es`)
10+
- **Translation system**: Custom hook-based translations
11+
12+
## File Structure
13+
14+
```
15+
├── src/
16+
│ ├── i18n/
17+
│ │ └── translations.ts # Translation keys and values
18+
│ ├── hooks/
19+
│ │ └── useTranslations.ts # Custom hook for translations
20+
│ ├── pages/ # Original English pages
21+
│ └── components/ # Components (shared)
22+
├── i18n/
23+
│ └── es/
24+
│ └── docusaurus-plugin-content-pages/ # Spanish page translations
25+
└── docusaurus.config.ts # i18n configuration
26+
```
27+
28+
## How to Use Translations
29+
30+
### 1. In Components
31+
32+
```tsx
33+
import { useTranslations } from '../hooks/useTranslations';
34+
35+
export default function MyComponent() {
36+
const { t } = useTranslations();
37+
38+
return (
39+
<div>
40+
<h1>{t('hero.title')}</h1>
41+
<p>{t('hero.description')}</p>
42+
</div>
43+
);
44+
}
45+
```
46+
47+
### 2. Adding New Translation Keys
48+
49+
1. **Add to `src/i18n/translations.ts`**:
50+
51+
```typescript
52+
export const translations = {
53+
en: {
54+
// ... existing translations
55+
newSection: {
56+
title: "English Title",
57+
description: "English description"
58+
}
59+
},
60+
es: {
61+
// ... existing translations
62+
newSection: {
63+
title: "Título en Español",
64+
description: "Descripción en español"
65+
}
66+
}
67+
};
68+
```
69+
70+
2. **Use in components**:
71+
72+
```tsx
73+
{t('newSection.title')}
74+
{t('newSection.description')}
75+
```
76+
77+
### 3. Creating Translated Pages
78+
79+
For each page in `src/pages/`, create a corresponding file in:
80+
`i18n/es/docusaurus-plugin-content-pages/`
81+
82+
Example:
83+
- Original: `src/pages/examples.tsx`
84+
- Spanish: `i18n/es/docusaurus-plugin-content-pages/examples.tsx`
85+
86+
### 4. Adding New Locales
87+
88+
1. **Update `docusaurus.config.ts`**:
89+
90+
```typescript
91+
i18n: {
92+
defaultLocale: 'en',
93+
locales: ['en', 'es', 'fr'], // Add new locale
94+
},
95+
```
96+
97+
2. **Create translation structure**:
98+
99+
```bash
100+
mkdir -p i18n/fr/docusaurus-plugin-content-pages
101+
```
102+
103+
3. **Add translations to `translations.ts`**:
104+
105+
```typescript
106+
export const translations = {
107+
en: { /* English translations */ },
108+
es: { /* Spanish translations */ },
109+
fr: { /* French translations */ }
110+
};
111+
```
112+
113+
## Current Translation Keys
114+
115+
### Hero Section (`hero.*`)
116+
- `waitOver` - "The wait is Over."
117+
- `galioHere` - "Galio is Here"
118+
- `description` - Hero description
119+
- `startBuilding` - "Start Building"
120+
- `learnMore` - "Learn More →"
121+
122+
### Examples Page (`examples.*`)
123+
- `title` - "Made with Galio"
124+
- `subtitle` - "Explore Examples made with Galio-framework"
125+
- `github` - "Github"
126+
- `documentation` - "Documentation"
127+
- `releases` - "Releases"
128+
- `stars` - "Stars"
129+
- `fork` - "Fork"
130+
- `sponsor` - "Sponsor"
131+
- `chat` - "Chat"
132+
133+
### Navigation (`nav.*`)
134+
- `getStarted` - "Get Started"
135+
- `starterKit` - "Starter Kit"
136+
- `components` - "Components"
137+
- `examples` - "Examples"
138+
139+
### Footer (`footer.*`)
140+
- `docs` - "Docs"
141+
- `galioDocs` - "Galio Docs"
142+
- `community` - "Community"
143+
- `previewExpo` - "Preview on Expo"
144+
- `downloadExpo` - "Download on Expo Client"
145+
- `scanToView` - "Scan to view on your phone"
146+
- `downloadApp` - "Download App"
147+
- `copyright` - Copyright text
148+
- `communityText` - Community description
149+
150+
## Best Practices
151+
152+
1. **Use descriptive keys**: `hero.title` instead of just `title`
153+
2. **Group related translations**: All hero-related text under `hero.*`
154+
3. **Keep translations consistent**: Use the same terminology across components
155+
4. **Test both languages**: Always test your changes in both English and Spanish
156+
5. **Fallback gracefully**: The system falls back to English if a translation is missing
157+
158+
## Running the Development Server
159+
160+
```bash
161+
# Start development server
162+
npm run start
163+
164+
# Start with Spanish locale
165+
npm run start -- --locale es
166+
167+
# Build for production
168+
npm run build
169+
170+
# Build for specific locale
171+
npm run build -- --locale es
172+
```
173+
174+
## Adding More Components
175+
176+
To translate additional components:
177+
178+
1. **Identify hardcoded text** in the component
179+
2. **Add translation keys** to `translations.ts`
180+
3. **Update the component** to use `useTranslations()`
181+
4. **Test** in both languages
182+
183+
## Common Patterns
184+
185+
### Dynamic Content
186+
```tsx
187+
// For content that includes variables
188+
const { t } = useTranslations();
189+
const year = new Date().getFullYear();
190+
const copyright = t('footer.copyright').replace('{year}', year.toString());
191+
```
192+
193+
### Conditional Translations
194+
```tsx
195+
// For different text based on conditions
196+
const buttonText = isLoggedIn ? t('nav.logout') : t('nav.login');
197+
```
198+
199+
## Troubleshooting
200+
201+
### Translation Not Showing
202+
1. Check if the key exists in `translations.ts`
203+
2. Verify the key path is correct (e.g., `hero.title`)
204+
3. Ensure the component is using `useTranslations()`
205+
206+
### Locale Not Switching
207+
1. Check `docusaurus.config.ts` i18n configuration
208+
2. Verify the locale dropdown is in the navbar
209+
3. Clear browser cache and restart dev server
210+
211+
### Build Errors
212+
1. Ensure all translation keys exist for all locales
213+
2. Check for syntax errors in translation files
214+
3. Verify file paths in i18n directory structure
215+
216+
## Next Steps
217+
218+
1. **Translate remaining components**: Continue adding translations to other components
219+
2. **Add more locales**: Consider adding French, German, or other languages
220+
3. **Translate documentation**: Set up translations for the docs section
221+
4. **Add translation management**: Consider using a translation management system for larger projects

_config.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)