alfg / guildbit

:sound: Mumble Hosting Platform
https://guildbit.com
56 stars 8 forks source link

Issue with Translation and Admin #24

Closed Lumiahna closed 8 years ago

Lumiahna commented 8 years ago

Hi, First of all, I want to thank you for your awesome project, you did a great job (: . I have some issues with Translation: My website is in english only, or If I visit guildbit.com, your website appears in French . I tried to add 'fr' : French or Français on setting.py but it doesn't work.

My second problem is how Can I set my steam account as admin ?

Thank you again, Cheers, Lumia

alfg commented 8 years ago

Hi @Lumiahna, thanks for the kind words!

1) For the translation issue, I only store the .po files since that's considered the source. You just need to run the following command from the project root:

pybabel compile -f -d app/translations

This will compile the .po files into .mo, which are an optimized version of the translation to be used by the application. The activated languages in settings.py should work based on the browser's language settings. Or you can just set the cookie: language to fr.

This is the guide and library I used for the app which goes into more detail if interested: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiv-i18n-and-l10n


2) To set your account as admin, log into your database and set the user's account role to 1. 1 is an admin account. You should then be able to access the /admin route.

If your account is the first registered, then this should do it:

UPDATE user SET role = 1 WHERE id = 1;

Sorry for the lack of documentation on these two points. I should probably update the Readme soon. :)

-Alf