Skip to content

Commit 06f52bf

Browse files
authored
Merge pull request #56 from hmlendea/templates
Fixed some templates being built incorrectly
2 parents f0ca785 + d5d3a3a commit 06f52bf

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

Service/TextBuilding/Localisation/EnglishTextBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,19 +1731,19 @@ public string BuildGitContributionsMeasurementLogText(PersonalLog log)
17311731
=> $"I have made {log.Data["contributions_count"]} contributions on {GetPlatform(log.Data)}";
17321732

17331733
public string BuildGitReleaseLogText(PersonalLog log)
1734-
=> $"I have released version {log.Data["release_version"]} of the `{log.Data["repository_name"]}` repository on {GetPlatform(log.Data)}";
1734+
=> $"I have released version {GetDataValue(log.Data, "version")} of the `{GetDataValue(log.Data, "repository")}` repository on {GetPlatform(log.Data)}";
17351735

17361736
public string BuildGitRepositoryArchivalLogText(PersonalLog log)
1737-
=> $"I have archived the `{GetDataValue(log.Data, "repository_name")}` repository on {GetPlatform(log.Data)}";
1737+
=> $"I have archived the `{GetDataValue(log.Data, "repository")}` repository on {GetPlatform(log.Data)}";
17381738

17391739
public string BuildGitRepositoryCreationLogText(PersonalLog log)
1740-
=> $"I have created the `{GetDataValue(log.Data, "repository_name")}` repository on {GetPlatform(log.Data)}";
1740+
=> $"I have created the `{GetDataValue(log.Data, "repository")}` repository on {GetPlatform(log.Data)}";
17411741

17421742
public string BuildGitRepositoryDeletionLogText(PersonalLog log)
1743-
=> $"I have deleted the `{GetDataValue(log.Data, "repository_name")}` repository from {GetPlatform(log.Data)}";
1743+
=> $"I have deleted the `{GetDataValue(log.Data, "repository")}` repository from {GetPlatform(log.Data)}";
17441744

17451745
public string BuildGitRepositoryRenameLogText(PersonalLog log)
1746-
=> $"I have renamed the `{GetDataValue(log.Data, "old_repository_name")}` repository from {GetPlatform(log.Data)} to `{GetDataValue(log.Data, "new_repository_name")}`";
1746+
=> $"I have renamed the `{GetDataValue(log.Data, "old_repository")}` repository from {GetPlatform(log.Data)} to `{GetDataValue(log.Data, "new_repository")}`";
17471747

17481748
public string BuildGoingToSleepLogText(PersonalLog log)
17491749
{

Service/TextBuilding/Localisation/RomanianTextBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,19 +1749,19 @@ public string BuildGitContributionsMeasurementLogText(PersonalLog log)
17491749
=> $"Am avut {log.Data["contributions_count"]} de contribuții pe {GetPlatform(log.Data)}";
17501750

17511751
public string BuildGitReleaseLogText(PersonalLog log)
1752-
=> $"Am lansat versiunea '{log.Data["release_version"]}' pentru repozitory-ul '{log.Data["repository_name"]}' pe {GetPlatform(log.Data)}";
1752+
=> $"Am lansat versiunea '{GetDataValue(log.Data, "version")}' pentru repozitory-ul '{GetDataValue(log.Data, "repository")}' pe {GetPlatform(log.Data)}";
17531753

17541754
public string BuildGitRepositoryArchivalLogText(PersonalLog log)
1755-
=> $"Am arhivat repozitory-ul '{GetDataValue(log.Data, "repository_name")}' de pe {GetPlatform(log.Data)}";
1755+
=> $"Am arhivat repozitory-ul '{GetDataValue(log.Data, "repository")}' de pe {GetPlatform(log.Data)}";
17561756

17571757
public string BuildGitRepositoryDeletionLogText(PersonalLog log)
1758-
=> $"Am șters repozitory-ul '{GetDataValue(log.Data, "repository_name")}' de pe {GetPlatform(log.Data)}";
1758+
=> $"Am șters repozitory-ul '{GetDataValue(log.Data, "repository")}' de pe {GetPlatform(log.Data)}";
17591759

17601760
public string BuildGitRepositoryCreationLogText(PersonalLog log)
1761-
=> $"Am creat repozitory-ul '{GetDataValue(log.Data, "repository_name")}' pe {GetPlatform(log.Data)}";
1761+
=> $"Am creat repozitory-ul '{GetDataValue(log.Data, "repository")}' pe {GetPlatform(log.Data)}";
17621762

17631763
public string BuildGitRepositoryRenameLogText(PersonalLog log)
1764-
=> $"Am redenumit repozitory-ul '{GetDataValue(log.Data, "old_repository_name")}' de pe {GetPlatform(log.Data)} în '{GetDataValue(log.Data, "new_repository_name")}'";
1764+
=> $"Am redenumit repozitory-ul '{GetDataValue(log.Data, "old_repository")}' de pe {GetPlatform(log.Data)} în '{GetDataValue(log.Data, "new_repository")}'";
17651765

17661766
public string BuildGoingToSleepLogText(PersonalLog log)
17671767
{

Service/TextBuilding/PersonalLogTextBuilderBase.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,35 +302,45 @@ protected bool TryGetDevice(Dictionary<string, string> data, out string device)
302302
{
303303
device = GetDevice(data);
304304

305-
return !MissingValue.Equals(device);
305+
return
306+
!string.IsNullOrWhiteSpace(device) &&
307+
!MissingValue.Equals(device);
306308
}
307309

308310
protected bool TryGetByPerson(Dictionary<string, string> data, out string byPerson)
309311
{
310312
byPerson = GetByPerson(data);
311313

312-
return !MissingValue.Equals(byPerson);
314+
return
315+
!string.IsNullOrWhiteSpace(byPerson) &&
316+
!MissingValue.Equals(byPerson);
313317
}
314318

315319
public bool TryGetDataValue(Dictionary<string, string> data, string key, out string value)
316320
{
317321
value = GetDataValue(data, key, null);
318322

319-
return !string.IsNullOrWhiteSpace(value);
323+
return
324+
!string.IsNullOrWhiteSpace(value) &&
325+
!MissingValue.Equals(value);
320326
}
321327

322328
protected bool TryGetPlatform(Dictionary<string, string> data, out string platform)
323329
{
324330
platform = GetPlatform(data);
325331

326-
return !string.IsNullOrWhiteSpace(platform);
332+
return
333+
!string.IsNullOrWhiteSpace(platform) &&
334+
!MissingValue.Equals(platform);
327335
}
328336

329337
protected bool TryGetSide(Dictionary<string, string> data, out string side)
330338
{
331339
side = GetSide(data);
332340

333-
return !string.IsNullOrWhiteSpace(side);
341+
return
342+
!string.IsNullOrWhiteSpace(side) &&
343+
!MissingValue.Equals(side);
334344
}
335345
}
336346
}

0 commit comments

Comments
 (0)