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

"master" is dropped from repository browser links #6347

Closed
1 task done
gunchleoc opened this issue Jul 28, 2021 · 6 comments
Closed
1 task done

"master" is dropped from repository browser links #6347

gunchleoc opened this issue Jul 28, 2021 · 6 comments
Assignees
Labels
documentation Improvements or additions to the documentation. enhancement Adding or requesting a new feature.
Milestone

Comments

@gunchleoc
Copy link

Describe the issue

I can't configure the repository browser to correctly link to lines in GitHub

For example, I am trying to link to:

https://github.com/mltframework/shotcut/blob/master/src/qml/filters/time_remap/ui.qml#L103

but all I get is
https://github.com/mltframework/shotcut/blob/src/qml/filters/time_remap/ui.qml#L103

I already tried

Describe the steps you tried to solve the problem yourself.

  • I've read and searched the docs and did not find the answer there.
  • https://github.com/mltframework/shotcut/blob/{{branch}}/{{filename}}#L{{line}} didn't work for the "Repository browser" setting, so I tried:
  • https://github.com/mltframework/shotcut/blob/master/{{filename}}#L{{line}} hard-coded, which doesn't work either.

To Reproduce the issue

Steps to reproduce the behavior:

  1. Set up a new Shotcut repo and import the translation files
  2. Pick en_GB as source language, Filemask: translations/shotcut_*.ts
  3. File format: QT Linguist translation file
  4. Set the Repository browser link as described above
  5. Start translating and click on a "Source string location" link
  6. Link leads to https://github.com/mltframework/shotcut/blob/<filepath>#L<line>

Expected behavior

Link leads to https://github.com/mltframework/shotcut/blob/master/<filepath>#L<line>

Server configuration and status

Installation on localhost with Apache2


$ weblate list_versions
 * Weblate: 4.7.2
 * Django: 3.2.5
 * siphashc: 2.1
 * translate-toolkit: 3.3.6
 * lxml: 4.6.3
 * Pillow: 8.3.1
 * bleach: 3.3.1
 * python-dateutil: 2.8.2
 * social-auth-core: 4.1.0
 * social-auth-app-django: 4.0.0
 * django-crispy-forms: 1.12.0
 * oauthlib: 3.1.1
 * django-compressor: 2.4.1
 * djangorestframework: 3.12.4
 * django-filter: 2.4.0
 * django-appconf: 1.0.4
 * user-agents: 2.2.0
 * filelock: 3.0.12
 * setuptools: 44.0.0
 * jellyfish: 0.8.2
 * openpyxl: 3.0.7
 * celery: 5.1.2
 * kombu: 5.1.0
 * translation-finder: 2.9
 * weblate-language-data: 2021.5
 * html2text: 2020.1.16
 * pycairo: 1.20.1
 * pygobject: 3.40.1
 * diff-match-patch: 20200713
 * requests: 2.26.0
 * django-redis: 5.0.0
 * hiredis: 2.0.0
 * sentry_sdk: 1.3.1
 * Cython: 0.29.24
 * misaka: 2.1.1
 * GitPython: 3.1.18
 * borgbackup: 1.1.17
 * pyparsing: 2.4.7
 * pyahocorasick: 1.4.2
 * python-redis-lock: 3.7.0
 * Python: 3.8.10
 * Git: 2.25.1
 * psycopg2-binary: 2.9.1
 * phply: 1.2.5
 * chardet: 4.0.0
 * ruamel.yaml: 0.17.10
 * boto3: 1.18.7
 * zeep: 4.0.0
 * aeidon: 1.9
 * iniparse: 0.5
 * Mercurial: 5.3.1
 * Redis server: 5.0.7
 * PostgreSQL server: 12.7
 * Database backends: django.db.backends.postgresql
 * Cache backends: default:RedisCache, avatar:FileBasedCache
 * Email setup: django.core.mail.backends.smtp.EmailBackend: localhost
 * OS encoding: filesystem=utf-8, default=utf-8
 * Celery: redis://localhost:6379, redis://localhost:6379, regular
 * Platform: Linux 5.4.0-80-generic (x86_64)

Weblate deploy checks

SystemCheckError: System check identified some issues:

CRITICALS:
?: (weblate.E034) The Celery process is outdated or misconfigured. Following items differ: formats
	HINT: https://docs.weblate.org/en/weblate-4.7.2/admin/install.html#celery

ERRORS:
?: (weblate.E011) E-mail addresses for site admins is misconfigured
	HINT: https://docs.weblate.org/en/weblate-4.7.2/admin/install.html#production-admins

WARNINGS:
?: (security.W004) You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire site is served only over SSL, you may want to consider setting a value and enabling HTTP Strict Transport Security. Be sure to read the documentation first; enabling HSTS carelessly can cause serious, irreversible problems.
?: (security.W008) Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should be available over both SSL and non-SSL connections, you may want to either set this setting True or configure a load balancer or reverse-proxy server to redirect all connections to HTTPS.
?: (security.W012) SESSION_COOKIE_SECURE is not set to True. Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.
?: (security.W018) You should not have DEBUG set to True in deployment.
?: (weblate.W033.Gerrit) Failure in loading VCS module for Gerrit: git: 'review' is not a git command. See 'git --help'.
 (1)
	HINT: https://docs.weblate.org/en/weblate-4.7.2/vcs.html
?: (weblate.W033.Subversion) Failure in loading VCS module for Subversion: git: 'svn' is not a git command. See 'git --help'.

The most similar commands are
	fsck
	mv
	show
 (1)
	HINT: https://docs.weblate.org/en/weblate-4.7.2/vcs.html

INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-4.7.2/admin/install.html#collecting-errors
?: (weblate.I028) Backups are not configured, it is highly recommended for production use
	HINT: https://docs.weblate.org/en/weblate-4.7.2/admin/backup.html

System check identified 10 issues (1 silenced).

Additional context
I don't control the source code repository, so I can't change the branch name in case that should be the problem.

@nijel
Copy link
Member

nijel commented Jul 29, 2021

You probably want to use parentdir filter to strip .. from the location links, see https://docs.weblate.org/en/latest/admin/projects.html#repository-browser

@nijel nijel added the question This is more a question for the support than an issue. label Jul 29, 2021
@gunchleoc
Copy link
Author

Thanks, that fixed it!

I overlooked this bit in the documentation, because my brain was already primed by the short documentation in the UI:

Link to repository browser, use {{branch}} for branch, {{filename}} and {{line}} as filename and line placeholders.

I propose changing this to:

Link to repository browser, use {{branch}} for branch, {{filename}} and {{line}} as filename and line placeholders. You might want to strip leading directory by using {{filename|parentdir}}

@github-actions
Copy link

This issue looks more like a support question than an issue. We strive to answer these reasonably fast, but purchasing the support subscription is not only more responsible and faster for your business but also makes Weblate stronger.

In case your question is already answered, making a donation is the right way to say thank you!

@nijel nijel added documentation Improvements or additions to the documentation. enhancement Adding or requesting a new feature. and removed question This is more a question for the support than an issue. labels Jul 29, 2021
@nijel
Copy link
Member

nijel commented Jul 29, 2021

@orangesunny can you please change the docs as suggested above?

@gunchleoc
Copy link
Author

The doc page is fine - the change I'm suggesting is for the settings UI.

@nijel nijel assigned nijel and unassigned orangesunny Aug 19, 2021
@nijel nijel added this to the 4.8 milestone Aug 19, 2021
@nijel nijel closed this as completed in 4da85d2 Aug 19, 2021
@github-actions
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
documentation Improvements or additions to the documentation. enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants