Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Russian, German and Spanish languages for ListItemTextGetter_* classes #44

Open
wants to merge 20 commits into
base: vNext
Choose a base branch
from

Conversation

alexeysp11
Copy link

@alexeysp11 alexeysp11 commented Jun 18, 2023

Description of changes

Added Russian, German and Spanish languages for ListItemTextGetter_ classes

  • Renamed GetListItemText_ru_RU to ListItemTextGetter_ru_RU to maintain consistency in class naming.
  • Added ListItemTextGetter_de_DE to support German.
  • Added ListItemTextGetter_es_ES to support Spanish.
  • Edited text of exceptions in language-related files: for example, 1) greater then -> greater than, 2) Convering -> Converting, etc.

Testing

  • Added testing for Russian: ListItemTextGetter_ru_RUTests.
  • Added testing for German: ListItemTextGetter_de_DETests.
  • Added testing for Spanish: ListItemTextGetter_es_ESTests.
  • Changed the TargetFrameworks parameter in OpenXmlPowerTools.Tests.csproj: from netcoreapp2.0 to netcoreapp3.1. Reason: OpenXmlPowerTools.Tests.csproj refers only to OpenXmlPowerTools.csproj, and in OpenXmlPowerTools.csproj TargetFrameworks parameter is defined as net45;net46;netstandard2.0;netcoreapp3.1, so it could be better to use netcoreapp3.1 instead of netcoreapp2.0 in OpenXmlPowerTools.Tests.csproj.

{
private static string[] OneThroughNineteen = {
"eins", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht",
"nuen", "zehn", "elf", "zwölf", "dreizehn", "vierzehn",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please replace nuen with neun everywhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I fixed that.

int t1 = levelNumber / 1000;
int t2 = levelNumber % 1000;
if (t1 >= 1)
result += (t1 == 1 ? "ein" : OneThroughNineteen[t1 - 1]) + " thausend";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace thausend with tausend everywhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I fixed that.

public static string GetListItemText(string languageCultureName, int levelNumber, string numFmt)
{
if (levelNumber > 19999)
throw new ArgumentOutOfRangeException("levelNumber", "Convering a levelNumber to ordinal text that is greater then 19 999 is not supported");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace Convering with Converting in all of the language-related files of the commit. I recommend to write "19 999" as "19999" because the thausand separator is different in different languages (in English it is a ,).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done. I also found and fixed a few more typos in the code. Additionally, I added tests for German and Spanish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants