Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
spicytigermeat authored Mar 17, 2024
1 parent f2d3d9b commit b462f2b
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# ez-localizr
Simple tool for easily localizing Python scripts by reading strings from YAML files.

ez-localizr is a simple tool for providing GUI/output translations for Python projects. It was originally developed to replace the need for i18n in a customTkinter GUI application.

ez-localizr accounts for Unicode issues using `ftfy`, and loads string definitions from `yaml` files in a directory of your choice. See the example below to learn how to use it!

## Installation:

```pip install ez-localizr```

## Simple Usage Guide:

```python
L = ezlocalizr(language='en_US', string_path: 'strings', default_lang='en_US')

text = L('test')

print(text)
```
Output: `Hello World!`

## Change Languages:

ez-localizr will only be able to display strings in languages that are in your string folder. If you have multiple, and would like to change it, call the `load_lang()` function. An example is listed below!

```python
L = ezlocalizr(language='en_US', string_path='strings', default_lang='en_US')

L.load_lang('fr_FR')
```

If you use this in tkinter, you will need to destroy the window and reinitialize it! (This is the best way I've discovered to update the display language of a GUI App.)

0 comments on commit b462f2b

Please sign in to comment.