|
| 1 | +/// <reference path="./collectionSettings.d.ts" /> |
| 2 | + |
1 | 3 | import WebSocketManager, { |
2 | 4 | IBloomWebSocketEvent, |
3 | 5 | } from "../../utils/WebSocketManager"; |
4 | 6 | import { postJson } from "../../utils/bloomApi"; |
5 | 7 | import { showBookGridSetupDialog } from "../../react_components/BookGridSetup/BookGridSetupDialog"; |
6 | 8 | import { Link } from "../../react_components/BookGridSetup/BookLinkTypes"; |
7 | 9 |
|
| 10 | +function getLanguage1Tag(): string { |
| 11 | + const settings = GetSettings() as ICollectionSettings; |
| 12 | + return settings.languageForNewTextBoxes; |
| 13 | +} |
| 14 | + |
8 | 15 | export function setupBookLinkGrids(container: HTMLElement) { |
9 | 16 | // Add skeleton to empty grids on initial setup |
10 | 17 | const linkGrids = Array.from( |
11 | 18 | container.getElementsByClassName("bloom-link-grid"), |
12 | 19 | ) as HTMLElement[]; |
| 20 | + const linkLang = getLanguage1Tag(); |
13 | 21 | for (const linkGrid of linkGrids) { |
| 22 | + linkGrid.lang = linkLang; |
14 | 23 | addSkeletonIfEmpty(linkGrid as HTMLElement); |
15 | 24 | // In case anyone wonders why this works here but will not on most canvas elements |
16 | 25 | // and their children...we put a rule in basepage.less that puts bloom-link-grid |
@@ -58,6 +67,7 @@ export function editLinkGrid(linkGrid: HTMLElement) { |
58 | 67 | addSkeletonIfEmpty(linkGrid); |
59 | 68 | } else { |
60 | 69 | // Add real book buttons |
| 70 | + linkGrid.lang = getLanguage1Tag(); |
61 | 71 | links.forEach((link) => { |
62 | 72 | const button = document.createElement("div"); |
63 | 73 | button.className = "bloom-bookButton"; |
|
0 commit comments