jh0ker / mau_mau_bot

Telegram Bot that allows you to play Mau Mau (UNO) via inline queries
GNU Affero General Public License v3.0
312 stars 231 forks source link

internationalization.py line 38 #90

Open Sh1vam opened 4 years ago

Sh1vam commented 4 years ago

it gives error of this type:

\mau_mau_bot-master\internationalization.py", line 38, in open(gettext.find( TypeError: expected str, bytes or os.PathLike object, not NoneType

the code is: def init(self): self.translators = { locale: gettext.GNUTranslations( open(gettext.find( GETTEXT_DOMAIN, GETTEXT_DIR, languages=[locale] ), 'rb') ) for locale in available_locales.keys() if locale != 'en_US' # No translation file for en_US } self.locale_stack = list()

DO97 commented 4 years ago

More specifically, when this happens?

Sh1vam commented 4 years ago

More specifically, when this happens?

when i was trying to run it on my PC

retiolus commented 3 years ago

same issue here

python3 bot.py
Traceback (most recent call last):
  File "bot.py", line 30, in <module>
    import settings
  File "/home/pi/unoplusbot/mau_mau_bot/settings.py", line 24, in <module>
    from utils import send_async
  File "/home/pi/unoplusbot/mau_mau_bot/utils.py", line 25, in <module>
    from internationalization import _, __
  File "/home/pi/unoplusbot/mau_mau_bot/internationalization.py", line 81, in <module>
    _ = _Underscore()
  File "/home/pi/unoplusbot/mau_mau_bot/internationalization.py", line 43, in __init__
    in available_locales.keys()
  File "/home/pi/unoplusbot/mau_mau_bot/internationalization.py", line 44, in <dictcomp>
    if locale != 'en_US'  # No translation file for en_US
TypeError: expected str, bytes or os.PathLike object, not NoneType
jh0ker commented 3 years ago

did you follow the instructions in the readme, specifically about compiling the translation files?

retiolus commented 3 years ago

did you follow the instructions in the readme, specifically about compiling the translation files?

Yes

jh0ker commented 3 years ago

This error usually happens if you're missing a .mo file for one or more of your translations. Confirm that you have a .mo file for every .po file, eg. locales/de_DE/LC_MESSAGES/unobot.mo. If you added custom translations, they have to be added in the locales/compile.sh script.

I suggest you ensure you're not missing any commits from this repos master branch and re-compile all translations, eg.

cd locales
./compile.sh
retiolus commented 3 years ago

compile.sh didn't work for me, made it with the full command... problem fixed! Wasn't executing the command inside the locales folder.

jofg123 commented 3 years ago

Same issue in compiling

jofg123 commented 3 years ago

It didn't work the compile.sh

DO97 commented 2 years ago

I'm not having any issue following the instructions.