mapa-frontend-i18n 1.0.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.
- package/fesm2022/mapa-frontend-i18n.mjs +9139 -0
- package/fesm2022/mapa-frontend-i18n.mjs.map +1 -0
- package/index.d.ts +168 -0
- package/mapa-frontend-i18n-1.0.0.tgz +0 -0
- package/package.json +22 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
type AppLanguage = "pt-BR" | "es" | "en";
|
|
2
|
+
interface AppLanguageOption {
|
|
3
|
+
code: AppLanguage;
|
|
4
|
+
angularLocale: string;
|
|
5
|
+
intlLocale: string;
|
|
6
|
+
htmlLang: string;
|
|
7
|
+
label: string;
|
|
8
|
+
codeLabel: string;
|
|
9
|
+
flag: "br" | "es" | "en";
|
|
10
|
+
}
|
|
11
|
+
declare const APP_LANGUAGE_STORAGE_KEY = "menu.language";
|
|
12
|
+
declare const DEFAULT_APP_LANGUAGE: AppLanguage;
|
|
13
|
+
declare const APP_LANGUAGE_OPTIONS: readonly AppLanguageOption[];
|
|
14
|
+
declare function isAppLanguage(value: string | null | undefined): value is AppLanguage;
|
|
15
|
+
declare function resolveAppLanguage(value: string | null | undefined): AppLanguage;
|
|
16
|
+
declare function getAppLanguageOption(language: AppLanguage): AppLanguageOption;
|
|
17
|
+
|
|
18
|
+
type RuntimeTranslationCatalog = Record<AppLanguage, Record<string, string>>;
|
|
19
|
+
declare const ANGULAR_RUNTIME_TRANSLATIONS: RuntimeTranslationCatalog;
|
|
20
|
+
|
|
21
|
+
declare const MCA_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
22
|
+
|
|
23
|
+
declare const MENU_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
24
|
+
|
|
25
|
+
declare const MF_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
26
|
+
|
|
27
|
+
declare const MGA_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
28
|
+
|
|
29
|
+
declare const MGC_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
30
|
+
|
|
31
|
+
declare const MO_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
32
|
+
|
|
33
|
+
declare const MP_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
34
|
+
|
|
35
|
+
declare const MV_TRANSLATIONS: Record<AppLanguage, Record<string, string>>;
|
|
36
|
+
|
|
37
|
+
declare function getStoredAppLanguage(): AppLanguage;
|
|
38
|
+
declare function persistAppLanguage(language: AppLanguage): void;
|
|
39
|
+
declare function getAngularLocale(language: AppLanguage): string;
|
|
40
|
+
declare function getIntlLocale(language: AppLanguage): string;
|
|
41
|
+
declare function applyDocumentLanguage(language: AppLanguage): void;
|
|
42
|
+
interface InitializeAppLanguageOptions {
|
|
43
|
+
clearExistingTranslations?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare function initializeAppLanguage(options?: InitializeAppLanguageOptions): AppLanguage;
|
|
46
|
+
|
|
47
|
+
interface ValidationContext {
|
|
48
|
+
max?: string | number;
|
|
49
|
+
min?: string | number;
|
|
50
|
+
requiredLength?: number;
|
|
51
|
+
}
|
|
52
|
+
type ValidationTextResolver = string | ((context?: ValidationContext) => string);
|
|
53
|
+
interface MapaUiTextGroups {
|
|
54
|
+
common: {
|
|
55
|
+
selectAll: string;
|
|
56
|
+
};
|
|
57
|
+
filters: {
|
|
58
|
+
clear: string;
|
|
59
|
+
submit: string;
|
|
60
|
+
};
|
|
61
|
+
datepicker: {
|
|
62
|
+
startDatePlaceholder: string;
|
|
63
|
+
endDatePlaceholder: string;
|
|
64
|
+
};
|
|
65
|
+
capability: {
|
|
66
|
+
groupAverageTitle: string;
|
|
67
|
+
individualAverageTitle: string;
|
|
68
|
+
conceptTitle: string;
|
|
69
|
+
resultTitle: string;
|
|
70
|
+
positiveIndicatorsTitle: string;
|
|
71
|
+
negativeIndicatorsTitle: string;
|
|
72
|
+
riskIndicatorsTitle: string;
|
|
73
|
+
precipitationRiskTitle: string;
|
|
74
|
+
negligenceRiskTitle: string;
|
|
75
|
+
negativeDirectionLabel: string;
|
|
76
|
+
positiveDirectionLabel: string;
|
|
77
|
+
};
|
|
78
|
+
paginator: {
|
|
79
|
+
itemsPerPage: string;
|
|
80
|
+
nextPage: string;
|
|
81
|
+
previousPage: string;
|
|
82
|
+
rangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
83
|
+
showingRangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
84
|
+
};
|
|
85
|
+
validation: {
|
|
86
|
+
cnpj: ValidationTextResolver;
|
|
87
|
+
cpf: ValidationTextResolver;
|
|
88
|
+
email: ValidationTextResolver;
|
|
89
|
+
max: ValidationTextResolver;
|
|
90
|
+
maxLength: ValidationTextResolver;
|
|
91
|
+
min: ValidationTextResolver;
|
|
92
|
+
minLength: ValidationTextResolver;
|
|
93
|
+
pattern: ValidationTextResolver;
|
|
94
|
+
required: ValidationTextResolver;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
type PartialMapaUiTexts = Partial<{
|
|
98
|
+
[K in keyof MapaUiTextGroups]: Partial<MapaUiTextGroups[K]>;
|
|
99
|
+
}>;
|
|
100
|
+
interface PaginatorIntlLike {
|
|
101
|
+
itemsPerPageLabel: string;
|
|
102
|
+
nextPageLabel: string;
|
|
103
|
+
previousPageLabel: string;
|
|
104
|
+
getRangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
105
|
+
changes: {
|
|
106
|
+
next: () => void;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
type PaginatorIntlMode = "range" | "showingRange";
|
|
110
|
+
declare function formatPaginatorRange(page: number, pageSize: number, length: number, language: AppLanguage): string;
|
|
111
|
+
declare function formatPaginatorShowingRange(page: number, pageSize: number, length: number, language: AppLanguage): string;
|
|
112
|
+
declare function applyPaginatorIntl(paginatorIntl: PaginatorIntlLike, language: AppLanguage, config?: {
|
|
113
|
+
hideNavigationLabels?: boolean;
|
|
114
|
+
mode?: PaginatorIntlMode;
|
|
115
|
+
}): void;
|
|
116
|
+
declare function getPaginatorNavigationLabels(language: AppLanguage): {
|
|
117
|
+
jumpBackLabel: string;
|
|
118
|
+
jumpForwardLabel: string;
|
|
119
|
+
goToPageLabel: (page: number) => string;
|
|
120
|
+
};
|
|
121
|
+
declare const MAPA_UI_TEXTS_PT_BR: {
|
|
122
|
+
common: {
|
|
123
|
+
selectAll: string;
|
|
124
|
+
};
|
|
125
|
+
filters: {
|
|
126
|
+
clear: string;
|
|
127
|
+
submit: string;
|
|
128
|
+
};
|
|
129
|
+
datepicker: {
|
|
130
|
+
startDatePlaceholder: string;
|
|
131
|
+
endDatePlaceholder: string;
|
|
132
|
+
};
|
|
133
|
+
capability: {
|
|
134
|
+
groupAverageTitle: string;
|
|
135
|
+
individualAverageTitle: string;
|
|
136
|
+
conceptTitle: string;
|
|
137
|
+
resultTitle: string;
|
|
138
|
+
positiveIndicatorsTitle: string;
|
|
139
|
+
negativeIndicatorsTitle: string;
|
|
140
|
+
riskIndicatorsTitle: string;
|
|
141
|
+
precipitationRiskTitle: string;
|
|
142
|
+
negligenceRiskTitle: string;
|
|
143
|
+
negativeDirectionLabel: string;
|
|
144
|
+
positiveDirectionLabel: string;
|
|
145
|
+
};
|
|
146
|
+
paginator: {
|
|
147
|
+
itemsPerPage: string;
|
|
148
|
+
nextPage: string;
|
|
149
|
+
previousPage: string;
|
|
150
|
+
rangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
151
|
+
showingRangeLabel: (page: number, pageSize: number, length: number) => string;
|
|
152
|
+
};
|
|
153
|
+
validation: {
|
|
154
|
+
cnpj: string;
|
|
155
|
+
cpf: string;
|
|
156
|
+
email: string;
|
|
157
|
+
max: (context?: ValidationContext) => string;
|
|
158
|
+
maxLength: (context?: ValidationContext) => string;
|
|
159
|
+
min: (context?: ValidationContext) => string;
|
|
160
|
+
minLength: (context?: ValidationContext) => string;
|
|
161
|
+
pattern: string;
|
|
162
|
+
required: string;
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
declare function getMapaUiTexts(language: AppLanguage): PartialMapaUiTexts;
|
|
166
|
+
|
|
167
|
+
export { ANGULAR_RUNTIME_TRANSLATIONS, APP_LANGUAGE_OPTIONS, APP_LANGUAGE_STORAGE_KEY, DEFAULT_APP_LANGUAGE, MAPA_UI_TEXTS_PT_BR, MCA_TRANSLATIONS, MENU_TRANSLATIONS, MF_TRANSLATIONS, MGA_TRANSLATIONS, MGC_TRANSLATIONS, MO_TRANSLATIONS, MP_TRANSLATIONS, MV_TRANSLATIONS, applyDocumentLanguage, applyPaginatorIntl, formatPaginatorRange, formatPaginatorShowingRange, getAngularLocale, getAppLanguageOption, getIntlLocale, getMapaUiTexts, getPaginatorNavigationLabels, getStoredAppLanguage, initializeAppLanguage, isAppLanguage, persistAppLanguage, resolveAppLanguage };
|
|
168
|
+
export type { AppLanguage, AppLanguageOption, InitializeAppLanguageOptions, PartialMapaUiTexts };
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mapa-frontend-i18n",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/localize": "^20.0.0"
|
|
6
|
+
},
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"tslib": "^2.8.1"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"module": "fesm2022/mapa-frontend-i18n.mjs",
|
|
12
|
+
"typings": "index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": {
|
|
15
|
+
"default": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./index.d.ts",
|
|
19
|
+
"default": "./fesm2022/mapa-frontend-i18n.mjs"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|