1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
|
// SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com>
// SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1
export const supportedLocales = ["en-US", "de-DE", "ru-RU", "he-IL"] as const;
export type Locale = (typeof supportedLocales)[number];
/** The language of a visitor whose browser asks for none that is published. */
export const fallbackLocale: Locale = "en-US";
export function isLocale(value: string | undefined): value is Locale {
return supportedLocales.includes(value as Locale);
}
/** Each language named in that language, as a language menu shows it. */
export const localeNames: Record<Locale, string> = {
"en-US": "English",
"de-DE": "Deutsch",
"ru-RU": "Русский",
"he-IL": "עברית",
};
/**
* The direction in which the text of a language runs.
*
* Only text follows it. The page layout, the navigation and code samples keep
* their left-to-right arrangement in every language.
*/
export function textDirection(locale: Locale): "ltr" | "rtl" {
return locale === "he-IL" ? "rtl" : "ltr";
}
/** The arrow that points onward in the reading direction of a language. */
export function forwardArrow(locale: Locale): string {
return textDirection(locale) === "rtl" ? "←" : "→";
}
// Primary language subtags and the published locale each one selects. `iw` is
// the former code for Hebrew, which some browsers still send.
const localeByLanguage = new Map<string, Locale>([
["en", "en-US"],
["de", "de-DE"],
["ru", "ru-RU"],
["he", "he-IL"],
["iw", "he-IL"],
]);
/**
* Chooses the published locale a browser prefers.
*
* The argument is an `Accept-Language` header: a list of language ranges,
* each with an optional quality. The range with the highest quality whose
* primary language is published wins, and the order of the header breaks
* ties. A missing header, a header without a published language and a range
* the visitor refuses with quality zero all give the fallback locale. The
* header comes from the browser and is not trusted, so only its beginning is
* read.
*/
export function negotiateLocale(acceptLanguage: string | null): Locale {
if (!acceptLanguage) {
return fallbackLocale;
}
let selected: Locale = fallbackLocale;
let selectedQuality = 0;
for (const range of acceptLanguage.slice(0, 1024).split(",")) {
const [tag = "", ...parameters] = range.trim().split(";");
const language = tag.trim().split("-", 1)[0] ?? "";
const locale = localeByLanguage.get(language.toLowerCase());
if (!locale) {
continue;
}
let quality = 1;
for (const parameter of parameters) {
const [name, value] = parameter.trim().split("=");
if (name === "q") {
quality = /^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/.test(value ?? "")
? Number(value)
: 0;
}
}
if (quality > selectedQuality) {
selected = locale;
selectedQuality = quality;
}
}
return selected;
}
export const localeCookieName = "progmasoft_locale";
export interface LocaleCookieOptions {
domain: string | undefined;
httpOnly: true;
maxAge: number;
sameSite: "lax";
secure: boolean;
}
/**
* Attributes of the language-preference cookie.
*
* The preference is shared by every Progmasoft host, so on a production host
* the cookie belongs to the registrable domain. Any other host, such as a
* local development name, keeps a host-only cookie. The proxy redirect and
* the in-page language switch must write the same cookie, or one would leave
* a second cookie behind that shadows the other.
*/
export function localeCookieOptions(
host: string,
secure: boolean,
): LocaleCookieOptions {
const isProductionHost =
host === "progmasoft.com" || host.endsWith(".progmasoft.com");
return {
domain: isProductionHost ? ".progmasoft.com" : undefined,
httpOnly: true,
maxAge: 60 * 60 * 24 * 365,
sameSite: "lax",
secure,
};
}
/** The host a request was addressed to, without its port and in lower case. */
export function requestHost(
forwardedHost: string | null,
host: string | null,
): string {
return (forwardedHost ?? host)?.split(":", 1)[0]?.toLowerCase() ?? "";
}
export const messages = {
"en-US": {
metadata: {
homeTitle: "Progmasoft",
homeDescription:
"Progmasoft builds programming-language, package-management, and developer-tooling systems.",
accountTitle: "Account",
accountDescription: "Access and manage your Progmasoft account.",
loginTitle: "Sign in",
registerTitle: "Create account",
recoveryTitle: "Recover your account",
recoveryDescription: "Get help regaining access to a Progmasoft account.",
dashboardTitle: "Dashboard",
vigetTitle: "ViGet Package Registry by Progmasoft",
vigetDescription:
"The Tala package registry is online, but no packages have been published yet.",
dslPluginsTitle: "DSL Plugins · ViGet Package Registry by Progmasoft",
dslPluginsDescription:
"The ViGet Kotlin DSL plugin catalog is online, but no plugins have been published yet.",
},
navigation: {
primary: "Primary navigation",
organization: "Organization",
products: "Products",
principles: "Principles",
account: "Account",
dashboard: "Dashboard",
signIn: "Sign in",
createAccount: "Create account",
theme: "Theme",
light: "Light",
dark: "Dark",
language: "Language",
},
footer: {
summary:
"Programming-language infrastructure and developer systems built with durable contracts.",
products: "Products",
openSource: "Open source",
organization: "Organization",
support: "Support",
websiteSource: "Website source",
closing: "Designed for clarity, security, and long-term maintenance.",
},
account: {
securityLabel: "Account security properties",
trust: [
"Secure session cookie",
"Server-side password hashing",
"Rate-limited authentication",
],
landingEyebrow: "Progmasoft account",
landingTitle: "One clear identity for every supported service.",
landingDescription:
"Your account keeps profile, authentication, and service access under a dedicated security boundary.",
identity: [
[
"Account name",
"Your durable public identity and ViGet publisher name",
],
["Email", "Recovery and security notices"],
["Session", "Secure, revocable browser access"],
],
features: [
[
"Deliberate security",
"Passwords are hashed server-side and session tokens are stored only as digests.",
],
[
"Predictable names",
"Canonical account names prevent ambiguous URLs and case-only impersonation. ViGet uses this exact name as the package publisher; it does not create a second identity.",
],
[
"Service boundaries",
"Products request explicit account access instead of sharing hidden application state.",
],
],
loginEyebrow: "Progmasoft account",
loginTitle: "Sign in securely.",
loginDescription:
"Continue to your account dashboard and connected services.",
registerEyebrow: "Create an identity",
registerTitle: "Start with a durable account.",
registerDescription:
"Choose the name used in your Progmasoft account URL.",
recoveryEyebrow: "Account support",
recoveryTitle: "Recover your account.",
recoveryDescription:
"Use the verified support channel when you can no longer sign in.",
recoveryPanelEyebrow: "Account recovery",
recoveryPanelTitle: "Regain access safely",
recoveryPanelDescription:
"Automated password recovery is not available during the initial account-system rollout. Contact Progmasoft support from the email address registered to your account so ownership can be verified.",
recoveryEmailSubject: "Progmasoft account recovery",
contactSupport: "Contact support",
rememberedPassword: "Remembered your password?",
returnToSignIn: "Return to sign in",
},
auth: {
createHeading: "Create your account",
loginHeading: "Welcome back",
createDescription:
"Use one Progmasoft identity across supported services.",
loginDescription:
"Sign in with the email address attached to your Progmasoft account.",
accountName: "Account name",
accountHint:
"Use 8–128 ASCII letters or digits and begin with an uppercase letter.",
email: "Email address",
password: "Password",
forgotPassword: "Forgot password?",
passwordHint:
"Use at least 12 characters. Long passphrases are supported.",
confirmPassword: "Confirm password",
show: "Show",
hide: "Hide",
working: "Working…",
create: "Create account",
signIn: "Sign in",
or: "or",
google: "Continue with Google",
already: "Already have an account?",
newUser: "New to Progmasoft?",
createLink: "Create an account",
mismatch: "The password confirmation does not match.",
unreachable:
"The account service is temporarily unreachable. Try again shortly.",
missingName: "The server did not return an account name.",
unreadableName: "The Account name field could not be read.",
requestFailed: "The request could not be completed.",
googleSignInFailed: "Google sign-in could not be completed. Try again.",
googleAccountNameRequired:
"Choose an Account name before continuing with Google.",
googleAccountNameUnavailable:
"That Account name is unavailable. Choose another name.",
googleInvalidAccountName:
"Use a valid Account name before continuing with Google.",
googlePoliciesRequired:
"Accept the Privacy Policy and the Security Policy before continuing with Google.",
consentStart: "I have read and accept the ",
consentPrivacy: "Privacy Policy",
consentMiddle: " and the ",
consentSecurity: "Security Policy",
consentEnd: ".",
consentRequired:
"Accept the Privacy Policy and the Security Policy to create an account.",
},
dashboard: {
loading: "Loading account…",
loadFailed: "The dashboard could not be loaded.",
unreachable: "The account service is temporarily unreachable.",
navigation: "Dashboard navigation",
overview: "Overview",
security: "Security",
services: "Services",
signOut: "Sign out",
eyebrow: "Account overview",
welcome: "Welcome",
description: "Manage the identity used by Progmasoft services.",
profile: "Profile",
identity: "Account identity",
accountName: "Account name",
publisherName: "ViGet publisher name",
email: "Email",
created: "Created",
passwordSessions: "Password and sessions",
securityDescription:
"Your browser uses an HttpOnly secure session cookie. Session secrets are never stored as plaintext.",
changePassword: "Change password",
products: "Connected Progmasoft products",
publisherPrefix: "Publisher name",
sameAccount: "your Account name",
profileDescription: "Developer ecosystem profile",
planned: "Planned",
},
viget: {
navigationLabel: "Registry navigation",
packages: "Packages",
dslPlugins: "DSL plugins",
account: "Account",
login: "Log in",
register: "Register",
homeEyebrow: "ViGet package registry",
homeTitle: "Packages for the Tala ecosystem.",
homeDescription:
"ViGet is the canonical source for Tala packages and project DSL plugins, operated directly by Progmasoft.",
createAccount: "Create account",
exploreTala: "Explore Tala",
available: "Registry available",
emptyTitle: "The public catalog is empty.",
emptyDescription:
"No package releases have been published yet. ViGet will show real packages here as they become available.",
packageFormat: "Package format",
publisherIdentity: "Publisher identity",
publishing: "Publishing",
publishingClosed: "Not open yet",
catalogsEyebrow: "Catalogs",
catalogsTitle: "Two artifact types, one registry.",
catalogsDescription:
"Packages and project DSL plugins have separate, predictable coordinate spaces.",
talaPackages: "Tala packages",
vipkgCatalog: "ViPkg catalog",
vipkgDescription:
"Libraries and applications authored in Tala, distributed as .vipkg artifacts.",
projectExtensions: "Project extensions",
kotlinPlugins: "Kotlin DSL plugins",
kotlinDescription:
"Kotlin JAR plugins that extend the project file of Tazel.",
openCatalog: "Open catalog",
contractEyebrow: "Registry contract",
contractTitle: "Clear ownership from identity to artifact.",
principles: [
[
"One account name",
"Your Progmasoft Account name is also your ViGet publisher name.",
],
[
"Case-sensitive coordinates",
"Publisher and package names retain their exact public spelling.",
],
[
"No placeholder releases",
"The catalog stays honestly empty until a real signed artifact is published.",
],
],
pluginEyebrow: "ViGet · Kotlin DSL plugins",
pluginTitle: "Extend the project model.",
pluginDescription:
"Kotlin DSL plugins are JAR artifacts for the project file of Tazel. They are separate from Tala .vipkg packages.",
backToPackages: "Back to packages",
followDevelopment: "Follow development",
pluginAvailable: "Catalog available",
pluginEmptyTitle: "No public DSL plugins yet.",
pluginEmptyDescription:
"The catalog is ready and intentionally contains no placeholder artifacts.",
guidance: [
[
"Format",
"Kotlin JAR",
"DSL plugins run as Kotlin/JVM project extensions.",
],
[
"Location",
"Dedicated catalog",
"Plugin coordinates always begin with /dslplugins/tazel.",
],
[
"Availability",
"Progmasoft first",
"Progmasoft publishes the first plugins; publishing opens to every account later.",
],
],
footerDescription:
"ViGet is the package and Kotlin DSL plugin registry for the Tala ecosystem.",
registry: "Registry",
support: "Support",
source: "Source",
footerClosing: "ViGet Package Registry by Progmasoft",
},
},
"de-DE": {
metadata: {
homeTitle: "Progmasoft",
homeDescription:
"Progmasoft entwickelt Systeme für Programmiersprachen, Paketverwaltung und Entwicklerwerkzeuge.",
accountTitle: "Konto",
accountDescription: "Öffnen und verwalten Sie Ihr Progmasoft-Konto.",
loginTitle: "Anmelden",
registerTitle: "Konto erstellen",
recoveryTitle: "Konto wiederherstellen",
recoveryDescription:
"Erhalten Sie Hilfe beim Wiederherstellen des Zugriffs auf ein Progmasoft-Konto.",
dashboardTitle: "Kontoübersicht",
vigetTitle: "ViGet-Paketregistrierung von Progmasoft",
vigetDescription:
"Die Tala-Paketregistrierung ist online, enthält aber noch keine veröffentlichten Pakete.",
dslPluginsTitle: "DSL-Plugins · ViGet-Paketregistrierung von Progmasoft",
dslPluginsDescription:
"Der ViGet-Katalog für Kotlin-DSL-Plugins ist online, enthält aber noch keine veröffentlichten Plugins.",
},
navigation: {
primary: "Hauptnavigation",
organization: "Organisation",
products: "Produkte",
principles: "Grundsätze",
account: "Konto",
dashboard: "Übersicht",
signIn: "Anmelden",
createAccount: "Konto erstellen",
theme: "Darstellung",
light: "Hell",
dark: "Dunkel",
language: "Sprache",
},
footer: {
summary:
"Programmiersprachen-Infrastruktur und Entwicklersysteme auf der Grundlage beständiger Verträge.",
products: "Produkte",
openSource: "Open Source",
organization: "Organisation",
support: "Support",
websiteSource: "Quellcode der Website",
closing:
"Entwickelt für Klarheit, Sicherheit und langfristige Wartbarkeit.",
},
account: {
securityLabel: "Sicherheitsmerkmale des Kontos",
trust: [
"Sicheres Sitzungs-Cookie",
"Serverseitiges Passwort-Hashing",
"Begrenzte Anmeldeversuche",
],
landingEyebrow: "Progmasoft-Konto",
landingTitle: "Eine klare Identität für jeden unterstützten Dienst.",
landingDescription:
"Ihr Konto hält Profil, Authentifizierung und Dienstzugriff in einem eigenen Sicherheitsbereich.",
identity: [
[
"Kontoname",
"Ihre beständige öffentliche Identität und Ihr ViGet-Publishername",
],
["E-Mail", "Wiederherstellungs- und Sicherheitshinweise"],
["Sitzung", "Sicherer, widerrufbarer Browserzugriff"],
],
features: [
[
"Bewusste Sicherheit",
"Passwörter werden serverseitig gehasht; Sitzungstoken werden nur als Digests gespeichert.",
],
[
"Eindeutige Namen",
"Kanonische Kontonamen verhindern mehrdeutige URLs und Nachahmung nur durch Groß-/Kleinschreibung. ViGet verwendet exakt diesen Namen als Publisher und erstellt keine zweite Identität.",
],
[
"Klare Dienstgrenzen",
"Produkte fordern ausdrücklichen Kontozugriff an, statt verborgenen Anwendungszustand zu teilen.",
],
],
loginEyebrow: "Progmasoft-Konto",
loginTitle: "Sicher anmelden.",
loginDescription:
"Weiter zur Kontoübersicht und zu verbundenen Diensten.",
registerEyebrow: "Identität erstellen",
registerTitle: "Beginnen Sie mit einem beständigen Konto.",
registerDescription:
"Wählen Sie den Namen für Ihre Progmasoft-Konto-URL.",
recoveryEyebrow: "Kontosupport",
recoveryTitle: "Konto wiederherstellen.",
recoveryDescription:
"Nutzen Sie den verifizierten Supportkanal, wenn Sie sich nicht mehr anmelden können.",
recoveryPanelEyebrow: "Kontowiederherstellung",
recoveryPanelTitle: "Zugriff sicher wiederherstellen",
recoveryPanelDescription:
"Die automatische Passwortwiederherstellung ist während der ersten Einführung des Kontosystems nicht verfügbar. Kontaktieren Sie den Progmasoft-Support von der im Konto registrierten E-Mail-Adresse, damit die Inhaberschaft geprüft werden kann.",
recoveryEmailSubject: "Wiederherstellung des Progmasoft-Kontos",
contactSupport: "Support kontaktieren",
rememberedPassword: "Passwort wieder eingefallen?",
returnToSignIn: "Zur Anmeldung",
},
auth: {
createHeading: "Konto erstellen",
loginHeading: "Willkommen zurück",
createDescription:
"Nutzen Sie eine Progmasoft-Identität für alle unterstützten Dienste.",
loginDescription:
"Melden Sie sich mit der E-Mail-Adresse Ihres Progmasoft-Kontos an.",
accountName: "Kontoname",
accountHint:
"Verwenden Sie 8–128 ASCII-Buchstaben oder Ziffern und beginnen Sie mit einem Großbuchstaben.",
email: "E-Mail-Adresse",
password: "Passwort",
forgotPassword: "Passwort vergessen?",
passwordHint:
"Verwenden Sie mindestens 12 Zeichen. Lange Passphrasen werden unterstützt.",
confirmPassword: "Passwort bestätigen",
show: "Anzeigen",
hide: "Ausblenden",
|