There are essentially two methods to grant Weblate access to your GitLab/GitHub repository.
1. Access via ssh key
On weblate:
- Create a new project (click on + "Add a new translation project").
- In your project, go to Manage -> API access -> copy your ssh key
On Gitlab:
- Navigate to your project -> settings -> repository -> Deploy keys ->
Add a title, your copied ssh key and grant write permissions to this key
Back to weblate:
- In your project -> Create a component
- Fill in all the required inputs...
Important points:
Version control system is Git
Source code repository: Your SSH link to your Gitlab like: ssh://git@gitlab...
Repository branch: add a branch created in your repository... .
Click on continue, add file format and both Repository push and push branch, use the same details as the Source code repository and Repository branch.
2. Access via token
On Your Gitlab Project
Go to repository -> settings -> access tokens
Add a token name, role, and at least read and write permissions.
Create the access token
As you create the token, a user will be generated for you...
Copy the access token.
Next, go to your repository's Members. You will see a new member was created with the name of the token you generated.
Copy the name after the @.
Also copy the HTTPS address of your repository
On Weblate:
Go to the project where you want to grant Gitlab access.
Create a component...
Follow the same configuration as with SSH. The difference is the Source code repository. You will now need to add the address like:
https://copied_weblate_name:copied_gitlab_token@gitlab_address_copied...
Now, for pushing changes from Weblate to Gitlab:
Open your weblate project, select a created component, add/edit some translation language. Click at the component again and navigate to Manage -> Repository mainenance and here you can commit and push.
Best luck!