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

treewide: Add a link to Weblate #7496

Merged
merged 1 commit into from
Dec 24, 2024
Merged

treewide: Add a link to Weblate #7496

merged 1 commit into from
Dec 24, 2024

Conversation

stokito
Copy link
Contributor

@stokito stokito commented Dec 22, 2024

To help users to find a right place where to translate.

Because some users trying to edit the po files directly. This also should be acceptable because we shouldn't force users to register on a third party tool and learn it.

Ideally we should add a link to translations, github and dourm into the Luci itself. This must increase contributions from regular users.

To help users to find a right place where to translate.

Signed-off-by: Sergey Ponomarev <[email protected]>
@Self-Hosting-Group
Copy link

Just noticed: Source string location and Translation file are not linked correctly in weblate.

@stokito
Copy link
Contributor Author

stokito commented Dec 23, 2024 via email

@Self-Hosting-Group
Copy link

In String information sidebar?

@stokito
Copy link
Contributor Author

stokito commented Dec 23, 2024 via email

@Self-Hosting-Group
Copy link

Are you talking about the weblate itself? If something wrong there you may report to the Weblate on their github

No, I think it's the configuration of OpenWrt. Have a look at this:

https://hosted.weblate.org/translate/openwrt/luciapplicationsupnp/en_devel/?q=

@hnyman
Copy link
Contributor

hnyman commented Dec 23, 2024

And what is wrong there?
(You can't translate source strings, which Weblate shows as developer English.)

Looks ok to me:
image

EDIT:
I now noticed that the source location info on the right is ok, but the underlying URL seems like a template, not really clickable.

@hnyman
Copy link
Contributor

hnyman commented Dec 23, 2024

Looks like weblate applies a global default link from somewhere for all apps:
https://github.com/openwrt/luci/blob/%7Bbranch%7D/%7Bfilename%7D#L{line}

The template link has actually a single { instead of double {{, and first two instances are escaped via % sign, while the last one is a hardcoded {

while it should be
https://github.com/openwrt/luci/blob/master/{{filename}}#L{{line}}

image

I fixed manually upnp, so the link there should now work.

But the same "Repository browser" field is empty for all other 100 translatable apps, and the wrong global default just pops from somewhere.
I haven't yet found any global setting for that.

Ps. we haven't set the translation branch setting separately for each app, so weblate uses the git default, in practice master.

@hnyman
Copy link
Contributor

hnyman commented Dec 23, 2024

Documenting here that I think that I fixed the Source string location links by setting the Repository browser setting in luci-base app.
https://github.com/openwrt/luci/blob/{{branch}}/{{filename}}#L{{line}}

luci-base is apparently the underlying root app in weblate config, so some of the changes made to it will also affect the other apps unless overridden by the app settings. Good to remember in future.

@hnyman
Copy link
Contributor

hnyman commented Dec 23, 2024

@stokito
Back to the original idea of this PR:
Why your proposed link addition has the "?utm_source=widget" part?
It is https://hosted.weblate.org/engage/openwrt/?utm_source=widget
instead of the plain link https://hosted.weblate.org/engage/openwrt/ ?

@stokito
Copy link
Contributor Author

stokito commented Dec 23, 2024

To make the link same as used in the widget image link bellow. This is not important at all.

@systemcrash systemcrash merged commit 527acd5 into openwrt:master Dec 24, 2024
3 checks passed
@systemcrash
Copy link
Contributor

Merged. Thanks @stokito

@stokito stokito deleted the weblat branch December 24, 2024 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants