Skip to content

Commit

Permalink
Web: Tests: Added opportunity to sort translation files by Key with n…
Browse files Browse the repository at this point in the history
…ew Configurations -> SORT in VS
  • Loading branch information
AlexeySafronov committed Jan 21, 2022
1 parent 34441d6 commit 32c398c
Show file tree
Hide file tree
Showing 1,535 changed files with 10,184 additions and 10,178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>

<Configurations>Debug;Release;SORT</Configurations>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31112.23
# Visual Studio Version 17
VisualStudioVersion = 17.0.32112.339
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Frontend.Translations.Tests", "Frontend.Translations.Tests.csproj", "{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Frontend.Translations.Tests", "Frontend.Translations.Tests.csproj", "{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
SORT|Any CPU = SORT|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}.Release|Any CPU.Build.0 = Release|Any CPU
{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}.SORT|Any CPU.ActiveCfg = SORT|Any CPU
{FFE0FBAD-0966-4B98-BCFF-7EA864ED8D67}.SORT|Any CPU.Build.0 = SORT|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
43 changes: 25 additions & 18 deletions common/Tests/Frontend.Translations.Tests/LocalesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ where filePath.Contains("public\\locales\\")
new JsonEncodingError(path, result.Detected));
}

#if SORT

JObject jsonSorted;
#endif
using (var md5 = MD5.Create())
{
using (var stream = File.OpenRead(path))
Expand All @@ -98,20 +102,19 @@ where filePath.Contains("public\\locales\\")
.ToList(), md5hash);

TranslationFiles.Add(translationFile);
}

#if SORT
var orderedList = jsonTranslation.Properties().OrderBy(t => t.Name);
jsonSorted = new JObject(orderedList);
#endif
}
}
#if SORT
// Re-write by order
var sortedJsonString = JsonConvert.SerializeObject(jsonSorted, Formatting.Indented);
File.WriteAllText(path, sortedJsonString, Encoding.UTF8);
#endif
}

/* Re-write by order */

//var orderedList = jsonTranslation.Properties().OrderBy(t => t.Name);

//var result = new JObject(orderedList);

//var sortedJsonString = JsonConvert.SerializeObject(result, Formatting.Indented);

//File.WriteAllText(path, sortedJsonString);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -327,7 +330,7 @@ public void SpellCheckTest()
}

//string json = JsonConvert.SerializeObject(list, Formatting.Indented);
//File.WriteAllText("../../../spellcheck-excludes.json", json);
//File.WriteAllText("../../../spellcheck-excludes.json", json, Encoding.UTF8);

Assert.AreEqual(0, errorsCount, message);
}
Expand All @@ -337,8 +340,12 @@ public void SpellCheckTest()
public void DublicatesFilesByMD5HashTest()
{
var skipHashes = new List<string>() {
"bcba174a8dadc0ff97f37f9a2d816d88",
"2a506ed97d0fbd0858192b755ae122d0",
"e6d664afaace71b3a22abb09fc124543",
"5a1d4d36141c7a8ca53f2540f3fd5940",
"6d3334459f062ba0f39de6a38225c564",
"b8e7630201c96d26c94d348447328276",
"3ad0e57ce636af715af3f629e364f1ed",
"dfb129715a0122a29afe233226c648d9",
"ec73989085d4e1b984c1c9dca10524da"
};

Expand Down Expand Up @@ -446,7 +453,7 @@ public static void SaveNotFoundLanguage(string existJsonPath, string notExistJso
if (!Directory.Exists(fullPathOnly))
Directory.CreateDirectory(fullPathOnly);

File.WriteAllText(notExistJsonPath, sortedJsonString);
File.WriteAllText(notExistJsonPath, sortedJsonString, Encoding.UTF8);
}

[Test]
Expand Down Expand Up @@ -523,7 +530,7 @@ public static void SaveNotFoundKeys(string pathToJson, List<string> newKeys)

var sortedJsonString = JsonConvert.SerializeObject(result, Formatting.Indented);

File.WriteAllText(pathToJson, sortedJsonString);
File.WriteAllText(pathToJson, sortedJsonString, Encoding.UTF8);
}

[Test]
Expand Down Expand Up @@ -767,7 +774,7 @@ public static void UpdateKeys(string pathToJson, List<TranslationItem> newKeys)

var sortedJsonString = JsonConvert.SerializeObject(result, Formatting.Indented);

File.WriteAllText(pathToJson, sortedJsonString);
File.WriteAllText(pathToJson, sortedJsonString, Encoding.UTF8);
}

public static void RemoveEmptyKeys(string pathToJson, List<string> emptyKeys)
Expand All @@ -783,7 +790,7 @@ public static void RemoveEmptyKeys(string pathToJson, List<string> emptyKeys)

var sortedJsonString = JsonConvert.SerializeObject(result, Formatting.Indented);

File.WriteAllText(pathToJson, sortedJsonString);
File.WriteAllText(pathToJson, sortedJsonString, Encoding.UTF8);
}

