From 1d15da9b2860d16fa9861b677890fc1a85beecff Mon Sep 17 00:00:00 2001 From: tyler <103609620+spicytigermeat@users.noreply.github.com> Date: Sun, 17 Mar 2024 17:02:20 -0500 Subject: [PATCH] Update README.md --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 8031606..53075c4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ ez-localizr accounts for Unicode issues using `ftfy`, and loads string definitio ## Simple Usage Guide: +I recommend using 'L' because helps to keep typing to a minimum, but you can use whatever variable name you'd like. + ```python import ezlocalizr L = ezlocalizr(language='en_US', string_path: 'strings', default_lang='en_US') @@ -32,3 +34,21 @@ 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.) + +## Get a list of all available languages + +```python +import ezlocalizr +L = ezlocalizr(language='en_US', string_path='strings', default_lang='en_US') + +language_list = L.lang_list +print(language_list) +``` + +Output: `['en_US', 'fr_FR', 'jp_JP']` (assuming you have these 3 files in the string folder.) + +## Best Practices: + +- Use local names to define your languages, for the sake of consistency. (It also looks nicer and helps other developers understand your code!) + +