Metadata-Version: 2.1
Name: i18nTool
Version: 0.1.0
Summary: A Simple and lightweight Python internationalization (i18n) tool.
Author-Email: weinibuliu <weinibuliu@outlook.com>
License: MIT
Project-URL: Repository, https://github.com/weinibuliu/python-i18nTool
Requires-Python: >=3.9
Requires-Dist: pyyaml
Description-Content-Type: text/markdown

<div align="center">

# Python-i18nTool
**[简体中文](./README.md) | [English](./README_en.md)**

**简单且轻便的 Python 国际化 (i18n) 工具。**
</div>

## 安装
```
pip install i18nTool
```

## 使用
首先，在工作目录下建立 `translation` 文件夹，创建对应语言的 json/yaml/yml 文件。
```yaml
# ./translation/zh_CN.yml
test: 测试

# ./translation/en_US.yml
test: Test
```

```python
# ./test.py
from i18nTool import I18n

i18n = I18n(langs=["zh_CN","en_US"],file_type="yml")

i18.lang = "zh_CN"
i18n.get("test") # '测试'

i18n.lang = "en_US"
i18.get("test") # 'Test'

i18n.get("test2") # 'test2'
i18n.get("test2", use_default_text=True) # 'Undefined'

i18m.default_text = "Another Value"
i18n.get("test2", use_default_text=True) # 'Another Value'
```

## 许可证
Python-i18nTool 使用 MIT 许可证发布。请查看 **[LICENSE](./LICENSE)** 文件了解相关信息。

## 鸣谢
### 开源项目
- **[PyYAML](https://github.com/yaml/pyyaml)**\
A full-featured YAML processing framework for Python