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(i8n): compatibility with og:locale #1306

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

curbengh
Copy link

PR Checklist

  • The commit message follows our guidelines.
  • Tests for the changes was maked (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs in NexT website have been added / updated (for features).

PR Type

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue resolved: N/A

What is the new behavior?

  • Screenshots with this changes: N/A
  • Link to demo site with this changes: N/A

How to use?

In Hexo _config.yml:

language: en-US

Does this PR introduce a breaking change?

  • Yes.
  • No.

Description

A change introduced in hexojs/hexo#3808, og:locale Open Graph tag only accepts "language_TERRITORY" format.

Since "language_TERRITORY" breaks multilingual support, user should instead use "language-TERRITORY" format which is automatically transformed to "language_TERRITORY" in open_graph() helper.

However, "language-TERRITORY" still breaks multilingual support for non-ZH users, this PR fixes that.

See official list (by Facebook; Hexo only checks the length, not the value itself) of supported locales.

@welcome
Copy link

welcome bot commented Dec 10, 2019

Thanks so much for opening your first PR here!

@curbengh
Copy link
Author

A fix has been created in the upstream (hexojs/hexo#3921) to minimize breaking change. Despite that, I still think this PR is necessary.

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants