1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

[Ci skip] Preparing for the french...

This commit is contained in:
TheBusyBiscuit 2020-01-31 00:18:19 +01:00
parent 6b7435a181
commit 268f39cccd
2 changed files with 16 additions and 6 deletions

View File

@ -50,17 +50,19 @@ public class GitHubService {
contributors.put(fuffles.getName(), fuffles);
// Translators - German
addTranslator("TheBusyBiscuit", "de");
addTranslator("TheBusyBiscuit", "de", false);
// Translators - French
addTranslator("JustDams", "fr");
addTranslator("edkerforne", "fr");
addTranslator("tnthomastn", "fr");
addTranslator("JustDams", "fr", true);
addTranslator("edkerforne", "fr", true);
addTranslator("tnthomastn", "fr", true);
}
private void addTranslator(String name, String language) {
private void addTranslator(String name, String language, boolean lock) {
Contributor contributor = contributors.computeIfAbsent(name, user -> new Contributor(user, "https://github.com/" + user));
contributor.setContribution("translator," + language, 0);
if (lock) contributor.lock();
}
public void connect(boolean logging) {

View File

@ -26,6 +26,8 @@ public class Contributor {
private final ConcurrentMap<String, Integer> contributions = new ConcurrentHashMap<>();
private final ComputedOptional<String> headTexture = ComputedOptional.createNew();
private boolean locked = false;
public Contributor(String name, String profile) {
ghName = profile.substring(profile.lastIndexOf('/') + 1);
mcName = name;
@ -39,7 +41,9 @@ public class Contributor {
}
public void setContribution(String role, int commits) {
contributions.put(role, commits);
if (!locked) {
contributions.put(role, commits);
}
}
/**
@ -123,4 +127,8 @@ public class Contributor {
public String getDisplayName() {
return ChatColor.GRAY + ghName + (!ghName.equals(mcName) ? ChatColor.DARK_GRAY + " (MC: " + mcName + ")" : "");
}
public void lock() {
this.locked = true;
}
}