Skip to content

Commit

Permalink
chore(macros): add "except shared" condition to AvailableinWorkers (#…
Browse files Browse the repository at this point in the history
…11888)

Update AvailableInWorkers macro to include case of support in workers expect for shared
  • Loading branch information
chrisdavidmills authored Oct 1, 2024
1 parent 540505b commit 41ad479
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kumascript/macros/AvailableInWorkers.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// 'window_and_dedicated': only in DedicatedWorker (and in Window)
// 'dedicated': only in DedicatedWorker
// 'window_and_worker_except_service': all workers but ServiceWorker (and in Window)
// 'window_and_worker_except_shared': all workers but shared workers (and in Window)
// 'worker_except_service': all workers but ServiceWorker (and no window)
// 'window_and_service': only in ServiceWorker (and in Window)
// 'service': only in ServiceWorker
Expand Down Expand Up @@ -54,6 +55,10 @@ const textNotService = mdn.localString({
"zh-TW": `此功能可在 <a href="/${locale}/docs/Web/API/Web_Workers_API">Web Worker</a>(不包括 <a href="/${locale}/docs/Web/API/Service_Worker_API">Service Worker</a>)中使用。`,
});
const textNotShared = mdn.localString({
"en-US": `This feature is available in <a href="/${locale}/docs/Web/API/Web_Workers_API">Web Workers</a>, except for <a href="/${locale}/docs/Web/API/SharedWorkerGlobalScope">Shared Web Workers</a>.`,
});
const textNotServiceNotWindow = mdn.localString({
"en-US": `This feature is only available in <a href="/${locale}/docs/Web/API/Web_Workers_API">Web Workers</a>, except for <a href="/${locale}/docs/Web/API/Service_Worker_API">Service Workers</a>.`,
"ja": `この機能は<a href="/${locale}/docs/Web/API/Web_Workers_API">ウェブワーカー</a>内でのみ利用可能ですが、<a href="/${locale}/docs/Web/API/Service_Worker_API">サービスワーカー</a>では使用できません。`,
Expand Down Expand Up @@ -90,6 +95,7 @@ const associatedText = {
default: () => textDefault,
worker: () => textWorker,
window_and_worker_except_service: () => textNotService,
window_and_worker_except_shared: () => textNotShared,
worker_except_service: () => textNotServiceNotWindow,
window_and_dedicated: () => textDedicated,
dedicated: () => textDedicatedOnly,
Expand Down

0 comments on commit 41ad479

Please sign in to comment.