From 0fdb365bb2d9e96f658afd9bf8b009b74889752d Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 12 Aug 2022 10:12:41 +0200 Subject: [PATCH] Custom locales added to readme --- README.md | 12 ++++++++++-- README_uk.md | 9 ++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eb6f847..0d43294 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # TelegramPoster +> Шукаєш інструкцію українською? А вона [ось тут](https://git.end-play.xyz/profitroll/TelegramPoster/src/branch/master/README_uk.md) знаходиться) + This bot is used for one and only task - post pictures from my personal archive. Here's its source code so you can also host a bot and have fun with it. Just don't exepect it to be brilliant. It is not. But hey, you can always fork it ;) -Шукаєш інструкцію українською? А вона [ось тут](https://git.end-play.xyz/profitroll/TelegramPoster/src/branch/master/README_uk.md) знаходиться) ## Installation To make this bot run at first you need to have a Python interpreter and git. Google is your friend finding it. You can also ignore git and simply download source code, should also work fine. After that you're ready to go. @@ -48,4 +49,11 @@ Of course bot also has them. You can perform some actions with them. Examples: * `python3 ./main.py --move-sent --norun` -* `python3 ./main.py --cleanup --confirm` \ No newline at end of file +* `python3 ./main.py --cleanup --confirm` + +## Localization +Bot is capable of using custom locales. There are some that are pre-installed (English and Ukrainian), however you can add your own locales too. + +All localization files are located in the `locale` folder, otherwise in folder specified in config file. Just copy locale file of your choice, name it in accordance to [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) (if you want your locale to be compatible with Telegram's locales) or define your own name. Save it as json and you're good to go. If you want to change default locale for console output and messages, that cannot determine admin's locale - edit `"locale"` parameter in the `config.json`. If this locale is not available - `"locale_fallback"` will be used instead. If both are not available - error will be shown. + +We recommend to only make changes to your custom locale. Or at least always have your backup of for example `en.json` as your fallback. \ No newline at end of file diff --git a/README_uk.md b/README_uk.md index 2eca61d..6f59672 100644 --- a/README_uk.md +++ b/README_uk.md @@ -47,4 +47,11 @@ Приклади: * `python3 ./main.py --move-sent --norun` -* `python3 ./main.py --cleanup --confirm` \ No newline at end of file +* `python3 ./main.py --cleanup --confirm` + +## Локалізація +Бот може використовувати різні мови. Є деякі попередньо встановлені (Англійська та Українська), однак Ви можете додавати свої власні локалізації теж. + +Всі файли локалізації знаходяться у папці `locale`, якщо в конфігураційному файлі не вказано іншу. Просто скопіюйте цікавлячий Вас файл, назвіть його відповідно до [тегів мови IETF](https://en.wikipedia.org/wiki/IETF_language_tag) (якщо Ви хочете, щоб переклад був сумісним з перекладами Telegram) або просто вкажіть свою власну назву. Збережіть свій переклад як json файл і все готово. Якщо ви хочете змінити мову за замовчуванням для виведення консолі та повідомлень самого бота, які не можуть визначити мову адміністратора, відредагуйте параметр `"locale"` у `config.json`. Якщо ця мова недоступна, замість неї буде використано `"locale_fallback"`. Якщо обидві мови недоступні - буде показано помилку. + +Ми рекомендуємо вносити будь-які зміни лише до вашої окремої мови. Або, принаймні, завжди мати резервну копію, наприклад, `en.json` як запасний варіант. \ No newline at end of file