@mpgd/i18n 0.3.2 → 0.3.3

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.
@@ -52,4 +52,5 @@ export * from "./target_feature_interstitial_ads.js";
52
52
  export * from "./target_feature_leaderboard.js";
53
53
  export * from "./target_feature_localization.js";
54
54
  export * from "./target_feature_rewarded_ads.js";
55
+ export * from "./viewport.js";
55
56
  export type LocalizedString = import("../runtime.js").LocalizedString;
@@ -53,4 +53,5 @@ export * from './target_feature_iap.js'
53
53
  export * from './target_feature_interstitial_ads.js'
54
54
  export * from './target_feature_leaderboard.js'
55
55
  export * from './target_feature_localization.js'
56
- export * from './target_feature_rewarded_ads.js'
56
+ export * from './target_feature_rewarded_ads.js'
57
+ export * from './viewport.js'
@@ -0,0 +1,20 @@
1
+ /**
2
+ * | output |
3
+ * | --- |
4
+ * | "Viewport: {sizeClass} {orientation} - controls {controls}" |
5
+ *
6
+ * @param {ViewportInputs} inputs
7
+ * @param {{ locale?: "en" | "ko" }} options
8
+ * @returns {LocalizedString}
9
+ */
10
+ export const viewport: ((inputs: ViewportInputs, options?: {
11
+ locale?: "en" | "ko";
12
+ }) => LocalizedString) & import("../runtime.js").MessageMetadata<ViewportInputs, {
13
+ locale?: "en" | "ko";
14
+ }, {}>;
15
+ export type LocalizedString = import("../runtime.js").LocalizedString;
16
+ export type ViewportInputs = {
17
+ sizeClass: NonNullable<unknown>;
18
+ orientation: NonNullable<unknown>;
19
+ controls: NonNullable<unknown>;
20
+ };
@@ -0,0 +1,29 @@
1
+ /* eslint-disable */
2
+ import { getLocale, experimentalStaticLocale } from '../runtime.js';
3
+
4
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
5
+
6
+ /** @typedef {{ sizeClass: NonNullable<unknown>, orientation: NonNullable<unknown>, controls: NonNullable<unknown> }} ViewportInputs */
7
+
8
+ const en_viewport = /** @type {(inputs: ViewportInputs) => LocalizedString} */ (i) => {
9
+ return /** @type {LocalizedString} */ (`Viewport: ${i?.sizeClass} ${i?.orientation} - controls ${i?.controls}`)
10
+ };
11
+
12
+ const ko_viewport = /** @type {(inputs: ViewportInputs) => LocalizedString} */ (i) => {
13
+ return /** @type {LocalizedString} */ (`뷰포트: ${i?.sizeClass} ${i?.orientation} - 컨트롤 ${i?.controls}`)
14
+ };
15
+
16
+ /**
17
+ * | output |
18
+ * | --- |
19
+ * | "Viewport: {sizeClass} {orientation} - controls {controls}" |
20
+ *
21
+ * @param {ViewportInputs} inputs
22
+ * @param {{ locale?: "en" | "ko" }} options
23
+ * @returns {LocalizedString}
24
+ */
25
+ export const viewport = /** @type {((inputs: ViewportInputs, options?: { locale?: "en" | "ko" }) => LocalizedString) & import('../runtime.js').MessageMetadata<ViewportInputs, { locale?: "en" | "ko" }, {}>} */ ((inputs, options = {}) => {
26
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
27
+ if (locale === "en") return en_viewport(inputs)
28
+ return ko_viewport(inputs)
29
+ });
@@ -79,6 +79,11 @@ export interface MpgdMessages {
79
79
  readonly target_feature_leaderboard: EmptyMessage;
80
80
  readonly target_feature_localization: EmptyMessage;
81
81
  readonly target_feature_rewarded_ads: EmptyMessage;
82
+ readonly viewport: MessageFunction<{
83
+ readonly controls: string;
84
+ readonly orientation: string;
85
+ readonly sizeClass: string;
86
+ }>;
82
87
  }
83
88
 
84
89
  export const m: MpgdMessages;
package/messages/en.json CHANGED
@@ -53,5 +53,6 @@
53
53
  "target_feature_interstitial_ads": "Inter",
54
54
  "target_feature_leaderboard": "Board",
55
55
  "target_feature_localization": "Localization",
56
- "target_feature_rewarded_ads": "Reward"
56
+ "target_feature_rewarded_ads": "Reward",
57
+ "viewport": "Viewport: {sizeClass} {orientation} - controls {controls}"
57
58
  }
package/messages/ko.json CHANGED
@@ -53,5 +53,6 @@
53
53
  "target_feature_interstitial_ads": "전면광고",
54
54
  "target_feature_leaderboard": "랭킹",
55
55
  "target_feature_localization": "다국어",
56
- "target_feature_rewarded_ads": "보상광고"
56
+ "target_feature_rewarded_ads": "보상광고",
57
+ "viewport": "뷰포트: {sizeClass} {orientation} - 컨트롤 {controls}"
57
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpgd/i18n",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Paraglide-backed message catalog for mpgd demos and target-aware UI.",
5
5
  "license": "MIT",
6
6
  "repository": {