Skip to content

Commit

Permalink
Translations: French #303, German #304, Italian #305, Polish #306, Po…
Browse files Browse the repository at this point in the history
…rtuguese #307, Spanish #308
  • Loading branch information
mariuszgromada committed May 12, 2024
1 parent 3d7177a commit 891e229
Show file tree
Hide file tree
Showing 38 changed files with 11,511 additions and 191 deletions.
6 changes: 6 additions & 0 deletions CURRENT/c-sharp/1-Current-Dev.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@
<Compile Include="src\org\mariuszgromada\math\mxparser\StringUtils.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\Tutorial.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResources.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResourcesFrench.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResourcesGerman.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResourcesItalian.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResourcesPolish.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResourcesPortuguese.cs" />
<Compile Include="src\org\mariuszgromada\math\mxparser\StringResourcesSpanish.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* @(#)ExpressionUtils.cs 5.2.0 2023-01-29
* @(#)ExpressionUtils.cs 6.0.0 2024-05-11
*
* MathParser.org-mXparser DUAL LICENSE AGREEMENT as of date 2023-01-29
* The most up-to-date license is available at the below link:
Expand Down Expand Up @@ -204,7 +204,7 @@ namespace org.mariuszgromada.math.mxparser {
*
* @see Expression
*
* @version 5.2.0
* @version 6.0.0
*/
internal sealed class ExpressionUtils {
internal static readonly bool LANGUAGE_SPECIFIC_DESCRIPTIONS_SET = StringModel.LANGUAGE_SPECIFIC_DESCRIPTIONS_SET;
Expand Down Expand Up @@ -671,7 +671,7 @@ private static void makeParserKeyWords(bool parserKeyWordsOnly, bool UDFExpressi
addKeyWord(ConstantValue.EARTH_SEMI_MAJOR_AXIS_STR, ConstantValue.EARTH_SEMI_MAJOR_AXIS_DESC, ConstantValue.EARTH_SEMI_MAJOR_AXIS_ID, ConstantValue.EARTH_SEMI_MAJOR_AXIS_SYN, ConstantValue.EARTH_SEMI_MAJOR_AXIS_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.MOON_RADIUS_MEAN_STR, ConstantValue.MOON_RADIUS_MEAN_DESC, ConstantValue.MOON_RADIUS_MEAN_ID, ConstantValue.MOON_RADIUS_MEAN_SYN, ConstantValue.MOON_RADIUS_MEAN_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.MOON_MASS_STR, ConstantValue.MOON_MASS_DESC, ConstantValue.MOON_MASS_ID, ConstantValue.MOON_MASS_SYN, ConstantValue.MOON_MASS_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.MONN_SEMI_MAJOR_AXIS_STR, ConstantValue.MONN_SEMI_MAJOR_AXIS_DESC, ConstantValue.MONN_SEMI_MAJOR_AXIS_ID, ConstantValue.MONN_SEMI_MAJOR_AXIS_SYN, ConstantValue.MONN_SEMI_MAJOR_AXIS_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.MONN_SEMI_MAJOR_AXIS_STR, ConstantValue.MOON_SEMI_MAJOR_AXIS_DESC, ConstantValue.MOO_SEMI_MAJOR_AXIS_ID, ConstantValue.MONN_SEMI_MAJOR_AXIS_SYN, ConstantValue.MONN_SEMI_MAJOR_AXIS_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.SOLAR_RADIUS_STR, ConstantValue.SOLAR_RADIUS_DESC, ConstantValue.SOLAR_RADIUS_ID, ConstantValue.SOLAR_RADIUS_SYN, ConstantValue.SOLAR_RADIUS_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.SOLAR_MASS_STR, ConstantValue.SOLAR_MASS_DESC, ConstantValue.SOLAR_MASS_ID, ConstantValue.SOLAR_MASS_SYN, ConstantValue.SOLAR_MASS_SINCE, ConstantValue.TYPE_ID, keyWordsList);
addKeyWord(ConstantValue.MERCURY_RADIUS_MEAN_STR, ConstantValue.MERCURY_RADIUS_MEAN_DESC, ConstantValue.MERCURY_RADIUS_MEAN_ID, ConstantValue.MERCURY_RADIUS_MEAN_SYN, ConstantValue.MERCURY_RADIUS_MEAN_SINCE, ConstantValue.TYPE_ID, keyWordsList);
Expand Down Expand Up @@ -748,7 +748,7 @@ private static void makeParserKeyWords(bool parserKeyWordsOnly, bool UDFExpressi
* Units
*/
addKeyWord(Unit.PERC_STR, Unit.PERC_DESC, Unit.PERC_ID, Unit.PERC_SYN, Unit.PERC_SINCE, Unit.TYPE_ID, keyWordsList);
addKeyWord(Unit.PROMIL_STR, Unit.PROMIL_DESC, Unit.PROMIL_ID, Unit.PROMIL_SYN, Unit.PROMIL_SINCE, Unit.TYPE_ID, keyWordsList);
addKeyWord(Unit.PERM_STR, Unit.PERM_DESC, Unit.PERM_ID, Unit.PERM_SYN, Unit.PERM_SINCE, Unit.TYPE_ID, keyWordsList);
/* Metric prefixes */
addKeyWord(Unit.YOTTA_STR, Unit.YOTTA_DESC, Unit.YOTTA_ID, Unit.YOTTA_SYN, Unit.YOTTA_SINCE, Unit.TYPE_ID, keyWordsList);
addKeyWord(Unit.YOTTA_SEPT_STR, Unit.YOTTA_DESC, Unit.YOTTA_ID, Unit.YOTTA_SEPT_SYN, Unit.YOTTA_SINCE, Unit.TYPE_ID, keyWordsList);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* @(#)StringInvariant.cs 5.2.0 2023-01-29
* @(#)StringInvariant.cs 6.0.0 2024-05-11
*
* MathParser.org-mXparser DUAL LICENSE AGREEMENT as of date 2023-01-29
* The most up-to-date license is available at the below link:
Expand Down Expand Up @@ -200,7 +200,7 @@ namespace org.mariuszgromada.math.mxparser {
* <a href="https://play.google.com/store/apps/details?id=org.mathparser.scalar.pro" target="_blank">Scalar Pro</a><br>
* <a href="https://mathspace.pl" target="_blank">MathSpace.pl</a><br>
*
* @version 5.2.0
* @version 6.0.0
*/
internal sealed class StringInvariant {
internal const String EMPTY = "";
Expand Down Expand Up @@ -409,7 +409,7 @@ internal sealed class StringInvariant {
internal const String RANDOM_VARIABLE_NAT1_9_SYMBOL = "U{1,10⁹}";
// -------------------------------------------------
internal const String UNIT_PERC_SYMBOL = "= 0.01";
internal const String UNIT_PROMIL_SYMBOL = "= 0.001";
internal const String UNIT_PERM_SYMBOL = "= 0.001";
internal const String UNIT_YOTTA_SYMBOL = "= 10²⁴";
internal const String UNIT_ZETTA_SYMBOL = "= 10²¹";
internal const String UNIT_EXA_SYMBOL = "= 10¹⁸";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* @(#)StringModel.cs 5.2.0 2023-01-29
* @(#)StringModel.cs 6.0.0 2024-05-11
*
* MathParser.org-mXparser DUAL LICENSE AGREEMENT as of date 2023-01-29
* The most up-to-date license is available at the below link:
Expand Down Expand Up @@ -202,10 +202,11 @@ namespace org.mariuszgromada.math.mxparser {
* <a href="https://play.google.com/store/apps/details?id=org.mathparser.scalar.pro" target="_blank">Scalar Pro</a><br>
* <a href="https://mathspace.pl" target="_blank">MathSpace.pl</a><br>
*
* @version 5.2.0
* @version 6.0.0
*/
public sealed class StringModel {
internal static readonly StringResources DEFAULT_STRING_RESOURCES = new StringResources();
internal static readonly StringResources DEFAULT_ENGLISH_STRING_RESOURCES = new StringResources();
internal static readonly StringResources DEFAULT_STRING_RESOURCES = StringResources.bestMatchingLanguage();
internal static StringResources STRING_RESOURCES = DEFAULT_STRING_RESOURCES;
internal static readonly bool LANGUAGE_SPECIFIC_DESCRIPTIONS_SET = StringModel.setLanguageSpecificDescriptions();
/**
Expand All @@ -220,6 +221,7 @@ public sealed class StringModel {
*/
public static void setStringResources(StringResources stringResources) {
if (stringResources == null) return;
if (STRING_RESOURCES != null && STRING_RESOURCES == stringResources) return;
STRING_RESOURCES = stringResources;
setLanguageSpecificDescriptions();
}
Expand All @@ -229,9 +231,34 @@ public static void setStringResources(StringResources stringResources) {
* @see StringResources
*/
public static void setDefaultStringResources() {
if (mXparser.selectBestMatchingLanguage) {
if (STRING_RESOURCES != null && STRING_RESOURCES == DEFAULT_STRING_RESOURCES) return;
STRING_RESOURCES = DEFAULT_STRING_RESOURCES;
setLanguageSpecificDescriptions();
return;
}
if (STRING_RESOURCES != null && STRING_RESOURCES == DEFAULT_ENGLISH_STRING_RESOURCES) return;
STRING_RESOURCES = DEFAULT_ENGLISH_STRING_RESOURCES;
setLanguageSpecificDescriptions();
}
/**
* Forces to use default string resources
*/
internal static void forceDefaultStringResources() {
if (STRING_RESOURCES != null & STRING_RESOURCES == DEFAULT_STRING_RESOURCES) return;
STRING_RESOURCES = DEFAULT_STRING_RESOURCES;
setLanguageSpecificDescriptions();
}
/**
* Sets default english string resources.
*
* @see StringResources
*/
public static void setDefaultEnglishStringResources() {
if (STRING_RESOURCES != null && STRING_RESOURCES == DEFAULT_ENGLISH_STRING_RESOURCES) return;
STRING_RESOURCES = DEFAULT_ENGLISH_STRING_RESOURCES;
setLanguageSpecificDescriptions();
}
/**
* Gets currently used user-specific text resource object.
*
Expand Down Expand Up @@ -354,7 +381,7 @@ internal static void setLanguageSpecificDescriptionsConstantValue() {
ConstantValue.EARTH_SEMI_MAJOR_AXIS_DESC = STRING_RESOURCES.CONSTANT_VALUE_EARTH_SEMI_MAJOR_AXIS + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SEPARATOR + STRING_RESOURCES.SEMI_MAJOR_AXIS + StringInvariant.SPACE + StringInvariant.METER_UNIT + StringInvariant.SPACE + StringInvariant.METER_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.MOON_RADIUS_MEAN_DESC = STRING_RESOURCES.CONSTANT_VALUE_MOON_RADIUS_MEAN + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SPACE + StringInvariant.METER_UNIT + StringInvariant.SPACE + StringInvariant.METER_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.MOON_MASS_DESC = STRING_RESOURCES.CONSTANT_VALUE_MOON_MASS + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SPACE + StringInvariant.KILOGRAM_UNIT + StringInvariant.SPACE + StringInvariant.KILOGRAM_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.MONN_SEMI_MAJOR_AXIS_DESC = STRING_RESOURCES.CONSTANT_VALUE_MONN_SEMI_MAJOR_AXIS + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SEPARATOR + STRING_RESOURCES.SEMI_MAJOR_AXIS + StringInvariant.SPACE + StringInvariant.METER_UNIT + StringInvariant.SPACE + StringInvariant.METER_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.MOON_SEMI_MAJOR_AXIS_DESC = STRING_RESOURCES.CONSTANT_VALUE_MOON_SEMI_MAJOR_AXIS + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SEPARATOR + STRING_RESOURCES.SEMI_MAJOR_AXIS + StringInvariant.SPACE + StringInvariant.METER_UNIT + StringInvariant.SPACE + StringInvariant.METER_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.SOLAR_RADIUS_DESC = STRING_RESOURCES.CONSTANT_VALUE_SOLAR_RADIUS + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SPACE + StringInvariant.SOLAR_RADIUS_SYMBOL + StringInvariant.SPACE + StringInvariant.METER_UNIT + StringInvariant.SPACE + StringInvariant.METER_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.SOLAR_MASS_DESC = STRING_RESOURCES.CONSTANT_VALUE_SOLAR_MASS + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SPACE + StringInvariant.SOLAR_MASS_SYMBOL + StringInvariant.SPACE + StringInvariant.KILOGRAM_UNIT + StringInvariant.SPACE + StringInvariant.KILOGRAM_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
ConstantValue.MERCURY_RADIUS_MEAN_DESC = STRING_RESOURCES.CONSTANT_VALUE_MERCURY_RADIUS_MEAN + StringInvariant.SEPARATOR + STRING_RESOURCES.ASTRONOMICAL_CONSTANT + StringInvariant.SPACE + StringInvariant.METER_UNIT + StringInvariant.SPACE + StringInvariant.METER_DEFINITION + StringInvariant.SEPARATOR + STRING_RESOURCES.CONSTANT_VALUE;
Expand Down Expand Up @@ -642,7 +669,7 @@ internal static void setLanguageSpecificDescriptionsRandomVariable() {
internal static void setLanguageSpecificDescriptionsUnit() {
Unit.TYPE_DESC = STRING_RESOURCES.UNIT;
Unit.PERC_DESC = STRING_RESOURCES.DIMENSIONLESS_UNIT_PERC + StringInvariant.SEPARATOR + STRING_RESOURCES.RATIO_FRACTION + StringInvariant.SPACE + StringInvariant.UNIT_PERC_SYMBOL + StringInvariant.SEPARATOR + STRING_RESOURCES.DIMENSIONLESS_UNIT;
Unit.PROMIL_DESC = STRING_RESOURCES.DIMENSIONLESS_UNIT_PROMIL + StringInvariant.SEPARATOR + STRING_RESOURCES.RATIO_FRACTION + StringInvariant.SPACE + StringInvariant.UNIT_PROMIL_SYMBOL + StringInvariant.SEPARATOR + STRING_RESOURCES.DIMENSIONLESS_UNIT;
Unit.PERM_DESC = STRING_RESOURCES.DIMENSIONLESS_UNIT_PERM + StringInvariant.SEPARATOR + STRING_RESOURCES.RATIO_FRACTION + StringInvariant.SPACE + StringInvariant.UNIT_PERM_SYMBOL + StringInvariant.SEPARATOR + STRING_RESOURCES.DIMENSIONLESS_UNIT;
Unit.YOTTA_DESC = STRING_RESOURCES.DIMENSIONLESS_UNIT_YOTTA + StringInvariant.SEPARATOR + STRING_RESOURCES.METRIC_PREFIX + StringInvariant.SPACE + StringInvariant.UNIT_YOTTA_SYMBOL + StringInvariant.SEPARATOR + STRING_RESOURCES.DIMENSIONLESS_UNIT;
Unit.ZETTA_DESC = STRING_RESOURCES.DIMENSIONLESS_UNIT_ZETTA + StringInvariant.SEPARATOR + STRING_RESOURCES.METRIC_PREFIX + StringInvariant.SPACE + StringInvariant.UNIT_ZETTA_SYMBOL + StringInvariant.SEPARATOR + STRING_RESOURCES.DIMENSIONLESS_UNIT;
Unit.EXA_DESC = STRING_RESOURCES.DIMENSIONLESS_UNIT_EXA + StringInvariant.SEPARATOR + STRING_RESOURCES.METRIC_PREFIX + StringInvariant.SPACE + StringInvariant.UNIT_EXA_SYMBOL + StringInvariant.SEPARATOR + STRING_RESOURCES.DIMENSIONLESS_UNIT;
Expand Down Expand Up @@ -897,7 +924,7 @@ public static void printDescriptions() {
StringUtils.consolePrintln("ConstantValue.EARTH_SEMI_MAJOR_AXIS_DESC = \"" + ConstantValue.EARTH_SEMI_MAJOR_AXIS_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.MOON_RADIUS_MEAN_DESC = \"" + ConstantValue.MOON_RADIUS_MEAN_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.MOON_MASS_DESC = \"" + ConstantValue.MOON_MASS_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.MONN_SEMI_MAJOR_AXIS_DESC = \"" + ConstantValue.MONN_SEMI_MAJOR_AXIS_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.MOON_SEMI_MAJOR_AXIS_DESC = \"" + ConstantValue.MOON_SEMI_MAJOR_AXIS_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.SOLAR_RADIUS_DESC = \"" + ConstantValue.SOLAR_RADIUS_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.SOLAR_MASS_DESC = \"" + ConstantValue.SOLAR_MASS_DESC + "\";");
StringUtils.consolePrintln("ConstantValue.MERCURY_RADIUS_MEAN_DESC = \"" + ConstantValue.MERCURY_RADIUS_MEAN_DESC + "\";");
Expand Down Expand Up @@ -1128,7 +1155,7 @@ public static void printDescriptions() {
StringUtils.consolePrintln("// -------------------------------------------------");
StringUtils.consolePrintln("Unit.TYPE_DESC = \"" + Unit.TYPE_DESC + "\";");
StringUtils.consolePrintln("Unit.PERC_DESC = \"" + Unit.PERC_DESC + "\";");
StringUtils.consolePrintln("Unit.PROMIL_DESC = \"" + Unit.PROMIL_DESC + "\";");
StringUtils.consolePrintln("Unit.PERM_DESC = \"" + Unit.PERM_DESC + "\";");
StringUtils.consolePrintln("Unit.YOTTA_DESC = \"" + Unit.YOTTA_DESC + "\";");
StringUtils.consolePrintln("Unit.ZETTA_DESC = \"" + Unit.ZETTA_DESC + "\";");
StringUtils.consolePrintln("Unit.EXA_DESC = \"" + Unit.EXA_DESC + "\";");
Expand Down
Loading

0 comments on commit 891e229

Please sign in to comment.