feat: translate
π PR Description
This PR adds support for translating the profile bio and post captions in PixelFed, using Google Translate and DeepL as translation providers.
π· Screenshots
βοΈ Implementation Details
-
Supports two translation providers:
googleβ requires theGOOGLE_API_KEYenvironment variabledeeplβ requires theDEEPL_API_KEYenvironment variable
-
The feature is controlled by the following settings:
pixelfed.translation.enabled = trueenables the feature system-widepixelfed.translation.users_limited = truerestricts the feature to selected users
π§ To-Do
- Complete the admin panel UI to allow configuration through the dashboard
- ~~Implement translation button visibility control when:~~
- ~~
pixelfed.translation.enabled = false~~ - ~~The feature is disabled for the user~~
- ~~
- ~~Define a reliable way to hide the translate button when the feature is turned off~~
β Status
- [x] Functional translation for bio and captions
- [x] Integration with Google and DeepL providers
- [x] Reads from environment variables
- [ ] Admin interface pending
- [x] Button visibility logic not yet implemented
π Notes
The translation feature is currently functional but not yet finalized. Admin configuration and ~~conditional button visibility~~ still need to be completed for a polished user experience.
Any plans to add support for LibreTranslate? That's something you can selfhost.
https://libretranslate.com
https://github.com/LibreTranslate/LibreTranslate
Any plans to add support for LibreTranslate? That's something you can selfhost.
https://libretranslate.com
https://github.com/LibreTranslate/LibreTranslate
This is quite easy to implement, something like that.
i can make commit without test.
Any plans to add support for LibreTranslate? That's something you can selfhost. https://libretranslate.com https://github.com/LibreTranslate/LibreTranslate
This is quite easy to implement, something like that.
i can make commit without test.
That would be good i can test it if it works.
Any plans to add support for LibreTranslate? That's something you can selfhost. https://libretranslate.com https://github.com/LibreTranslate/LibreTranslate
This is quite easy to implement, something like that.
![]()
i can make commit without test.
That would be good i can test it if it works.
already implment
Any plans to add support for LibreTranslate? That's something you can selfhost. https://libretranslate.com https://github.com/LibreTranslate/LibreTranslate
This is quite easy to implement, something like that.
![]()
i can make commit without test.
That would be good i can test it if it works.
already implment
I tried it but it doesnt show translate option. Didn't work with Google Translate either so i am probably doing something wrong.
Any plans to add support for LibreTranslate? That's something you can selfhost. https://libretranslate.com https://github.com/LibreTranslate/LibreTranslate
This is quite easy to implement, something like that.
![]()
i can make commit without test.
That would be good i can test it if it works.
already implment
I tried it but it doesnt show translate option. Didn't work with Google Translate either so i am probably doing something wrong.
It could be a cache issue. Here, the translation option also takes a little while to appear because of configuration caching, especially if you're using Redis.
First, in your .env file, enable the feature by setting TRANSLATION_ENABLED to true. Then, clear the cache using the commands php artisan config:clear and php artisan cache:clear.
After that, refresh the page and check if the translation button appears.
If you're using Google Translate, set TRANSLATION_PROVIDER to google in your .env file and add your API key using the GOOGLE_API_KEY variable.
If you want to use LibreTranslate instead, set TRANSLATION_PROVIDER to libre, add your API key with LIBRE_API_KEY, and provide the API URL with LIBRE_API_URL (for example, https://libretranslate.de).
Also, donβt forget to clear your browser cache after doing all that. Once everything is in place, the translation button should show up and work correctly.

