Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internationalization.py line 38 #90

Open
Sh1vam opened this issue Sep 25, 2020 · 10 comments
Open

internationalization.py line 38 #90

Sh1vam opened this issue Sep 25, 2020 · 10 comments

Comments

@Sh1vam
Copy link

Sh1vam commented Sep 25, 2020

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
Copy link

DO97 commented Oct 2, 2020

More specifically, when this happens?

@Sh1vam
Copy link
Author

Sh1vam commented Oct 6, 2020

More specifically, when this happens?

when i was trying to run it on my PC

@retiolus
Copy link
Contributor

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
Copy link
Owner

jh0ker commented Mar 12, 2021

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

@retiolus
Copy link
Contributor

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

Yes

@jh0ker
Copy link
Owner

jh0ker commented Mar 14, 2021

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
Copy link
Contributor

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
Copy link

jofg123 commented Mar 25, 2021

Same issue in compiling

@jofg123
Copy link

jofg123 commented Mar 25, 2021

It didn't work the compile.sh

@DO97
Copy link

DO97 commented Jul 12, 2022

I'm not having any issue following the instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants