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

fix: slug transliteration assuming the language is always en #3387

Merged
merged 2 commits into from
Apr 16, 2022

Conversation

SychO9
Copy link
Member

@SychO9 SychO9 commented Apr 10, 2022

Changes proposed in this pull request:
Right now slugs are generated from transliterated title, but always assuming en language. So if a forum is using another language with different characters like Chinese, transliteration doesn't work.

This PR passes the forum's current locale code to the slug method of laravel, to properly transliterate into the forum's language.

Reviewers should focus on:
The problem however is if a forum uses multiple languages it won't work because laravel's slug doesn't detect language on its own, so for example on discuss if someone created a discussion with a Japanese title, the slug will not work, but I believe this is still better than not.

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered?
  • For core PRs, does this need to be in core, or could it be in an extension?
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).
  • Core developer confirmed locally this works as intended.
  • Tests have been added, or are not appropriate here.

@SychO9 SychO9 changed the title fix: transliteration assuming the language is always en fix: slug transliteration assuming the language is always en Apr 10, 2022
@SychO9 SychO9 added this to the 1.3 milestone Apr 16, 2022
@SychO9 SychO9 merged commit fb717db into main Apr 16, 2022
@SychO9 SychO9 deleted the sm/transliterate-proper-default-lang branch April 16, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants