Skip to content

Commit

Permalink
Merge pull request #1522 from VoChiDanh/master
Browse files Browse the repository at this point in the history
Fix tsv & yml
  • Loading branch information
VoChiDanh authored Sep 24, 2022
2 parents 7ee929b + e551c8d commit 47022c3
Show file tree
Hide file tree
Showing 8 changed files with 2,844 additions and 2,838 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/
package dansplugins.factionsystem;

import dansplugins.factionsystem.commands.AddLawCommand;
import dansplugins.factionsystem.commands.abs.TabCompleterBase;
import dansplugins.factionsystem.data.EphemeralData;
import dansplugins.factionsystem.data.PersistentData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ public MessageService(MedievalFactions medievalFactions) {

public void createLanguageFile() {
languageFile = new File(medievalFactions.getDataFolder(), "language.yml");
if (!languageFile.exists()) {
medievalFactions.saveResource("language.yml", false);
}

if (!languageFile.exists()) medievalFactions.saveResource("language.yml", false);
language = new YamlConfiguration();
try {
language.load(languageFile);
Expand All @@ -37,15 +34,25 @@ public FileConfiguration getLanguage() {
return language;
}


public void reloadLanguage() {
language = YamlConfiguration.loadConfiguration(languageFile);
if (languageFile.exists()) {
language = YamlConfiguration.loadConfiguration(languageFile);
} else {
createLanguageFile();
}
}

public void saveLanguage() {
try {
language.save(languageFile);
} catch (IOException ignored) {
if (languageFile.exists()) {
try {
language.save(languageFile);
} catch (IOException ignored) {
}
} else {
createLanguageFile();
}
}


}
166 changes: 83 additions & 83 deletions src/main/resources/de.tsv

Large diffs are not rendered by default.

1,100 changes: 550 additions & 550 deletions src/main/resources/en-us.tsv

Large diffs are not rendered by default.

1,100 changes: 550 additions & 550 deletions src/main/resources/es.tsv

Large diffs are not rendered by default.

1,100 changes: 550 additions & 550 deletions src/main/resources/pt-br.tsv

Large diffs are not rendered by default.

1,100 changes: 550 additions & 550 deletions src/main/resources/ru.tsv

Large diffs are not rendered by default.

1,092 changes: 546 additions & 546 deletions src/main/resources/test.tsv

Large diffs are not rendered by default.

0 comments on commit 47022c3

Please sign in to comment.