r-devel / translations

subsite for translations
https://contributor.r-project.org/translations/
Creative Commons Attribution 4.0 International
1 stars 3 forks source link

Hyperlink source string location #5

Closed daroczig closed 1 year ago

daroczig commented 1 year ago

Currently, weblate only shows the source code location (file name + line number), see e.g. https://translate.rx.studio/translate/r-project/base-r-gui/de/?&offset=3

Image

It would be much nicer if that would point to the actual source code hosted only, e.g. git clone of the SVN repo

MichaelChirico commented 1 year ago

Would the goal be to support this for R strings too, or only for strings where the location is already recorded in the .pot file?

daroczig commented 1 year ago

I think for this ticket the goal is limited to making the hyperlink when the line number is provided in the PO(T) files.

On the other hand, that's a very good point @MichaelChirico - although I think that will require a patch to tools::xgettext.

daroczig commented 1 year ago

Fixed this by specifying https://github.com/r-devel/r-svn/blob/{{branch}}/{{filename}}#L{{line}} as the repo browser at the Version control settings, and seems to work, see e.g. https://translate.rx.studio/translate/r-project/base-c/it/?checksum=7f3717e6f61f4977&q=%22error+in+running+command%22&sort_by=-priority%2Cposition

image

The source string locations click out to @r-devel/r-svn, e.g. https://github.com/r-devel/r-svn/blob/master/src/appl/optim.c#L60