@artel/artc 0.6.25274 → 0.6.25275
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/build/Cli.js +3 -3
- package/build/api/Api.js +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +1 -1
- package/build/{chunk-6JA436J2.js → chunk-DB2CJDOL.js} +55 -29
- package/build/{chunk-DXF6BY5D.js → chunk-ORP2UF4D.js} +2 -2
- package/build/{chunk-GDE2NNW7.js → chunk-TYQHZ7HH.js} +1 -1
- package/build/types/analysis/AnalyzedTextTranslationPackage.d.ts +2 -3
- package/build/types/analysis/Analyzer.d.ts +1 -1
- package/build/types/emitter/EmitterContext.d.ts +1 -0
- package/build/types/emitter/Entities.d.ts +2 -1
- package/build/types/entities/interfaces/PackageEntity.d.ts +3 -2
- package/build/types/project/SourcePackage.d.ts +5 -3
- package/build/types/project/configuration/types/PackageConfigurationEn.d.ts +2 -1
- package/build/types/project/configuration/types/PackageConfigurationRu.d.ts +2 -1
- package/package.json +1 -1
package/build/Cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CommandLineCompiler
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-ORP2UF4D.js";
|
|
5
|
+
import "./chunk-TYQHZ7HH.js";
|
|
6
6
|
import {
|
|
7
7
|
__async
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DB2CJDOL.js";
|
|
9
9
|
|
|
10
10
|
// source/Cli.ts
|
|
11
11
|
function main() {
|
package/build/api/Api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-TYQHZ7HH.js";
|
|
4
4
|
import {
|
|
5
5
|
AccessKind,
|
|
6
6
|
AccessedFunctionParameter,
|
|
@@ -344,7 +344,7 @@ import {
|
|
|
344
344
|
withoutQuotes,
|
|
345
345
|
withoutTemplateQuotes,
|
|
346
346
|
yieldExecution
|
|
347
|
-
} from "../chunk-
|
|
347
|
+
} from "../chunk-DB2CJDOL.js";
|
|
348
348
|
export {
|
|
349
349
|
AccessKind,
|
|
350
350
|
AccessedFunctionParameter,
|
package/build/api/ApiNodeJS.js
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
PhysicalFileSystem,
|
|
7
7
|
PhysicalTypeScriptLibrariesProvider,
|
|
8
8
|
PrintingDiagnosticAcceptor
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ORP2UF4D.js";
|
|
10
|
+
import "../chunk-TYQHZ7HH.js";
|
|
11
|
+
import "../chunk-DB2CJDOL.js";
|
|
12
12
|
export {
|
|
13
13
|
CommandLineCompiler,
|
|
14
14
|
FileSystemUri,
|
package/build/api/ApiServices.js
CHANGED
|
@@ -77,10 +77,10 @@ var PackageDialect = /* @__PURE__ */ ((PackageDialect49) => {
|
|
|
77
77
|
})(PackageDialect || {});
|
|
78
78
|
|
|
79
79
|
// source/common/PackageLocale.ts
|
|
80
|
-
var PackageLocale = /* @__PURE__ */ ((
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return
|
|
80
|
+
var PackageLocale = /* @__PURE__ */ ((PackageLocale55) => {
|
|
81
|
+
PackageLocale55[PackageLocale55["En"] = 0] = "En";
|
|
82
|
+
PackageLocale55[PackageLocale55["Ru"] = 1] = "Ru";
|
|
83
|
+
return PackageLocale55;
|
|
84
84
|
})(PackageLocale || {});
|
|
85
85
|
var locales = [
|
|
86
86
|
{ locale: 0 /* En */, code: "en", names: ["english", "\u0430\u043D\u0433\u043B\u0438\u0439\u0441\u043A\u0438\u0439"] },
|
|
@@ -712,7 +712,7 @@ var UniqueWithComparatorQuery = class extends Query {
|
|
|
712
712
|
};
|
|
713
713
|
|
|
714
714
|
// source/common/Constants.ts
|
|
715
|
-
var ArtelVersion = true ? "0.6.
|
|
715
|
+
var ArtelVersion = true ? "0.6.25275" : "";
|
|
716
716
|
var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel"];
|
|
717
717
|
var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
|
|
718
718
|
var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
|
|
@@ -12272,8 +12272,9 @@ var InterfacePackageEntityInfo;
|
|
|
12272
12272
|
InterfacePackageEntityInfo2.DotNet = DotNet;
|
|
12273
12273
|
})(InterfacePackageEntityInfo || (InterfacePackageEntityInfo = {}));
|
|
12274
12274
|
var TextTranslationPackageEntityInfo = class {
|
|
12275
|
-
constructor(translationLocale, targetPackage) {
|
|
12275
|
+
constructor(translationLocale, isPrimaryTranslation, targetPackage) {
|
|
12276
12276
|
this.translationLocale = translationLocale;
|
|
12277
|
+
this.isPrimaryTranslation = isPrimaryTranslation;
|
|
12277
12278
|
this.targetPackage = targetPackage;
|
|
12278
12279
|
}
|
|
12279
12280
|
};
|
|
@@ -13926,6 +13927,9 @@ var TextTranslationPackage = class extends SourcePackageBase {
|
|
|
13926
13927
|
get translationLocale() {
|
|
13927
13928
|
return this.configuration.translationLocale;
|
|
13928
13929
|
}
|
|
13930
|
+
get isPrimaryTranslation() {
|
|
13931
|
+
return this.configuration.isPrimaryTranslation;
|
|
13932
|
+
}
|
|
13929
13933
|
};
|
|
13930
13934
|
var TranslationPackageConfiguration = class {
|
|
13931
13935
|
constructor(targetPackageName, translatedName, translationLocale, locale, dialect = DefaultDialect) {
|
|
@@ -13938,19 +13942,16 @@ var TranslationPackageConfiguration = class {
|
|
|
13938
13942
|
}
|
|
13939
13943
|
};
|
|
13940
13944
|
var TextTranslationPackageConfiguration = class {
|
|
13941
|
-
constructor(targetPackageName, translationLocale, locale, dialect = DefaultDialect, version, packageImportLocales = [], automaticallyImportedPackages) {
|
|
13945
|
+
constructor(targetPackageName, translationLocale, isPrimaryTranslation = false, locale, dialect = DefaultDialect, version, packageImportLocales = [], automaticallyImportedPackages) {
|
|
13942
13946
|
this.targetPackageName = targetPackageName;
|
|
13943
13947
|
this.translationLocale = translationLocale;
|
|
13948
|
+
this.isPrimaryTranslation = isPrimaryTranslation;
|
|
13944
13949
|
this.locale = locale;
|
|
13945
13950
|
this.dialect = dialect;
|
|
13946
13951
|
this.version = version;
|
|
13947
13952
|
this.packageImportLocales = packageImportLocales;
|
|
13948
13953
|
this.automaticallyImportedPackages = automaticallyImportedPackages;
|
|
13949
|
-
this.name = new PackageName2([
|
|
13950
|
-
...this.targetPackageName.segments,
|
|
13951
|
-
new Name("~"),
|
|
13952
|
-
new Name(localeToString(this.translationLocale))
|
|
13953
|
-
]);
|
|
13954
|
+
this.name = new PackageName2([...this.targetPackageName.segments, new Name("~"), new Name(this.translationLocale)]);
|
|
13954
13955
|
}
|
|
13955
13956
|
};
|
|
13956
13957
|
var ProgramPackageConfiguration = class {
|
|
@@ -14188,7 +14189,8 @@ var ConfigurationConverter = class _ConfigurationConverter {
|
|
|
14188
14189
|
}
|
|
14189
14190
|
static convertTextTranslationsConfiguration(configuration, defaultLocale, defaultDialect) {
|
|
14190
14191
|
const targetPackageName = PackageName2.parse(configuration.originalPackageName);
|
|
14191
|
-
const translationLocale =
|
|
14192
|
+
const translationLocale = configuration.translationLanguage;
|
|
14193
|
+
const isPrimaryTranslation = configuration.isPrimaryTranslation ?? false;
|
|
14192
14194
|
const locale = configuration.language !== void 0 ? this.convertLanguage(configuration.language) : defaultLocale ?? DefaultLocale;
|
|
14193
14195
|
const dialect = configuration.dialect !== void 0 ? this.convertDialect(configuration.dialect) : defaultDialect ?? DefaultDialect;
|
|
14194
14196
|
const packageImportLocales = _ConfigurationConverter.convertPackageImportLanguages(
|
|
@@ -14198,6 +14200,7 @@ var ConfigurationConverter = class _ConfigurationConverter {
|
|
|
14198
14200
|
return new TextTranslationPackageConfiguration(
|
|
14199
14201
|
targetPackageName,
|
|
14200
14202
|
translationLocale,
|
|
14203
|
+
isPrimaryTranslation,
|
|
14201
14204
|
locale,
|
|
14202
14205
|
dialect,
|
|
14203
14206
|
configuration.version ?? "1.0",
|
|
@@ -14837,7 +14840,10 @@ var config_en_schema_default = {
|
|
|
14837
14840
|
type: "string"
|
|
14838
14841
|
},
|
|
14839
14842
|
translationLanguage: {
|
|
14840
|
-
|
|
14843
|
+
type: "string"
|
|
14844
|
+
},
|
|
14845
|
+
isPrimaryTranslation: {
|
|
14846
|
+
type: "boolean"
|
|
14841
14847
|
},
|
|
14842
14848
|
language: {
|
|
14843
14849
|
$ref: "#/definitions/Language"
|
|
@@ -15356,7 +15362,10 @@ var config_ru_schema_default = {
|
|
|
15356
15362
|
type: "string"
|
|
15357
15363
|
},
|
|
15358
15364
|
\u044F\u0437\u044B\u043A\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0430: {
|
|
15359
|
-
|
|
15365
|
+
type: "string"
|
|
15366
|
+
},
|
|
15367
|
+
\u044D\u0442\u043E\u041F\u0435\u0440\u0432\u0438\u0447\u043D\u044B\u0439\u041F\u0435\u0440\u0435\u0432\u043E\u0434: {
|
|
15368
|
+
$ref: "#/definitions/\u0414\u0430\u041D\u0435\u0442"
|
|
15360
15369
|
},
|
|
15361
15370
|
\u044F\u0437\u044B\u043A: {
|
|
15362
15371
|
$ref: "#/definitions/\u042F\u0437\u044B\u043A"
|
|
@@ -15486,7 +15495,8 @@ var RussianConfigurationTranslator = class {
|
|
|
15486
15495
|
return {
|
|
15487
15496
|
type: "TextTranslations",
|
|
15488
15497
|
originalPackageName: value.\u0438\u043C\u044F\u041F\u0430\u043A\u0435\u0442\u0430\u0418\u0441\u0445\u043E\u0434\u043D\u043E\u0435,
|
|
15489
|
-
translationLanguage:
|
|
15498
|
+
translationLanguage: value.\u044F\u0437\u044B\u043A\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0430,
|
|
15499
|
+
isPrimaryTranslation: this.translateYesNo(value.\u044D\u0442\u043E\u041F\u0435\u0440\u0432\u0438\u0447\u043D\u044B\u0439\u041F\u0435\u0440\u0435\u0432\u043E\u0434),
|
|
15490
15500
|
version: value.\u0432\u0435\u0440\u0441\u0438\u044F,
|
|
15491
15501
|
language: value.\u044F\u0437\u044B\u043A !== void 0 ? this.translateLanguage(value.\u044F\u0437\u044B\u043A) : void 0,
|
|
15492
15502
|
dialect: value.\u0434\u0438\u0430\u043B\u0435\u043A\u0442 !== void 0 ? this.translateDialect(value.\u0434\u0438\u0430\u043B\u0435\u043A\u0442) : void 0,
|
|
@@ -20799,7 +20809,7 @@ var FSTreeCompilationLoader = class {
|
|
|
20799
20809
|
} else if (configuration instanceof TranslationPackageConfiguration) {
|
|
20800
20810
|
Logger.info(`\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u043A\u0435\u0442 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u043E\u0432 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u0430 '${configuration.targetPackageName}' \u043D\u0430 \u044F\u0437\u044B\u043A '${localeToString(configuration.translationLocale)}' \u043F\u043E \u043F\u0443\u0442\u0438 '${directory.uri}'.`);
|
|
20801
20811
|
} else if (configuration instanceof TextTranslationPackageConfiguration) {
|
|
20802
|
-
Logger.info(`\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u043A\u0435\u0442 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u043E\u0432 \u0442\u0435\u043A\u0441\u0442\u043E\u0432 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u0430 '${configuration.targetPackageName}' \u043D\u0430 \u044F\u0437\u044B\u043A '${
|
|
20812
|
+
Logger.info(`\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u043A\u0435\u0442 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u043E\u0432 \u0442\u0435\u043A\u0441\u0442\u043E\u0432 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u0430 '${configuration.targetPackageName}' \u043D\u0430 \u044F\u0437\u044B\u043A '${configuration.translationLocale}' \u043F\u043E \u043F\u0443\u0442\u0438 '${directory.uri}'.`);
|
|
20803
20813
|
}
|
|
20804
20814
|
}
|
|
20805
20815
|
const sourceFiles = new Array();
|
|
@@ -26107,8 +26117,8 @@ var AnalyzedTextTranslationPackage = class {
|
|
|
26107
26117
|
this.targetPackage = targetPackage;
|
|
26108
26118
|
this.entitiesByTextKey = new Cached();
|
|
26109
26119
|
}
|
|
26110
|
-
|
|
26111
|
-
return this.package_.
|
|
26120
|
+
isPrimaryTranslation() {
|
|
26121
|
+
return this.package_.isPrimaryTranslation;
|
|
26112
26122
|
}
|
|
26113
26123
|
getTargetPackage() {
|
|
26114
26124
|
return this.targetPackage;
|
|
@@ -47914,7 +47924,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
|
47914
47924
|
}
|
|
47915
47925
|
get primaryTextTranslationPackage() {
|
|
47916
47926
|
return this.primaryTextTranslationPackage_.getOrInsertWith(() => {
|
|
47917
|
-
return this.analyzer.enumerateAnalyzedTextTranslationPackages().first((p) => p.
|
|
47927
|
+
return this.analyzer.enumerateAnalyzedTextTranslationPackages().first((p) => p.isPrimaryTranslation());
|
|
47918
47928
|
});
|
|
47919
47929
|
}
|
|
47920
47930
|
get isInterfacePackageFile() {
|
|
@@ -50180,7 +50190,7 @@ var DiagnosticCollector = class _DiagnosticCollector {
|
|
|
50180
50190
|
semanticContext.validateNameConflicts(this.diagnosticAcceptor);
|
|
50181
50191
|
}
|
|
50182
50192
|
const pkg2 = this.textTranslationPackage;
|
|
50183
|
-
if (pkg2 !== void 0 && !pkg2.
|
|
50193
|
+
if (pkg2 !== void 0 && !pkg2.isPrimaryTranslation()) {
|
|
50184
50194
|
const primaryPkg = this.primaryTextTranslationPackage;
|
|
50185
50195
|
if (primaryPkg !== void 0) {
|
|
50186
50196
|
const textTranslations = primaryPkg.getEntitiesByTextKey(TextIdentity.keyFromTextTranslationSource(sourceText));
|
|
@@ -51879,6 +51889,7 @@ var SourcePackageEntity = class {
|
|
|
51879
51889
|
if (this.package_.kind === "text-translation") {
|
|
51880
51890
|
return new TextTranslationPackageEntityInfo(
|
|
51881
51891
|
this.package_.configuration.translationLocale,
|
|
51892
|
+
this.package_.configuration.isPrimaryTranslation,
|
|
51882
51893
|
this.analyzer.getPackageEntityByName(this.package_.configuration.targetPackageName)
|
|
51883
51894
|
);
|
|
51884
51895
|
}
|
|
@@ -55708,6 +55719,7 @@ var PackageEntityDetails = class {
|
|
|
55708
55719
|
this.isPackageWithMainFunction = false;
|
|
55709
55720
|
this.isTextTranslationPackage = false;
|
|
55710
55721
|
this.textTranslationLocale = void 0;
|
|
55722
|
+
this.isPrimaryTranslation = false;
|
|
55711
55723
|
this.translationTarget = void 0;
|
|
55712
55724
|
this.thisPackageVariableEntity = void 0;
|
|
55713
55725
|
this.isMainPackage = false;
|
|
@@ -57982,6 +57994,9 @@ var WellKnownDeclarationKeys = class {
|
|
|
57982
57994
|
static {
|
|
57983
57995
|
this.translatorAddTranslationToLocaleMethod = "\u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u0410\u0440\u0442\u0435\u043B\u044C.\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0447\u0438\u043A.\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C-\u043F\u0435\u0440\u0435\u0432\u043E\u0434-\u043D\u0430-\u044F\u0437\u044B\u043A";
|
|
57984
57996
|
}
|
|
57997
|
+
static {
|
|
57998
|
+
this.translatorLanguageField = "\u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u0410\u0440\u0442\u0435\u043B\u044C.\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0447\u0438\u043A.\u044F\u0437\u044B\u043A";
|
|
57999
|
+
}
|
|
57985
58000
|
};
|
|
57986
58001
|
var TypeUtils2 = class {
|
|
57987
58002
|
constructor(ectx) {
|
|
@@ -58937,6 +58952,7 @@ var EntityMap = class _EntityMap {
|
|
|
58937
58952
|
if (textTranslationPackageInfo !== void 0) {
|
|
58938
58953
|
result.details.isTextTranslationPackage = true;
|
|
58939
58954
|
result.details.textTranslationLocale = textTranslationPackageInfo.translationLocale;
|
|
58955
|
+
result.details.isPrimaryTranslation = textTranslationPackageInfo.isPrimaryTranslation;
|
|
58940
58956
|
if (textTranslationPackageInfo.targetPackage !== void 0) {
|
|
58941
58957
|
result.details.translationTarget = this.getPackageEntity(textTranslationPackageInfo.targetPackage);
|
|
58942
58958
|
}
|
|
@@ -61726,13 +61742,12 @@ var GeneralLoweringContext = class {
|
|
|
61726
61742
|
this.dictionaryType_ = new Cached();
|
|
61727
61743
|
this.dictionaryConstructor_ = new Cached();
|
|
61728
61744
|
this.dictionaryAddMethod_ = new Cached();
|
|
61729
|
-
this.translatorAddTranslationToLocaleMethod_ = new Cached();
|
|
61730
61745
|
this.packageType_ = new Cached();
|
|
61731
61746
|
this.packageConstructor_ = new Cached();
|
|
61732
61747
|
this.packageThisPackageField_ = new Cached();
|
|
61733
61748
|
this.packageMainPackageField_ = new Cached();
|
|
61734
|
-
this.
|
|
61735
|
-
this.
|
|
61749
|
+
this.translatorAddTranslationToLocaleMethod_ = new Cached();
|
|
61750
|
+
this.translatorLanguageField_ = new Cached();
|
|
61736
61751
|
this.ectx = ectx;
|
|
61737
61752
|
this.packages = packages;
|
|
61738
61753
|
this.helperFunctions = new HelperFunctions(this);
|
|
@@ -61779,9 +61794,6 @@ var GeneralLoweringContext = class {
|
|
|
61779
61794
|
get dictionaryAddMethod() {
|
|
61780
61795
|
return this.dictionaryAddMethod_.getOrInsertWith(() => this.ectx.entityFinder.findMethodEntity(WellKnownDeclarationKeys.dictionaryAddMethod));
|
|
61781
61796
|
}
|
|
61782
|
-
get translatorAddTranslationToLocaleMethod() {
|
|
61783
|
-
return this.translatorAddTranslationToLocaleMethod_.getOrInsertWith(() => this.ectx.entityFinder.findMethodEntity(WellKnownDeclarationKeys.translatorAddTranslationToLocaleMethod));
|
|
61784
|
-
}
|
|
61785
61797
|
get packageType() {
|
|
61786
61798
|
return this.packageType_.getOrInsertWith(() => this.ectx.entityFinder.findTypeOrExtensionEntity(WellKnownDeclarationKeys.packageType));
|
|
61787
61799
|
}
|
|
@@ -61794,6 +61806,12 @@ var GeneralLoweringContext = class {
|
|
|
61794
61806
|
get packageMainPackageField() {
|
|
61795
61807
|
return this.packageMainPackageField_.getOrInsertWith(() => this.ectx.entityFinder.findFieldEntity(WellKnownDeclarationKeys.packageMainPackageField));
|
|
61796
61808
|
}
|
|
61809
|
+
get translatorAddTranslationToLocaleMethod() {
|
|
61810
|
+
return this.translatorAddTranslationToLocaleMethod_.getOrInsertWith(() => this.ectx.entityFinder.findMethodEntity(WellKnownDeclarationKeys.translatorAddTranslationToLocaleMethod));
|
|
61811
|
+
}
|
|
61812
|
+
get translatorLanguageField() {
|
|
61813
|
+
return this.translatorLanguageField_.getOrInsertWith(() => this.ectx.entityFinder.findFieldEntity(WellKnownDeclarationKeys.translatorLanguageField));
|
|
61814
|
+
}
|
|
61797
61815
|
*enumerateDeclarations() {
|
|
61798
61816
|
for (const pkg2 of this.packages) {
|
|
61799
61817
|
yield* __yieldStar(pkg2.ir.declarations);
|
|
@@ -63491,7 +63509,7 @@ var MiscLowering = class {
|
|
|
63491
63509
|
);
|
|
63492
63510
|
const statements = [thisPackageVariableAssignment];
|
|
63493
63511
|
if (packageEntity2.details.isMainPackage) {
|
|
63494
|
-
const mainPackageFieldAccess =
|
|
63512
|
+
const mainPackageFieldAccess = staticFieldSetAccess(ctx.packageMainPackageField);
|
|
63495
63513
|
const mainPackageFieldAssignment = assignmentStatement(
|
|
63496
63514
|
mainPackageFieldAccess,
|
|
63497
63515
|
variableGetAccess(variableEntity)
|
|
@@ -65133,12 +65151,20 @@ var TextTranslationsLowering = class {
|
|
|
65133
65151
|
this.ctx.translatorAddTranslationToLocaleMethod,
|
|
65134
65152
|
[
|
|
65135
65153
|
textLiteral(packageEntity2.details.translationTarget.name),
|
|
65136
|
-
textLiteral(
|
|
65154
|
+
textLiteral(textTranslationLocale),
|
|
65137
65155
|
variableGetAccess(dictionaryVariableEntity)
|
|
65138
65156
|
]
|
|
65139
65157
|
);
|
|
65140
65158
|
const translatorAddTranslationStatement = expressionStatement(translatorAddTranslationCall);
|
|
65141
65159
|
statements.push(translatorAddTranslationStatement);
|
|
65160
|
+
if (packageEntity2.details.isPrimaryTranslation) {
|
|
65161
|
+
const translatorLanguageFieldAccess = staticFieldSetAccess(this.ctx.translatorLanguageField);
|
|
65162
|
+
const translatorLanguageFieldAssignment = assignmentStatement(
|
|
65163
|
+
translatorLanguageFieldAccess,
|
|
65164
|
+
textLiteral(textTranslationLocale)
|
|
65165
|
+
);
|
|
65166
|
+
statements.push(translatorLanguageFieldAssignment);
|
|
65167
|
+
}
|
|
65142
65168
|
const packageConstructorDeclaration = this.ctx.findOrCreatePackageConstructor(pkg2.ir);
|
|
65143
65169
|
packageConstructorDeclaration.body.statements = statements.concat(packageConstructorDeclaration.body.statements);
|
|
65144
65170
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TYQHZ7HH.js";
|
|
4
4
|
import {
|
|
5
5
|
ArtelVersion,
|
|
6
6
|
Cached,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
__async,
|
|
15
15
|
performanceMeasurementStageNames,
|
|
16
16
|
performanceMeasurementStages
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DB2CJDOL.js";
|
|
18
18
|
|
|
19
19
|
// source/executor/FileSystemUri.ts
|
|
20
20
|
import { platform } from "os";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PackageLocale } from '../common/index.js';
|
|
2
1
|
import { PackageEntity, TextTranslationEntity } from '../entities/index.js';
|
|
3
2
|
import { PackageName, TextTranslationPackage } from '../project/index.js';
|
|
4
3
|
import { Analyzer } from './Analyzer.js';
|
|
@@ -9,11 +8,11 @@ export declare class AnalyzedTextTranslationPackage {
|
|
|
9
8
|
private readonly targetPackage;
|
|
10
9
|
private readonly entitiesByTextKey;
|
|
11
10
|
constructor(analyzer: Analyzer, package_: TextTranslationPackage, targetPackage: PackageEntity);
|
|
12
|
-
|
|
11
|
+
isPrimaryTranslation(): boolean;
|
|
13
12
|
getTargetPackage(): PackageEntity;
|
|
14
13
|
getDefinition(): TextTranslationPackage;
|
|
15
14
|
getTargetPackageName(): PackageName;
|
|
16
|
-
getTranslationLocale():
|
|
15
|
+
getTranslationLocale(): string;
|
|
17
16
|
getEntitiesByTextKey(textKey: TextKey): readonly TextTranslationEntity[] | undefined;
|
|
18
17
|
private createEntitiesByTextKey;
|
|
19
18
|
private enumerableTextTranslationDeclarations;
|
|
@@ -267,7 +267,7 @@ export declare class Analyzer {
|
|
|
267
267
|
enumerateAnalyzedTextTranslationPackages(): Query<AnalyzedTextTranslationPackage>;
|
|
268
268
|
getLinkedMultiPlatformPackagesByPlatform(entity: e.PackageEntity): ReadonlyMap<PlatformKind, LinkedMultiPlatformPackage> | undefined;
|
|
269
269
|
getLinkedMultiPlatformPackage(entity: e.PackageEntity, platform: PlatformKind): LinkedMultiPlatformPackage | undefined;
|
|
270
|
-
getTextTranslationPackagesMap(): ReadonlyMap<e.PackageEntity, ReadonlyMap<
|
|
270
|
+
getTextTranslationPackagesMap(): ReadonlyMap<e.PackageEntity, ReadonlyMap<string, AnalyzedTextTranslationPackage>>;
|
|
271
271
|
instantiateType(entity: e.TypeEntity, typeArguments: readonly types.Type[] | undefined): types.Type;
|
|
272
272
|
instantiateTypeWithSubstitutions(entity: e.TypeEntity, substitutions: types.Substitutions): types.Type;
|
|
273
273
|
instantiateTypeByIdentitySubstitution(entity: e.TypeEntity): types.Type;
|
|
@@ -46,6 +46,7 @@ export declare class WellKnownDeclarationKeys {
|
|
|
46
46
|
static readonly packageMainPackageField = "\u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u0410\u0440\u0442\u0435\u043B\u044C.\u041F\u0430\u043A\u0435\u0442.\u0433\u043B\u0430\u0432\u043D\u044B\u0439-\u043F\u0430\u043A\u0435\u0442";
|
|
47
47
|
static readonly errorConstructor = "\u0410\u0440\u0442\u0435\u043B\u044C.\u041E\u0448\u0438\u0431\u043A\u0430";
|
|
48
48
|
static readonly translatorAddTranslationToLocaleMethod = "\u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u0410\u0440\u0442\u0435\u043B\u044C.\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0447\u0438\u043A.\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C-\u043F\u0435\u0440\u0435\u0432\u043E\u0434-\u043D\u0430-\u044F\u0437\u044B\u043A";
|
|
49
|
+
static readonly translatorLanguageField = "\u0432\u0441\u0435\u043E\u0431\u0449\u0435\u0435 \u0410\u0440\u0442\u0435\u043B\u044C.\u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0447\u0438\u043A.\u044F\u0437\u044B\u043A";
|
|
49
50
|
}
|
|
50
51
|
declare class TypeUtils {
|
|
51
52
|
private readonly ectx;
|
|
@@ -140,7 +140,8 @@ export declare class PackageEntityDetails {
|
|
|
140
140
|
isSource: boolean;
|
|
141
141
|
isPackageWithMainFunction: boolean;
|
|
142
142
|
isTextTranslationPackage: boolean;
|
|
143
|
-
textTranslationLocale:
|
|
143
|
+
textTranslationLocale: string | undefined;
|
|
144
|
+
isPrimaryTranslation: boolean;
|
|
144
145
|
translationTarget: PackageEntity | undefined;
|
|
145
146
|
thisPackageVariableEntity: VariableEntity | undefined;
|
|
146
147
|
isMainPackage: boolean;
|
|
@@ -46,7 +46,8 @@ export declare namespace InterfacePackageEntityInfo {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
export declare class TextTranslationPackageEntityInfo {
|
|
49
|
-
readonly translationLocale:
|
|
49
|
+
readonly translationLocale: string;
|
|
50
|
+
readonly isPrimaryTranslation: boolean;
|
|
50
51
|
readonly targetPackage: PackageEntity | undefined;
|
|
51
|
-
constructor(translationLocale:
|
|
52
|
+
constructor(translationLocale: string, isPrimaryTranslation: boolean, targetPackage: PackageEntity | undefined);
|
|
52
53
|
}
|
|
@@ -39,7 +39,8 @@ export declare class TextTranslationPackage extends SourcePackageBase {
|
|
|
39
39
|
protected get asPackage(): SourcePackage;
|
|
40
40
|
get locale(): PackageLocale;
|
|
41
41
|
get dialect(): PackageDialect;
|
|
42
|
-
get translationLocale():
|
|
42
|
+
get translationLocale(): string;
|
|
43
|
+
get isPrimaryTranslation(): boolean;
|
|
43
44
|
constructor(uri: Uri, configuration: TextTranslationPackageConfiguration, sourceFiles: SourceFile[]);
|
|
44
45
|
}
|
|
45
46
|
export type PackageConfiguration = ProgramPackageConfiguration | TranslationPackageConfiguration | TextTranslationPackageConfiguration;
|
|
@@ -54,14 +55,15 @@ export declare class TranslationPackageConfiguration {
|
|
|
54
55
|
}
|
|
55
56
|
export declare class TextTranslationPackageConfiguration {
|
|
56
57
|
readonly targetPackageName: PackageName;
|
|
57
|
-
readonly translationLocale:
|
|
58
|
+
readonly translationLocale: string;
|
|
59
|
+
readonly isPrimaryTranslation: boolean;
|
|
58
60
|
readonly locale: PackageLocale;
|
|
59
61
|
readonly dialect: PackageDialect;
|
|
60
62
|
readonly version?: string | undefined;
|
|
61
63
|
readonly packageImportLocales: readonly PackageImportLocaleConfig[];
|
|
62
64
|
readonly automaticallyImportedPackages?: readonly PackageName[] | undefined;
|
|
63
65
|
readonly name: PackageName;
|
|
64
|
-
constructor(targetPackageName: PackageName, translationLocale:
|
|
66
|
+
constructor(targetPackageName: PackageName, translationLocale: string, isPrimaryTranslation: boolean | undefined, locale: PackageLocale, dialect?: PackageDialect, version?: string | undefined, packageImportLocales?: readonly PackageImportLocaleConfig[], automaticallyImportedPackages?: readonly PackageName[] | undefined);
|
|
65
67
|
}
|
|
66
68
|
export declare class ProgramPackageConfiguration {
|
|
67
69
|
readonly name: PackageName;
|
|
@@ -27,7 +27,8 @@ export interface Translations {
|
|
|
27
27
|
export interface TextTranslations {
|
|
28
28
|
type: 'TextTranslations';
|
|
29
29
|
originalPackageName: string;
|
|
30
|
-
translationLanguage:
|
|
30
|
+
translationLanguage: string;
|
|
31
|
+
isPrimaryTranslation?: boolean;
|
|
31
32
|
language?: Language;
|
|
32
33
|
dialect?: Dialect;
|
|
33
34
|
version?: string;
|
|
@@ -27,7 +27,8 @@ export interface Переводы {
|
|
|
27
27
|
export interface ПереводыТекстов {
|
|
28
28
|
тип: 'ПереводыТекстов';
|
|
29
29
|
имяПакетаИсходное: string;
|
|
30
|
-
языкПеревода:
|
|
30
|
+
языкПеревода: string;
|
|
31
|
+
этоПервичныйПеревод?: ДаНет;
|
|
31
32
|
язык?: Язык;
|
|
32
33
|
диалект?: Диалект;
|
|
33
34
|
версия?: string;
|