-
Notifications
You must be signed in to change notification settings - Fork 196
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
Configurable version control service integration #252
Comments
Apart from that, if I'm not wrong you want to use URLs as references and convert URLs to import polib
from django.core.management.commands.makemessages import (
BuildFile as MakeMessagesBuildFile,
Command as MakeMessagesCommand
)
class MakeProperMessagesBuildFile(MakeMessagesBuildFile):
def postprocess_messages(self, msgs):
po = polib.POFile(super().postprocess_messages(msgs))
for entry in po:
# do whatever you want, in this case if "Url: <...>" found in msgctxt
# or URL found by regex, move it to `ocurrences`...
return str(po)
class Command(MakeMessagesCommand):
build_file_class = MakeProperMessagesBuildFile And then, inherit from rosetta from rosetta.views import TranslationFormView
TranslationFormView.template_name = "path/to/your/custom-template.html" {% include 'rosetta/form.html' %}
{% include 'my-crazy-hack-for-rosetta-interface.html' %} I think your proposal is interesting, but maybe not standard enough to be implemented in Django core. |
I think the contrary. My proposal is about improving the general usability of Rosetta. Think: What is a link to a file location worth in 2021 when it's not effortless to reach it in the source code repository to, e.g., fix the related text string? If you have to do copy+paste, or plain remember filename and line number, and go searching in your file system then the project will rather sooner than later be abandoned, because it doesn't meet the expectations of a continuously larger part of the (developer) audience. Translation support tools must allow translators to focus on translating, and in a similar manner developers to focus on fixing spelling mistakes. Speed matters, distractions count.
That's technically possible, I agree, but I guess the better place is the rendering process for the user interface. |
To answer the original request, the way I'd implement this is by defining a new setting, e.g. Thoughts? |
Could be interesting, but shouldn't be |
Sounds good to me. Is your suggestion just about the setting and the implementation of turning the text into a link, or do you think about a default implementation of the callable, too? If we had, say, a |
Feature: Link to source file
The "Occurrence(s)" column in the Web UI lists file names and the line numbers of where the text was extracted from. It should be easy to configure an external service URL and generate a link to display the text location in the file under version control.
If the reference content (see definition) is directly a valid URL (e.g. when I edit the PO file and add a
#. https://foo.bar.com
line to an item) that URL should be turned into a clickable link either.Related
See https://code.djangoproject.com/ticket/32356 for a related Django feature request.
The text was updated successfully, but these errors were encountered: