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

Translation for question details. Refactored some overlay lookup #3741

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
{
"pairs": [
{
"key": "overall",
"value": "Π—Π°Π³Π°Π»ΠΎΠΌ"
},
{
"key": "standards",
"value": "Π‘Ρ‚Π°Π½Π΄Π°Ρ€Ρ‚ΠΈ"
},
{
"key": "default exec summ",
"value": "[UK]Cyber terrorism is a real and growing threat. Standards and guides have been developed, vetted, and widely accepted to assist with protection from cyber attacks. The Cyber Security Evaluation Tool (CSET) includes a selectable array of these standards for a tailored assessment of cyber vulnerabilities. Once the standards were selected and the resulting question sets answered, the CSET created a compliance summary, compiled variance statistics, ranked top areas of concern, and generated security recommendations."
},
{
"key": "default assessment name",
"value": "Нова ΠΎΡ†Ρ–Π½ΠΊΠ°"
}
]
"overall": "Π—Π°Π³Π°Π»ΠΎΠΌ",
"standards": "Π‘Ρ‚Π°Π½Π΄Π°Ρ€Ρ‚ΠΈ",
"default exec summ": "[UK]Cyber terrorism is a real and growing threat. Standards and guides have been developed, vetted, and widely accepted to assist with protection from cyber attacks. The Cyber Security Evaluation Tool (CSET) includes a selectable array of these standards for a tailored assessment of cyber vulnerabilities. Once the standards were selected and the resulting question sets answered, the CSET created a compliance summary, compiled variance statistics, ranked top areas of concern, and generated security recommendations.",
"default assessment name": "Нова ΠΎΡ†Ρ–Π½ΠΊΠ°"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"detect": "Виявляти",
"govern": "ΠšΠ΅Ρ€ΡƒΠ²Π°Ρ‚ΠΈ",
"identify": "Π†Π΄Π΅Π½Ρ‚ΠΈΡ„Ρ–ΠΊΡƒΠ²Π°Ρ‚ΠΈ",
"protect": "Π—Π°Ρ…ΠΈΡ‰Π°Ρ‚ΠΈ",
"recover": "Π’Ρ–Π΄Π½ΠΎΠ²ΠΈΡ‚ΠΈ",
"respond": "Відповісти",
"access control": "Управління доступом",
"analysis": "Аналіз",
"anomalies and events": "Аномалії Ρ‚Π° ΠΏΠΎΠ΄Ρ–Ρ—",
"asset management": "Управління Π°ΠΊΡ‚ΠΈΠ²Π°ΠΌΠΈ",
"awareness and training": "ΠžΠ±Ρ–Π·Π½Π°Π½Ρ–ΡΡ‚ΡŒ Ρ– навчання",
"business environment": "БізнСс сСрСдовищС",
"data security": "Π‘Π΅Π·ΠΏΠ΅ΠΊΠ° Π΄Π°Π½ΠΈΡ…",
"detection processes": "ΠŸΡ€ΠΎΡ†Π΅ΡΠΈ виявлСння",
"governance": "Управління",
"improvements": "ΠŸΠΎΠΊΡ€Π°Ρ‰Π΅Π½Π½Ρ",
"information protection processes and procedures": "ΠŸΡ€ΠΎΡ†Π΅ΡΠΈ Ρ‚Π° ΠΏΡ€ΠΎΡ†Π΅Π΄ΡƒΡ€ΠΈ захисту Ρ–Π½Ρ„ΠΎΡ€ΠΌΠ°Ρ†Ρ–Ρ—",
"maintenance": "Π’Π΅Ρ…Π½Ρ–Ρ‡Π½Π΅ обслуговування",
"mitigation": "Пом'якшСння",
"protective technology": "Захисна Ρ‚Π΅Ρ…Π½Ρ–ΠΊΠ°",
"recovery communications": "ВідновлСння ΠΊΠΎΠΌΡƒΠ½Ρ–ΠΊΠ°Ρ†Ρ–ΠΉ",
"recovery planning": "ΠŸΠ»Π°Π½ΡƒΠ²Π°Π½Π½Ρ відновлСння",
"response communications": "ΠšΠΎΠΌΡƒΠ½Ρ–ΠΊΠ°Ρ†Ρ–Ρ— Ρƒ Π²Ρ–Π΄ΠΏΠΎΠ²Ρ–Π΄ΡŒ",
"response planning": "ΠŸΠ»Π°Π½ΡƒΠ²Π°Π½Π½Ρ рСагування",
"risk assessment": "ΠžΡ†Ρ–Π½ΠΊΠ° Ρ€ΠΈΠ·ΠΈΠΊΡ–Π²",
"risk management": "Управління Ρ€ΠΈΠ·ΠΈΠΊΠ°ΠΌΠΈ",
"risk management strategy": "БтратСгія управління Ρ€ΠΈΠ·ΠΈΠΊΠ°ΠΌΠΈ",
"security continuous monitoring": "ΠŸΠΎΡΡ‚Ρ–ΠΉΠ½ΠΈΠΉ ΠΌΠΎΠ½Ρ–Ρ‚ΠΎΡ€ΠΈΠ½Π³ Π±Π΅Π·ΠΏΠ΅ΠΊΠΈ"
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public AssessmentDetail CreateNewAssessment(int? currentUserId, string workflow,
var lang = _tokenManager.GetCurrentLanguage();
if (lang != "en")
{
var msg = _overlay.GetValue("GENERIC", "default exec summ", lang)?.Value;
var msg = _overlay.GetPropertyValue("GENERIC", "default exec summ", lang);
if (msg != null)
{
defaultExecSumm = msg;
}

msg = _overlay.GetValue("GENERIC", "default assessment name", lang)?.Value;
msg = _overlay.GetPropertyValue("GENERIC", "default assessment name", lang);
if (msg != null)
{
defaultAssessmentName = msg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@
<None Update="App_Data\ACET Spanish Question Mapping.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="App_Data\LanguagePacks\UK\CATEGORIES.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="App_Data\LanguagePacks\UK\DEMOGRAPHICS_ORGANIZATION_TYPE.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -177,6 +174,9 @@
<None Update="App_Data\LanguagePacks\UK\SECTOR_INDUSTRY.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="App_Data\LanguagePacks\UK\STANDARD_CATEGORY.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="App_Data\Spanish ACET Groupings.xlsx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1261,16 +1261,16 @@ from r in _context.NEW_REQUIREMENT.Where(x => x.Requirement_Id == rs.Requirement
foreach (NEW_REQUIREMENT rq in reqs)
{
// overlay
var translatedCategory = _overlay.GetCat(rq.Standard_Category, _lang);
var translatedCategory = _overlay.GetPropertyValue("STANDARD_CATEGORY", rq.Standard_Category.ToLower(), _lang);
if (translatedCategory != null)
{
rq.Standard_Category = translatedCategory.Value;
rq.Standard_Category = translatedCategory;
}

var translatedSubcat = _overlay.GetCat(rq.Standard_Sub_Category, _lang);
var translatedSubcat = _overlay.GetPropertyValue("STANDARD_CATEGORY", rq.Standard_Sub_Category.ToLower(), _lang);
if (translatedSubcat != null)
{
rq.Standard_Sub_Category = translatedSubcat.Value;
rq.Standard_Sub_Category = translatedSubcat;
}

Requirement r = new Requirement()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class QuestionInformationTabData

private readonly ITokenManager _tokenManager;

private readonly TranslationOverlay _overlay;


public String RequirementFrameworkTitle { get; set; }
public String RelatedFrameworkCategory { get; set; }
Expand Down Expand Up @@ -104,24 +106,43 @@ public QuestionInformationTabData(CSETWebCore.Interfaces.Common.IHtmlFromXamlCon
_converter = converter;
_context = context;
_tokenManager = token;

_overlay = new TranslationOverlay();
}


/// <summary>
///
/// </summary>
public void BuildQuestionTab(QuestionInfoData infoData, SETS set)
{
ShowRequirementFrameworkTitle = true;
BuildFromNewQuestion(infoData, set);
}


/// <summary>
///
/// </summary>
internal void BuildRelatedQuestionTab(RelatedQuestionInfoData questionInfoData, SETS set)
{
BuildFromNewQuestion(questionInfoData, set);
ShowRelatedFrameworkCategory = true;
ShowRequirementFrameworkTitle = true;
RelatedFrameworkCategory = questionInfoData.Category;

var lang = _tokenManager.GetCurrentLanguage();
var cat = _overlay.GetPropertyValue("STANDARD_CATEGORY", questionInfoData.Category.ToLower(), lang);
if (cat != null)
{
RelatedFrameworkCategory = cat;
}
}


/// <summary>
///
/// </summary>
private NEW_QUESTION BuildFromNewQuestion(BaseQuestionInfoData infoData, SETS set)
{
NEW_QUESTION question = infoData.Question;
Expand Down Expand Up @@ -257,10 +278,20 @@ join q in _context.NEW_QUESTION on rq.Question_Id equals q.Question_Id
}

if (!IsComponent)
{
RequirementFrameworkTitle = requirement.Requirement_Title;
}

RelatedFrameworkCategory = requirement.Standard_Sub_Category;

// translate category
var cat = _overlay.GetPropertyValue("STANDARD_CATEGORY", requirement.Standard_Sub_Category.ToLower(), lang);
if (cat != null)
{
RelatedFrameworkCategory = cat;
}


if (requirementData.SetName == StandardConstants.CNSSI_1253_DB || requirementData.SetName == StandardConstants.CNSSI_ICS_PIT_DB
|| requirementData.SetName == StandardConstants.CNSSI_ICS_V1_DB || requirementData.SetName == StandardConstants.CNSSI_1253_V2_DB)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ public QuestionResponse BuildResponse(List<RequirementPlus> requirements,


// translate the Category
var translatedCategory = overlay.GetCat(dbR.Standard_Category, lang);
var translatedCategory = overlay.GetPropertyValue("STANDARD_CATEGORY", dbR.Standard_Category.ToLower(), lang);
if (translatedCategory != null)
{
dbR.Standard_Category = translatedCategory.Value;
dbR.Standard_Category = translatedCategory;
}


Expand All @@ -172,10 +172,10 @@ public QuestionResponse BuildResponse(List<RequirementPlus> requirements,


// translate the Subcategory using the CATEGORIES translation object
var translatedSubcategory = overlay.GetCat(dbR.Standard_Sub_Category, lang);
var translatedSubcategory = overlay.GetPropertyValue("STANDARD_CATEGORY", dbR.Standard_Sub_Category.ToLower(), lang);
if (translatedSubcategory != null)
{
dbR.Standard_Sub_Category = translatedSubcategory.Value;
dbR.Standard_Sub_Category = translatedSubcategory;
}


Expand Down
Loading
Loading