This README.md file was created to guide contributors on how to contribute translations to the FreeGPT WebUI project. The translations are located in the translations
folder and are generated by babel-flask
.
To modify an existing translation, follow the steps below:
-
Inside the
translations
folder, you will find all existing translations in the project. -
Translate the strings in the
.po
file found within the folder of the language translation you want to modify.
The identifiers of the strings to be translated are in the formatmsgid "string"
and should be translated in themsgstr ""
field. For example:
msgid "New Conversation"
msgstr "Nova Conversa"
- Add your name and GitHub profile to the "Contributors" section at the beginning of the
.po
file. If there are already contributors, add your name to the list. For example:
# Portuguese (Brazil) translations for FreeGPT WebUI.
# Copyright (C) 2023 FreeGPT WebUI.
# This file is distributed under the same license as the FreeGPT WebUI
# project.
# Contributors:
# Ramon - github.com/ramonvc/
# Your Name - github.com/yourprofile/
# ...
- Create a pull request with the changes so we can review and incorporate them into the project.
To add a new language, follow the steps below:
-
Install
babel-flask
(if not already installed) using the commandpip install Flask-Babel
. -
Inside the project folder use the following code to generate the folder with the translation template, replacing LANGUAGE_CODE with the language code. Example: en_US
pybabel init -i ./translations/messages.pot -d translations -l LANGUAGE_CODE
- Translate the strings in the created
.po
file. The identifiers of the strings to be translated are in the formatmsgid "string"
and should be translated in themsgstr ""
field. For example:
msgid "New Conversation"
msgstr "Nova Conversa"
- Add your name and GitHub profile to the "Contributors" section at the beginning of the
.po
file. For example:
# Portuguese (Brazil) translations for FreeGPT WebUI.
# Copyright (C) 2023 FreeGPT WebUI.
# This file is distributed under the same license as the FreeGPT WebUI
# project.
# Contributors:
# Ramon - github.com/ramonvc/
# ...
- Create a pull request with the changes so we can review and incorporate them into the project.