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

weblate.ini has no effect on Windows #715

Closed
2 tasks done
Karmalakas opened this issue Jan 19, 2025 · 4 comments · Fixed by WeblateOrg/weblate#13596
Closed
2 tasks done

weblate.ini has no effect on Windows #715

Karmalakas opened this issue Jan 19, 2025 · 4 comments · Fixed by WeblateOrg/weblate#13596
Assignees
Labels
bug Something is broken. documentation Improvements or additions to the documentation.

Comments

@Karmalakas
Copy link

Karmalakas commented Jan 19, 2025

Describe the issue

I was following instructions how and where to store config files. Specifically this:

.weblate, .weblate.ini, weblate.ini
Per project configuration file

C:\Users\NAME\AppData\weblate.ini
User configuration file on Windows.

<...>

Additionally API keys can be stored in the [keys] section:

[keys]
https://hosted.weblate.org/api/ = APIKEY

This allows you to store keys in your personal settings, while using the .weblate configuration in the VCS repository so that wlc knows which server it should talk to

So I have .weblate on my project root where I run wlc commands:

[weblate]
url = https://weblate.example.com/api/
translation = my-project

And I also have weblate.ini on C:\Users\NAME\AppData\:

[keys]
https://weblate.example.com/api/ = wlu_MY_KEY

Just to keep my keys separate..

And it doesn't work.
It works if I move [keys] from AppData/weblate.ini to project/.weblate

Also, if I move this part to /AppData/weblate.ini:

[weblate]
url = https://weblate.example.com/api/

then I get:

Request failed: HTTPConnectionPool(host='127.0.0.1', port=8000): Max retries exceeded with url: /api/projects/

I found this very old issue about wlc docs lacking info for Windows users and was thinking in my case there's also something undocumented, but I've no clue what's missing

I already tried

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

  1. Install wlc
  2. Add weblate.ini with [keys] to /AppData
  3. Add .weblate with [weblate] to /project/root
  4. Run wlc list-projects in project root

Expected behavior

Projects are listed

@nijel
Copy link
Member

nijel commented Jan 20, 2025

It seems that APPDATA (what Weblate uses) points to AppData\Roaming these days (see https://stackoverflow.com/a/13184486/225718). Can you try placing the configuration there?

@Karmalakas
Copy link
Author

Yes, moving to /Roaming did the trick 🙏 Thank you!
I see you made some changes in the code already, so I will leave at your discretion when to close this issue 🤔

nijel added a commit to nijel/weblate that referenced this issue Jan 20, 2025
Apparenly the default APPDATA location has changed over the years so the
documentation should adjust. Additionally wlc now supports LOCALAPPDATA.

Fixes WeblateOrg/wlc#715
@nijel nijel added the documentation Improvements or additions to the documentation. label Jan 20, 2025
@nijel nijel self-assigned this Jan 20, 2025
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

1 similar comment
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken. documentation Improvements or additions to the documentation.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants