-
Notifications
You must be signed in to change notification settings - Fork 130
#264 build process - adds various i18n helpers, html-based templates #276
Conversation
…}}, partial example
Yeah, I'd say lets not merge this for now because of the proof of concepts in there. Is there any reason why that html template needs to be in the |
@therebelrobot they're currently in the "content" directory to allow reusing the same task workflow we already have in place. I'll need to tweak things more to make them work from a different source (especially the one file to many i18n outputs this change will imply.) Mostly wanted to get this up so we can ping a few i18n groups for their thoughts. No rush to merge. |
At this point we're looking for feedback / suggestions on the patterns used in the sample home.html within that pull request. Some files (like the homepage) would move to sharing a single template like this with i18n hooks where articles (like FAQ, ES6) would remain markdown. |
"slogan": "将 {{link 'pages.es6'}} 带入 Node 社区!" | ||
}, | ||
"links": { | ||
"pages": { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
IMO it's easier to maintain structure as the website group if the HTML is only in one location, hence the |
@therebelrobot the goal is to move the individual (complex) HTML-based pages out, probably to But, we might still want to allow for |
Leaving it there for development is fine. I'm only hesitant of it for production because of separation of concerns (we'd be handing off structure and styling to the 18n groups, when that's kinda our job here). If we want the i18n groups to be able to add language-specific pages, and link to them either in their markdown or elsewhere, that might work, but those pages wouldn't be accounted for in the navigation. I'm less worried about that, but anything that needs to be replicated in each locale, IMO, should be templated in production. |
I still agree re: a 100% template approach for anything re-used. This "home.html" proof-of-conept won't hit production (until it is moved out.) The |
Alright ... I basically have the I'll use this later to help to i18n fallback to English as well (when articles like ES6 aren't yet translated we can still show them, but with (localized) messaging asking for help translating and with the localized nav menu, etc. still surrounding the article. Plus we can |
FYI this now includes the new |
|
||
.home-download | ||
background: #eee | ||
display: flex |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Seems mostly good to me, though I haven't tried running it. Only critique I have on concept is that it does make it more difficult for people who only speak non-english to understand what line goes where. The json should be roughly ordered appropriately is possible. Unfortunately, sometimes things have to give in order to make things work well, so that's the trade it looks like we have to do. |
@Fishrock123 I think switching the template.json to a dictionary.js (or a combination of a few dictionary files eventually) may be a good option. Again, this enables inline commenting, which would help i18n teams leave clues for themselves (as they often do now with Plus, we can also inline document our own (English/default) dictionary file the same way to also help people follow it. Thanks for checking it out :) |
@Fishrock123 I'd be curious to see you test the branch locally (in addition to making any code changes you're interested in) so we can get this locked in to keep building off of it. Trying not to get to a mega PR, but just to a point where: a) everything still builds for people |
LGTM if it works, I haven't tried it yet. Is there any way this could be squashed? 16 commits is a lot to parse together.. Otherwise I'll try it soon and do that part myself. |
This project already has a fairly noisy merge/commit history that I'm not too concerned. I'd say the vast majority of the commits were fairly intentional and atomic commit history points to show the progress of changes. Squashes tend to lose the step-by-step if you need follow the flow in reverse. A few of the odd style ones add a bit of noise, but not a ton in the context of a larger branch. Re: testing locally, I'm willing to wait for that ;) I'd rather you see it work for yourself. |
Oops, weekend happened. I'll try to remember to do a test and finalize of this in the morning. |
Thanks @Fishrock123. Starting to queue up more in #287 ;) |
@snostorm please review the last commit. LGTM to land so long as our Chinese group is ok with switching their page, I guess? |
@Fishrock123 code changes lgtm. The Chinese languages team group approved a while ago on nodejs/nodejs-zh-CN#128 ;) Just running now. Will merge if that works (as I assume it will.) |
#264 build process - adds various i18n helpers, html-based templates
Correction: the |
See #264 for background on the larger work happening.
{{link "i18n_links_obj_reference" }}
, or{{link "string_static" link.dynamic.from.scope }}
type helpers{{hb 'i18n_reference'}}
for allowing complex, Handlebar friendly-strings to be defined in localizationtemplates.json
files.{{i18n "key.string"}}
{{i18n "scope" dynamic_key_portion}}
type helpersFor use-cases on these, look at the
en
localization'shome.html
andtemplate.json
. Thecn
localization acts as an example of consuming the defaultsen
provides.To do: commenting, documentation. Making the
template.js
task more "DRY".Note: eventually, when this is merged, we will not have duplicate copies of the home.html in each localization (and index.md will be retired.)