mbi / django-rosetta

Rosetta is a Django application that eases the translation process of your Django projects
MIT License
1.07k stars 195 forks source link

Rewrite rosetta.js #295

Closed balazs-endresz closed 1 month ago

balazs-endresz commented 1 month ago

All Submissions:

I don't think this needs any test changes and doesn't add any new options to toggle either.


I've ended up rewriting rosetta.js without jQuery, which is actually very easy now. The django admin uses a lot of modern js too, so I don't think there are any browser compatibility concerns nowadays. Not having to deal with jQuery upgrades should be a positive too. It fixes several js related issues and adds a few improvements:

mbi commented 1 month ago

Ah thank you, I've long wanted to get rid of that ugly jQuery code! I'll sit on this over the weekend and will take a closer look and detailed read-through early next week.

cheers!

balazs-endresz commented 1 month ago

Great, I was hoping you wouldn't want to keep jQuery either :)

Just added a small fix for an error when reflang is not used. And with optional chaining, which was a later addition but has the same browser support as all the other stuff.

I'll squash the commits at the end.

mbi commented 1 month ago

Sorry for the delay on this PR. I'm also working on #290 at the same time, and they are somewhat related (the ajax calls to handle the automatic translations and we've found some issues in the regexps that parse the string formatting variables). Not yet sure how to best reconcile these two PRs.

balazs-endresz commented 1 month ago

No worries, I didn't mean to rush you. If that PR gets merged first then I can sort out the conflict easily. I've already added the global flag to that regex here too. If there will be more js changes on the other PR that shouldn't be much more difficult either.

mbi commented 1 month ago

Hello @balazs-endresz I just merged #290 and it seems your PR is still mergeable. Do you think it's ready for a final review and merging, or are you still working on it? Thanks!

balazs-endresz commented 1 month ago

It's ready for review. And once you've tested it I can squash the commits before merging. Or I can do that now with a rebase if you prefer.

mbi commented 1 month ago

Merged via 03d9f38. Thank you so much for your work on this!