Comments (6)
Not sure I understand the issue here: the message
variable is local to the context of Rosetta, and is displayed in an isolated manner inside a Rosetta template, how would if affect your message framework?
from django-rosetta.
We were customising the rosetta template to fit in with the look and feel of our website by putting it into the local project under templates/rosetta. Because rosetta uses "messages" as the variable name, the usual messages framework is unusable for any of the customised rosetta templates.
We're now using a patched version of rosetta (changing "messages" to "rosetta_msgs") which allows rosetta and the django messaging framework to co-exist properly.
The issue is simply the use of the variable name "messages" when integrating rosetta into websites that also make use of django messages to convey information back to users.
Hope that makes the issue clearer.
from django-rosetta.
Okay, I hope you'll agree this isn't an issue with Rosetta then, and probably best taken care of in a fork.
from django-rosetta.
It seems more of a naming issue to me. The messages variable name is part of django. Would it not just be possible to use a variable such as rosetta_messages rather than conflicting with django? It's only used in two places and anyone who uses django messages and rosetta will get this issue.
from django-rosetta.
Anyone who uses Rosetta embedded into the global admin, you mean? Or am I missing something again?
Anyway, I'll accept a pull request that addresses this issue, as long as it's fully tested.
from django-rosetta.
It can affect anyone just trying to use the messages framework in their site alongside rosetta that has been edited to fit in with their look and feel. Basically, the home() view in views.py puts locals() into the context. Djangos messages framework also uses the messages variable name. So when a project puts something like:
{% if messages %} <ul class="messages"> {% for message in messages %} <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li> {% endfor %} </ul> {% endif %}
into a template like base.html, django messages spits out all of the rosetta languages stored in the messages variable onto the page. So the project must either copy the above code into every template where they might want to see messages appear (tedious for even a medium project) or patch rosetta to use a less general variable name.
I've make a fork and applied some changes but am wondering if you have any specific tests for templates. If not I'll set up a test project and make sure it all works as expected before making a pull request.
Thanks,
Becky Lewis
from django-rosetta.
Related Issues (20)
- TemplateDoesNotExist at /rosetta/files/project HOT 2
- Why request some url `https://www.google.com/jsapi` HOT 2
- 'Last-Translator' is written as b'....' in pofile
- Plurals with context are rendered incorrectly HOT 6
- `re_path` is not available in django==4.0 anymore HOT 3
- request or news (I can look) save to database for docker HOT 5
- Why split `DJANGO_SETTINGS_MODULE` in function find_pos()? HOT 1
- Missing Azure Location setting HOT 1
- Export Django-rosetta translations HOT 1
- DeepL suggestions not working HOT 1
- Triple entries in local dev env on Mac HOT 8
- anyone can add chatgpt support? HOT 2
- DeepL translates variable names
- DeepL Pro support HOT 3
- Updating docs to get ROSETTA_LANGUAGE_GROUPS=True working HOT 1
- REFLANG not working anymore? HOT 1
- Infinite Redirected Loop when Accessing Django Rosetta Page with users other than superuser HOT 1
- Chinese locale directory should be named 'zh_Hans' instead of 'zh_hans' HOT 2
- How to translate third-party apps?
- TypeError at../rosetta/files/project HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-rosetta.