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

Language metadata gets reset to English after editing a post #280

Closed
cjeller1592 opened this issue Mar 16, 2020 · 3 comments
Closed

Language metadata gets reset to English after editing a post #280

cjeller1592 opened this issue Mar 16, 2020 · 3 comments

Comments

@cjeller1592
Copy link
Contributor

@cjeller1592 cjeller1592 commented Mar 16, 2020

Brought up originally on the forum:

Normally, after setting a language for a post, it should stick and should not change unless the author modifies it again. However if you edit the post and (re)publish it again it causes the language field to reset back to English.

Steps to reproduce

  1. Go to a post and click 'Edit.' Go into the metadata and change the Language to something else and save your changes. Publish the post.
  2. Now edit the post again, this time the body of the post, and publish.
  3. Go back to the metadata of the post. Note how it is now 'English.'

Expected behavior

Post should keep the metadata language after edited, not revert to English.

@thebaer
Copy link
Member

@thebaer thebaer commented Mar 16, 2020

Thanks for copying that over. Off the top of my head, this happens because we include the lang parameter every time we publish or update a post, which passes along the browser's default language (which is likely English in this user's case).

The fix should be simple: in templates/pad.tmpl, only pass lang when initially creating a post. When editing / updating a post, don't pass the lang parameter.

Since this is pretty straightforward, this would be a great first task for anyone interested in contributing to WriteFreely!

@vince2bir
Copy link

@vince2bir vince2bir commented Apr 24, 2020

For information, I write in french but all my apps and browser are setup in english.
It might be nice to have a choice in the "customize" page of a blog to leave it as-is or overide it to a language of our choice.

@agyild
Copy link

@agyild agyild commented Jan 23, 2021

I have already written in the forum but it's been nearly year since this issue was reported. I think at this point it would be better if one of the active developers implemented this fix if it is so simple instead of waiting for a new contributor.

@thebaer thebaer added this to the 0.13 milestone Apr 6, 2021
@thebaer thebaer closed this in #435 Apr 6, 2021
thebaer added a commit that referenced this issue Apr 6, 2021
This fixes #280 in all editors, continuing work from #435.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants