From fcc794f144941f31f968ced3b67197492a226ebc Mon Sep 17 00:00:00 2001 From: confused-Techie Date: Wed, 18 Mar 2026 19:46:35 -0700 Subject: [PATCH] Add localization for `about` --- packages/about/lib/components/about-view.js | 24 ++++++++++----------- packages/about/locales/about.en.cson | 11 ++++++++++ 2 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 packages/about/locales/about.en.cson diff --git a/packages/about/lib/components/about-view.js b/packages/about/lib/components/about-view.js index 0e2d0f2049..9151ef1587 100644 --- a/packages/about/lib/components/about-view.js +++ b/packages/about/lib/components/about-view.js @@ -68,13 +68,13 @@ module.exports = class AboutView extends EtchComponent { var showMoreDiv = document.querySelector('.show-more'); var showMoreText = document.querySelector('.about-more-expand'); switch (showMoreText.textContent) { - case 'Show more': + case atom.i18n.t("about.src.show-more"): showMoreDiv.classList.toggle('hidden'); - showMoreText.textContent = 'Hide'; + showMoreText.textContent = atom.i18n.t("about.src.hide"); break; - case 'Hide': + case atom.i18n.t("about.src.hide"): showMoreDiv.classList.toggle('hidden'); - showMoreText.textContent = 'Show more'; + showMoreText.textContent = atom.i18n.t("about.src.show-more"); break; } } @@ -108,7 +108,7 @@ module.exports = class AboutView extends EtchComponent { className: 'about-header-release-notes', onclick: this.handleReleaseNotesClick.bind(this) }, - 'Release Notes' + atom.i18n.t("about.src.release-notes") ) ), $.span( @@ -117,7 +117,7 @@ module.exports = class AboutView extends EtchComponent { 'about-version-container show-more-expand', onclick: this.handleShowMoreClick.bind(this) }, - $.span({ className: 'about-more-expand' }, 'Show more') + $.span({ className: 'about-more-expand' }, atom.i18n.t("about.src.show-more")) ), $.div( { className: 'show-more hidden about-more-info' }, @@ -177,7 +177,7 @@ module.exports = class AboutView extends EtchComponent { { className: 'about-updates-item app-unsupported' }, $.span( { className: 'about-updates-label is-strong' }, - 'Updates have been moved to the package ', $.code({style: {'white-space': 'nowrap'}}, 'pulsar-updater'), '.', + atom.i18n.t("about.src.updates-have-moved"), " ", $.code({style: {'white-space': 'nowrap'}}, 'pulsar-updater'), '.', $.br() ), $.a( @@ -185,7 +185,7 @@ module.exports = class AboutView extends EtchComponent { className: 'about-updates-instructions', onclick: this.handleHowToUpdateClick.bind(this) }, - 'How to update' + atom.i18n.t("about.src.how-to-update") ) ) ), @@ -202,7 +202,7 @@ module.exports = class AboutView extends EtchComponent { className: 'btn view-license', onclick: this.handleLicenseClick.bind(this) }, - 'License' + atom.i18n.t("about.src.license") ), //Disabled the below as we don't have this but can reuse if there is the need /*$.button( @@ -233,7 +233,7 @@ module.exports = class AboutView extends EtchComponent { { className: 'about-updates-item app-unsupported' }, $.span( { className: 'about-updates-label is-strong' }, - 'Enable `pulsar-updater` to check for updates' + atom.i18n.t("about.src.enable-pulsar-updater") ) ); } else { @@ -246,7 +246,7 @@ module.exports = class AboutView extends EtchComponent { margin: '0 .5em' } }, - 'Check Now' + atom.i18n.t("about.src.check-now") ); } } @@ -267,7 +267,7 @@ module.exports = class AboutView extends EtchComponent { } getTitle() { - return 'About'; + return atom.i18n.t("about.src.about-view-title"); } getIconName() { diff --git a/packages/about/locales/about.en.cson b/packages/about/locales/about.en.cson new file mode 100644 index 0000000000..cbf7095831 --- /dev/null +++ b/packages/about/locales/about.en.cson @@ -0,0 +1,11 @@ +'src': { + 'show-more': 'Show more' + 'hide': 'Hide' + 'release-notes': 'Release Notes' + 'updates-have-moved': 'Updates have been moved to the package' + 'how-to-update': 'How to update' + 'license': 'License' + 'enable-pulsar-updater': 'Enable `pulsar-updater` to check for updates' + 'check-now': 'Check Now' + 'about-view-title': 'About' +}