@johnmorrisdotca/chikyu-earth 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The two languages the flat map has words for.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import type { FlatLang } from "@johnmorrisdotca/chikyu-earth/flat";
7
+ *
8
+ * const lang: FlatLang = "ja";
9
+ * console.log(lang);
10
+ * ```
11
+ */
12
+ export type FlatLang = "en" | "ja";
13
+ /**
14
+ * The words the flat map writes, one table for each language: `{count}`, `{id}`, `{name}` and the like are filled in. The Japanese is standard, polite Japanese.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * import { FLAT_WORDS } from "@johnmorrisdotca/chikyu-earth/flat";
19
+ *
20
+ * console.log(FLAT_WORDS.en.footprint, FLAT_WORDS.ja.footprint);
21
+ * ```
22
+ */
23
+ export declare const FLAT_WORDS: Readonly<Record<FlatLang, Readonly<Record<string, string>>>>;
24
+ /** The words with their `{name}` places filled in. */
25
+ export declare const say: (lang: FlatLang, key: string, values?: Record<string, string | number>) => string;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * The words the flat map writes, one table for each language: `{count}`, `{id}`, `{name}` and the like are filled in. The Japanese is standard, polite Japanese.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import { FLAT_WORDS } from "@johnmorrisdotca/chikyu-earth/flat";
7
+ *
8
+ * console.log(FLAT_WORDS.en.footprint, FLAT_WORDS.ja.footprint);
9
+ * ```
10
+ */
11
+ export const FLAT_WORDS = {
12
+ en: {
13
+ map: "Satellites on a flat map of the world",
14
+ controls: "Map controls",
15
+ greenwich: "Greenwich",
16
+ myPlace: "My place",
17
+ centreGreenwich: "Centre the map on Greenwich",
18
+ centreHome: "Centre the map on my place",
19
+ home: "My place",
20
+ all: "All",
21
+ other: "Other",
22
+ plane: "Plane {id}",
23
+ planeChip: "Plane {id}, {count} satellites",
24
+ groupsFilter: "Groups to show",
25
+ planesFilter: "Orbital plane to show",
26
+ footprint: "Footprint",
27
+ groundTrack: "Ground track",
28
+ zoomIn: "Zoom in",
29
+ zoomOut: "Zoom out",
30
+ count: "{count} satellites",
31
+ announce: "{name}, {group}, {altitude} km up",
32
+ announcePlane: ", plane {id}",
33
+ waiting: "Waiting for orbit data.",
34
+ unreadable: "The orbit data could not be read: {why}",
35
+ nothing: "No satellite to show.",
36
+ help: "Arrow keys move from one satellite to the next, Enter chooses it, plus and minus zoom.",
37
+ shown: "{count} satellites shown",
38
+ },
39
+ ja: {
40
+ map: "世界の平面地図の上の衛星",
41
+ controls: "地図の操作",
42
+ greenwich: "グリニッジ",
43
+ myPlace: "自分の場所",
44
+ centreGreenwich: "地図の中心をグリニッジにする",
45
+ centreHome: "地図の中心を自分の場所にする",
46
+ home: "自分の場所",
47
+ all: "すべて",
48
+ other: "その他",
49
+ plane: "軌道面 {id}",
50
+ planeChip: "軌道面 {id}、{count} 機",
51
+ groupsFilter: "表示するグループ",
52
+ planesFilter: "表示する軌道面",
53
+ footprint: "可視範囲",
54
+ groundTrack: "地上軌跡",
55
+ zoomIn: "拡大",
56
+ zoomOut: "縮小",
57
+ count: "{count} 機",
58
+ announce: "{name}、{group}、高さ {altitude} km",
59
+ announcePlane: "、軌道面 {id}",
60
+ waiting: "軌道データを待っています。",
61
+ unreadable: "軌道データを読み取れませんでした: {why}",
62
+ nothing: "表示する衛星がありません。",
63
+ help: "矢印キーで次の衛星へ移り、Enter キーで選びます。プラスとマイナスで拡大・縮小します。",
64
+ shown: "{count} 機を表示中",
65
+ },
66
+ };
67
+ /** The words with their `{name}` places filled in. */
68
+ export const say = (lang, key, values = {}) => (FLAT_WORDS[lang][key] ?? FLAT_WORDS.en[key] ?? key).replace(/\{(\w+)\}/g, (all, name) => String(values[name] ?? all));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/chikyu-earth",
3
- "version": "0.52.0",
3
+ "version": "0.53.0",
4
4
  "description": "Chikyu Earth 地球 — A line-drawn globe for the web: country outlines that turn at the Earth's own rate, centred on the place you give it, with an optional realistic Earth from space (three.js), the Sun, Moon and planets, satellites on their orbits, and markers for any place. A web component and an SVG string.",
5
5
  "keywords": [
6
6
  "earth",
@@ -75,6 +75,8 @@
75
75
  "./src/element.ts",
76
76
  "./dist/passes/element.js",
77
77
  "./src/passes/element.ts",
78
+ "./dist/flat/define.js",
79
+ "./src/flat/define.ts",
78
80
  "./dist/realistic/element.js",
79
81
  "./src/realistic/element.ts",
80
82
  "./dist/realistic/element-base.js",
@@ -164,6 +166,16 @@
164
166
  "import": "./dist/passes/index.js",
165
167
  "default": "./dist/passes/index.js"
166
168
  },
169
+ "./flat": {
170
+ "types": "./dist/flat/index.d.ts",
171
+ "import": "./dist/flat/index.js",
172
+ "default": "./dist/flat/index.js"
173
+ },
174
+ "./flat/define": {
175
+ "types": "./dist/flat/define.d.ts",
176
+ "import": "./dist/flat/define.js",
177
+ "default": "./dist/flat/define.js"
178
+ },
167
179
  "./sheets": {
168
180
  "types": "./dist/sheets/index.d.ts",
169
181
  "import": "./dist/sheets/index.js",