Support x-default in Multilanguage & Sitemap plugins#532
Conversation
|
I wouldn't treat this option like another language code. I guess the use case of I imagine a variable at page level to indicate that a page has a default lang. For example: lang: en
langSelector: /country-selector/Other option is mark one page as lang: x-default |
Once users wish to support multiple languages with fallback system,
You are correct, the main purpose of
The reason I treat it as another language code (set 'x-default' in
You got a point. How about this:
With these cases, we can cover 2 usages (both recommend and side effect). So with that thought, setting What do you think? Footnotes |
|
The reason I think including In this example (view-source:https://newtoninvestment.jp/) of a site in English and Japanese languages, the What do you think about this?
|
Yeah, my shortcut isn't worth for the sake of simplicity.
I don't think it is strange. They just tried to do fallback language for international visitors. Usually the best usage recommended by Google is for language selector page. But in both cases we saw, yours & mine are all used it as fallback language page rather than language selector page. About your solution, I agree, but can we use the name |
Do you mean this? lang: en
langX: /country-selectorYeah, is shorter. The reason of suggesting In summary, it would work in this way:
What do you think? |
|
Sounds good, I'll work on the code now. |
c8b6e0b to
12f8dc6
Compare
|
I didn't close this, it must be because I reset the branch to the latest. I'll reopen it with dummy commit for now :p |
oscarotero
left a comment
There was a problem hiding this comment.
Thanks! I just left a couple of comments.
I think the x-default should be handled after defining the alternates array, maybe in a different processor.
Thanks for the review, I'm working on it now. |
|
I'm thinking of maybe If we are going to allow external urls, maybe |
Upto now, I agree, it doesn't look good on user pov. But
I think so, in the best case, we don't have to expose a |
The problem of having "default" in the name is that it can be confused with the
It would be possible. Let's say we use <a href="{{ xDefaultLang }}">Language picker</a>If you need to access to the page data: {{ set xPage = search.page(`url=${xDefaultLang}`) }}
<a href="{{ xPage.url }}">{{ xPage.title }}</a>Having only the URL in this variable, it's possible to use external URLs for the language picker. This can be useful for multidomain sites, where the language picker is, for example ( |
That makes sense. It would confuses dev who try to get
We still have default in the end, ain't it? I kinda want to avoid I prefer |
|
Hmmm, naming thinks is complicated. 😄 We agree that the name should contain "lang" (obviously) and "url" (because it has a url, not a language code). Maybe the most accurate name is Does it make sense to you? |
That sounds sexy. Let go with this :)) |
|
Let me do one last confirm for this case. So now we will have:
Is it ok to you, did I miss anything else? |
|
I would use only one variable. It's like
|
|
Now that I remember the url option also got rewritten from For now, I'll do with rewritable |
|
Fair enough. |
06be97d to
9d8b0dc
Compare
9d8b0dc to
d6c9bf4
Compare
d8e1d24 to
31a4a24
Compare
31a4a24 to
4209ecd
Compare
4209ecd to
041b7a7
Compare
Features: - support external links - support internal absolute path - support language code Tasks: - add feature - improve message log - update test cases - update CHANGELOG
041b7a7 to
c288a82
Compare
|
Thanks for your great work! |




Description
Right now it is just a draft for discussion
Related Issues
Fix #528
Check List
CODE OF CONDUCT
CONTRIBUTING
send multiple pull request.
fmtto fix the code format before commit.CHANGELOG.md.