An open API service indexing awesome lists of open source software.

https://github.com/ysskrishna/python-i18n-showcase

A demonstration of internationalization (i18n) features in Python, showcasing multiple language support, pluralization rules, and string interpolation.
https://github.com/ysskrishna/python-i18n-showcase

currency-formatting date-time-formatting i18n internationalization json l10n localization localize python string-interpolation translation

Last synced: 4 months ago
JSON representation

A demonstration of internationalization (i18n) features in Python, showcasing multiple language support, pluralization rules, and string interpolation.

Awesome Lists containing this project

README

        

# python-i18n-showcase

A demonstration of internationalization (i18n) features in Python, showcasing multiple language support, pluralization rules, and string interpolation.

## Features

- 🌐 Multi-language support (English, Spanish, Chinese)
- 📝 Pluralization rules demonstration
- 🔄 String interpolation with variables
- 📅 Date and time formatting
- 💰 Currency formatting
- 📦 Simple and clean implementation using Python i18n package
- 📝 Translation files are in JSON format
- Extendible to more languages

## Installation

1. Clone the repository:
```bash
git clone https://github.com/ysskrishna/python-i18n-showcase.git
cd python-i18n-showcase
```

2. Create and activate a virtual environment (recommended):
```bash
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
```

3. Install dependencies:
```bash
pip install -r requirements.txt
```

## Usage

Run the demonstration:
```bash
python app.py
```

## Project Structure

```
.
├── app.py # Main application file
├── translations/ # Translation files
│ ├── en.json # English translations
│ ├── es.json # Spanish translations
│ └── zh.json # Chinese translations
├── output.log # Log file containing console output
├── requirements.txt # Project dependencies
└── README.md # This file
```

## Contributing

Contributions are welcome! Feel free to:
- Add more language support
- Improve translation structures
- Add more complex pluralization rules
- Enhance documentation

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

**Author:** [ysskrishna](https://github.com/ysskrishna)