HrRoadways is a comprehensive project designed to provide users with an intuitive platform to check bus routes, timings, and real-time updates for government bus services.
| Technology | Purpose |
|---|---|
| React + Vite | Frontend framework & build tooling |
| React Router | Client-side routing |
| i18next | Internationalization |
| Tailwind CSS | Utility-first styling |
| Framer Motion | Smooth, production-ready animations |
Keshav1605
Soumyosish
anjaliitgit
Aripilli-Bhavana
HrRoadways supports 13 Indian languages to serve users across India 🇮🇳
| Language | Code | Native Name |
|---|---|---|
| English | en | English |
| Hindi | hi | हिन्दी |
| Bengali | bn | বাংলা |
| Telugu | te | తెలుగు |
| Marathi | mr | मराठी |
| Tamil | ta | தமிழ் |
| Gujarati | gu | ગુજરાતી |
| Kannada | kn | ಕನ್ನಡ |
| Malayalam | ml | മലയാളം |
| Punjabi | pa | ਪੰਜਾਬੀ |
| Oriya | or | ଓଡ଼ିଆ |
| Assamese | as | অসমীয়া |
| Urdu | ur | اردو |
| Feature | Description |
|---|---|
| 🔤 Unicode Support | Handles multilingual text seamlessly |
| 🌐 Localization | Supports 13 Indian languages for wider reach |
| 🗂️ Language Files | Each language stored in separate JSON for scalability |
| ⚡ Fast Switching | Toggle between languages instantly |
| 🛠️ Easy Maintenance | Simple structure for adding new languages |
The project uses react-i18next for translations. Files are in src/i18n/locales/.
To add new translations:
- Update the appropriate file in
src/i18n/locales/ - Use the
useTranslationhook:const { t } = useTranslation(); - Reference translations with:
{t('key.subkey')}
HrRoadways/ ├── Databases/ │ └── State_Database/ ├── src/ │ ├── components/ │ └── assets/
- Json Database hosting link - https://jsonblob.com/api/jsonBlob/1333092652136194048
- Clone the repository:
git clone https://github.com/NishantRana07/HrRoadways.git
- Navigate to the project directory and install dependencies:
npm install
- Run the development server to access the site locally:
npm run dev
A centralized repository to store and manage information about popular places across various locations.
To add popular places to the repository, follow the format specified below:
Places/ ├── Location/ │ └── Location.json
{
"location": "City or Region Name",
"places": [
{
"name": "Place Name",
"category": "Category (e.g., Historical, Restaurant, Park, etc.)",
"description": "A brief description of the place.",
"latitude": "Latitude Coordinate",
"longitude": "Longitude Coordinate"
}
]
}Here is an example of how to add a location:
File: Places/NewYork/NewYork.json
{
"location": "New York",
"places": [
{
"name": "Central Park",
"category": "Park",
"description": "A large public park in New York City, featuring lakes, gardens, and walking trails.",
"latitude": "40.785091",
"longitude": "-73.968285"
},
{
"name": "Statue of Liberty",
"category": "Historical",
"description": "An iconic symbol of freedom and democracy located on Liberty Island.",
"latitude": "40.689247",
"longitude": "-74.044502"
}
]
}<h1 align="center">Contributing & Translation Guidelines</h1>
<h4 align="center">
Guidelines for contributing to the repository, ensuring Hindi translations, and keeping the codebase updated.
</h4>
## Contributing
If you are adding content to the site or creating new pages, please:
- Apply logic for Hindi translation and add translations for all words.
- Use PNG or JPG files for minimal size and always compress images.
- Ensure that your forked repository is up to date before submitting a pull request.
### Steps for Contributing
#### 1. Fork the Repository:
Click on the **Fork** button at the top right of the repository page.
#### 2. Clone the Forked Repository:
```bash
git clone https://github.com/your-username/HrRoadways.gitgit checkout -b your-branch-name- Apply the Hindi translation logic.
- Compress images before uploading.
git add .
git commit -m "Describe your changes"git push origin your-branch-nameGo to the original repository and click New Pull Request.
Before making a pull request, ensure that your forked repository is up to date.
git remote add upstream https://github.com/NishantRana07/HrRoadways.gitgit fetch upstreamgit checkout main
git merge upstream/maingit push origin mainBy following these steps, your pull request will be based on the latest code.
The HrRoadways project supports bilingual functionality (English & Hindi). This is achieved through translation logic built into components.
Each component maintains translations for both languages:
const translations = {
en: { heading: "Your English Heading" },
hi: { heading: "आपका हिंदी शीर्षक" },
};A state variable (isHindi) toggles between languages.
const [isHindi, setIsHindi] = useState(false);
const currentLanguage = isHindi ? translations.hi : translations.en;const handleToggleLanguage = () => setIsHindi(!isHindi);-
Define Translations:
const translations = { en: { description: "Your English Description" }, hi: { description: "आपका हिंदी विवरण" }, };
-
Use the Translations:
<p>{currentLanguage.description}</p>
const translations = {
en: {
heading: "Haryana Roadways - Your Own Bus Service",
button: "Search Buses",
},
hi: {
heading: "हरियाणा रोडवेज - आपकी अपनी बस सेवा",
button: "बसें खोजें",
},
};
const currentLanguage = isHindi ? translations.hi : translations.en;
return (
<div>
<h1>{currentLanguage.heading}</h1>
<button>{currentLanguage.button}</button>
</div>
);- Always apply translation logic for new content/pages.
- Use PNG/JPG files and compress images before uploading.
- Keep your fork updated before submitting PRs.
