chore: update to new content of `electron/i18n` (#5276)
In https://github.com/electron/i18n/pull/1811 there are changes to what properties the `i18n` package export that would break the website. More notably `electronStableVersion` does not exist anymore. This PR calculates that property and keeps exposing it in the handlebars context.
This commit is contained in:
Родитель
ef68590a8d
Коммит
e5f3c7d980
|
@ -1,7 +1,8 @@
|
|||
const i18n = require('lib/i18n')
|
||||
const electronReleases = require('electron-releases')
|
||||
const electronLatestStableVersion = i18n.electronLatestStableTag.slice(1)
|
||||
const { deps } = electronReleases.find(
|
||||
(release) => release.version === i18n.electronLatestStableVersion
|
||||
(release) => release.version === electronLatestStableVersion
|
||||
)
|
||||
const { getLanguageNativeName } = require('locale-code')
|
||||
const rtlDetect = require('rtl-detect')
|
||||
|
@ -41,13 +42,8 @@ module.exports = function contextBuilder(req, res, next) {
|
|||
}
|
||||
|
||||
req.context = {
|
||||
electronLatestStableVersion: i18n.electronLatestStableVersion,
|
||||
electronLatestStableVersion,
|
||||
electronLatestStableTag: i18n.electronLatestStableTag,
|
||||
electronMasterBranchCommit: i18n.electronMasterBranchCommit,
|
||||
electronMasterBranchCommitShort: i18n.electronMasterBranchCommit.slice(
|
||||
0,
|
||||
6
|
||||
),
|
||||
deps: deps,
|
||||
releases: new Releases(electronReleases),
|
||||
currentLocale: req.language,
|
||||
|
|
|
@ -25,11 +25,7 @@
|
|||
{{else}}
|
||||
<a href="{{doc.href}}/history">
|
||||
<span class="docs-version">
|
||||
{{#if doc.isApiDoc}}
|
||||
{{electronLatestStableTag}}
|
||||
{{else}}
|
||||
<span>electron@master ({{electronMasterBranchCommitShort}})</span>
|
||||
{{/if}}
|
||||
<span>v{{electronLatestStableVersion}}</span>
|
||||
</span>
|
||||
</a>
|
||||
{{/if}}
|
||||
|
|
Загрузка…
Ссылка в новой задаче