public string GetWorkspace(string path)
Expand Down
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/az/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Əlaqələrinizi və satışlarınızı idarə edin"
"ModuleDescription": "Əlaqələrinizi və satışlarınızı idarə edin"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/bg/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Управлявайте контактите и продажбите си"
"ModuleDescription": "Управлявайте контактите и продажбите си"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/cs/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Správa kontaktů a prodejů"
"ModuleDescription": "Správa kontaktů a prodejů"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/el/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Διαχειριστείτε τις επαφές και τις πωλήσεις σας"
"ModuleDescription": "Διαχειριστείτε τις επαφές και τις πωλήσεις σας"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/en/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Manage your contacts and sales"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/es/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Gestione sus contactos y ventas"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/fi/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Hallitse yhteystietojasi ja myyntiäsi"
"ModuleDescription": "Hallitse yhteystietojasi ja myyntiäsi"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/it/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Gestisci i tuoi contatti e le vendite"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/ja/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "連絡先と販売を管理する"
"ModuleDescription": "連絡先と販売を管理する"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/ko/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "연락처 및 판매를 관리하세요"
"ModuleDescription": "연락처 및 판매를 관리하세요"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/lo/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "ຈັດການຜຸ້ຕິດຕໍ່ ແລະ ການຂາຍ"
"ModuleDescription": "ຈັດການຜຸ້ຕິດຕໍ່ ແລະ ການຂາຍ"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/lv/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Pārvaldiet savus kontaktus un pārdošanu"
"ModuleDescription": "Pārvaldiet savus kontaktus un pārdošanu"
}
4 changes: 2 additions & 2 deletions products/ASC.CRM/Client/public/locales/nl/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Beheer uw contacten en uw verkoop"
{
"ModuleDescription": "Beheer uw contacten en uw verkoop"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/pl/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Zarządzaj kontaktami i sprzedażą"
"ModuleDescription": "Zarządzaj kontaktami i sprzedażą"
}
4 changes: 2 additions & 2 deletions products/ASC.CRM/Client/public/locales/pt-BR/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Gerencie seus contatos e vendas"
{
"ModuleDescription": "Gerencie seus contatos e vendas"
}
4 changes: 2 additions & 2 deletions products/ASC.CRM/Client/public/locales/pt/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Gerir os seus contactos e vendas"
{
"ModuleDescription": "Gerir os seus contactos e vendas"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/ro/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Gestionarea clienților și vânzărilor"
"ModuleDescription": "Gestionarea clienților și vânzărilor"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/ru/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Управляйте своими контактами и продажами"
}
4 changes: 2 additions & 2 deletions products/ASC.CRM/Client/public/locales/sk/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Spravujte svoje kontakty a predaj"
{
"ModuleDescription": "Spravujte svoje kontakty a predaj"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/sl/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Upravljajte vaše kontakte in prodajo"
"ModuleDescription": "Upravljajte vaše kontakte in prodajo"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/tr/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Kişilerinizi ve satışlarınızı yönetin"
"ModuleDescription": "Kişilerinizi ve satışlarınızı yönetin"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/uk/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Керуйте контактами та продажами"
"ModuleDescription": "Керуйте контактами та продажами"
}
2 changes: 1 addition & 1 deletion products/ASC.CRM/Client/public/locales/vi/ComingSoon.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Quản lý danh bạ và doanh số bán hàng của bạn"
"ModuleDescription": "Quản lý danh bạ và doanh số bán hàng của bạn"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "管理您的联系人和销售"
"ModuleDescription": "管理您的联系人和销售"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Görüş və tədbirləri planlaşdırın"
"ModuleDescription": "Görüş və tədbirləri planlaşdırın"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Насрочете срещи и събития"
"ModuleDescription": "Насрочете срещи и събития"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Plánování schůzek a událostí"
"ModuleDescription": "Plánování schůzek a událostí"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Veranstaltungen planen"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Προγραμματίστε συναντήσεις και εκδηλώσεις"
"ModuleDescription": "Προγραμματίστε συναντήσεις και εκδηλώσεις"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Schedule meetings and events"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Programe reuniones y eventos"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Kokousten ja tapahtumien ajoittaminen"
{
"ModuleDescription": "Kokousten ja tapahtumien ajoittaminen"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Planifier des réunions et des événements"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
{
"ModuleDescription": "Pianifica riunioni ed eventi"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "会議とイベントをスケジュールする"
"ModuleDescription": "会議とイベントをスケジュールする"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "회의 및 행사 일정을 잡으세요"
"ModuleDescription": "회의 및 행사 일정을 잡으세요"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "ກຳໜົດການປະຂຸມ ແລະ ກິດຈະກຳ"
"ModuleDescription": "ກຳໜົດການປະຂຸມ ແລະ ກິດຈະກຳ"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Plānojiet sanāksmes un pasākumus"
"ModuleDescription": "Plānojiet sanāksmes un pasākumus"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Vergaderingen en evenementen plannen"
{
"ModuleDescription": "Vergaderingen en evenementen plannen"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Planuj spotkania i wydarzenia"
{
"ModuleDescription": "Planuj spotkania i wydarzenia"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Agende reuniões e eventos"
"ModuleDescription": "Agende reuniões e eventos"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ModuleDescription": "Agendar reuniões e eventos"
"ModuleDescription": "Agendar reuniões e eventos"
}
Loading

0 comments on commit 32c398c

Please sign in to comment.