Skip to content

Commit

Permalink
Added languages and made import export buttons do stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Oct 3, 2024
1 parent c2bf3ef commit 301d1c4
Show file tree
Hide file tree
Showing 11 changed files with 273 additions and 12 deletions.
33 changes: 33 additions & 0 deletions languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "Lassen Sie die Konsole Nachrichten für verschiedene Dinge empfangen"
}
},
"menu": {
"settings": {
"buttons": {
"export": "Einstellungen Exportieren",
"import": "Einstellungen Importieren",
"footer": {
"save": "Speichern",
"submit": "Einreichen",
"cancel": "Abbrechen"
}
},
"tabs": {
"home": "Startseite",
"rolls": "Würfe",
"token": "Token",
"critical": "Kritisch",
"text": "Text",
"misc": "Verschiedenes"
}
},
"import": {
"title": "PF2e RPG Einstellungen Importieren",
"content": "Einstellungen JSON Hochladen",
"buttons": {
"import": "Importieren",
"cancel": "Abbrechen"
},
"notification": {
"success": "PF2e RPG Einstellungen Importiert!",
"failure": "PF2e RPG Einstellungen Import fehlgeschlagen :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "Kritischer Fehler",
Expand Down
17 changes: 15 additions & 2 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,20 @@
"settings": {
"buttons": {
"export": "Export Settings",
"import": "Import Settings"
"import": "Import Settings",
"footer": {
"save": "Save",
"submit": "Submit",
"cancel": "Cancel"
}
},
"tabs": {
"home": "Home",
"rolls": "Rolls",
"token": "Token",
"critical": "Critical",
"text": "Text",
"misc": "Misc"
}
},
"import": {
Expand All @@ -561,7 +574,7 @@
},
"notification": {
"success": "Pf2e RPG Settings Imported!",
"failure": "PF2e RPG Settings failed to import"
"failure": "PF2e RPG Settings failed to import :("
}
}
},
Expand Down
33 changes: 33 additions & 0 deletions languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "Hacer que la consola reciba mensajes para diferentes cosas."
}
},
"menu": {
"settings": {
"buttons": {
"export": "Exportar Configuraciones",
"import": "Importar Configuraciones",
"footer": {
"save": "Guardar",
"submit": "Enviar",
"cancel": "Cancelar"
}
},
"tabs": {
"home": "Inicio",
"rolls": "Tiradas",
"token": "Ficha",
"critical": "Crítico",
"text": "Texto",
"misc": "Varios"
}
},
"import": {
"title": "Importación de Configuraciones de PF2e RPG",
"content": "Subir JSON de Configuraciones",
"buttons": {
"import": "Importar",
"cancel": "Cancelar"
},
"notification": {
"success": "¡Configuraciones de PF2e RPG Importadas!",
"failure": "Falló la importación de Configuraciones de PF2e RPG :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "Fallo crítico",
Expand Down
33 changes: 33 additions & 0 deletions languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "Faire en sorte que la console reçoive des messages pour différentes choses"
}
},
"menu": {
"settings": {
"buttons": {
"export": "Exporter Paramètres",
"import": "Importer Paramètres",
"footer": {
"save": "Enregistrer",
"submit": "Soumettre",
"cancel": "Annuler"
}
},
"tabs": {
"home": "Accueil",
"rolls": "Jets",
"token": "Jeton",
"critical": "Critique",
"text": "Texte",
"misc": "Divers"
}
},
"import": {
"title": "Importation des Paramètres PF2e RPG",
"content": "Télécharger le JSON des Paramètres",
"buttons": {
"import": "Importer",
"cancel": "Annuler"
},
"notification": {
"success": "Paramètres PF2e RPG Importés!",
"failure": "Échec de l'importation des Paramètres PF2e RPG :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "Échec critique",
Expand Down
33 changes: 33 additions & 0 deletions languages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "コンソールにさまざまなメッセージを受信させる"
}
},
"menu": {
"settings": {
"buttons": {
"export": "設定のエクスポート",
"import": "設定のインポート",
"footer": {
"save": "保存",
"submit": "送信",
"cancel": "キャンセル"
}
},
"tabs": {
"home": "ホーム",
"rolls": "ロール",
"token": "トークン",
"critical": "クリティカル",
"text": "テキスト",
"misc": "その他"
}
},
"import": {
"title": "PF2e RPG 設定のインポート",
"content": "設定JSONをアップロード",
"buttons": {
"import": "インポート",
"cancel": "キャンセル"
},
"notification": {
"success": "PF2e RPG 設定がインポートされました!",
"failure": "PF2e RPG 設定のインポートに失敗しました :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "重大な障害",
Expand Down
33 changes: 33 additions & 0 deletions languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "콘솔이 다양한 내용에 대한 메시지를 받도록 합니다."
}
},
"menu": {
"settings": {
"buttons": {
"export": "설정 내보내기",
"import": "설정 가져오기",
"footer": {
"save": "저장",
"submit": "제출",
"cancel": "취소"
}
},
"tabs": {
"home": "",
"rolls": "굴림",
"token": "토큰",
"critical": "치명타",
"text": "텍스트",
"misc": "기타"
}
},
"import": {
"title": "PF2e RPG 설정 가져오기",
"content": "설정 JSON 업로드",
"buttons": {
"import": "가져오기",
"cancel": "취소"
},
"notification": {
"success": "PF2e RPG 설정이 가져오기되었습니다!",
"failure": "PF2e RPG 설정 가져오기에 실패했습니다 :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "중대한 실패",
Expand Down
33 changes: 33 additions & 0 deletions languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "Niech konsola odbiera komunikaty dla różnych rzeczy"
}
},
"menu": {
"settings": {
"buttons": {
"export": "Eksportuj Ustawienia",
"import": "Importuj Ustawienia",
"footer": {
"save": "Zapisz",
"submit": "Zatwierdź",
"cancel": "Anuluj"
}
},
"tabs": {
"home": "Główna",
"rolls": "Rzuty",
"token": "Żeton",
"critical": "Krytyczny",
"text": "Tekst",
"misc": "Różne"
}
},
"import": {
"title": "Import Ustawień PF2e RPG",
"content": "Prześlij JSON Ustawień",
"buttons": {
"import": "Importuj",
"cancel": "Anuluj"
},
"notification": {
"success": "Ustawienia PF2e RPG zaimportowane!",
"failure": "Import Ustawień PF2e RPG nie powiódł się :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "Krytyczna Porażka",
Expand Down
33 changes: 33 additions & 0 deletions languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,39 @@
"hint": "Пусть консоль будет получать сообщения о разных вещах"
}
},
"menu": {
"settings": {
"buttons": {
"export": "Экспорт настроек",
"import": "Импорт настроек",
"footer": {
"save": "Сохранить",
"submit": "Отправить",
"cancel": "Отмена"
}
},
"tabs": {
"home": "Главная",
"rolls": "Броски",
"token": "Токен",
"critical": "Критический",
"text": "Текст",
"misc": "Прочее"
}
},
"import": {
"title": "Импорт настроек PF2e RPG",
"content": "Загрузить JSON настроек",
"buttons": {
"import": "Импорт",
"cancel": "Отмена"
},
"notification": {
"success": "Настройки PF2e RPG успешно импортированы!",
"failure": "Ошибка импорта настроек PF2e RPG :("
}
}
},
"display-text": {
"outcomes": {
"criticalFailure": "Критический отказ",
Expand Down
7 changes: 7 additions & 0 deletions scripts/helpers/forms/settingsConfigForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ export class SettingsConfigForm extends FormApplication {
ui.notifications.warn("Settings menu closed without saving");
this.close(); // Close the form without saving
});
html.find('#pf2e-rpg-import').on('click', (event) => {
game.pf2eRPGNumbers.settings.import();
this.close(); // Close the form without saving
});
html.find('#pf2e-rpg-export').on('click', (event) => {
game.pf2eRPGNumbers.settings.export();
});
}

getData() {
Expand Down
6 changes: 3 additions & 3 deletions templates/settings/pf2e-rpg-settings-config.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
</section>

<footer class="pf2e-rpg-config-form">
<button id="pf2e-rpg-save">Save</button>
<button id="pf2e-rpg-submit">Submit</button>
<button id="pf2e-rpg-cancel">Cancel</button>
<button id="pf2e-rpg-save">{{localize "pf2e-rpg-numbers.menu.settings.buttons.footer.save"}}</button>
<button id="pf2e-rpg-submit">{{localize "pf2e-rpg-numbers.menu.settings.buttons.footer.submit"}}</button>
<button id="pf2e-rpg-cancel">{{localize "pf2e-rpg-numbers.menu.settings.buttons.footer.cancel"}}</button>
</footer>
</form>

Expand Down
24 changes: 17 additions & 7 deletions templates/settings/tabs/home.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{{! Enabled }}
<div class="form-group">
<label for="settings.enabled" data-tooltip="{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}">
{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}
</label>
<input type="checkbox" id="settings.enabled" name="settings.enabled" {{checked settings.enabled}} />
</div>
<span>
{{! Enabled }}
<div class="form-group">
<label for="settings.enabled" data-tooltip="{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}">
{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}
</label>
<input type="checkbox" id="settings.enabled" name="settings.enabled" {{checked settings.enabled}} />
</div>
<button id="pf2e-rpg-export">
<i class="fas fa-file-export"></i>
{{localize "pf2e-rpg-numbers.menu.settings.export"}}
</button>
<button id="pf2e-rpg-import">
<i class="fas fa-file-import"></i>
{{localize "pf2e-rpg-numbers.menu.settings.import"}}
</button>
</span>

0 comments on commit 301d1c4

Please sign in to comment.