Skip to content

Commit

Permalink
Fix issues with localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Oct 3, 2024
1 parent 301d1c4 commit 966b8b7
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 11 deletions.
6 changes: 6 additions & 0 deletions languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "Konfigurationsmenü PF2e RPG #s",
"buttons": {
"export": "Einstellungen Exportieren",
"import": "Einstellungen Importieren",
Expand All @@ -558,6 +559,11 @@
"cancel": "Abbrechen"
}
},
"notification": {
"save": "Einstellungen erfolgreich gespeichert!",
"submit": "Einstellungen erfolgreich eingereicht!",
"cancel": "Konfigurationsmenü geschlossen ohne zu speichern"
},
"tabs": {
"home": "Startseite",
"rolls": "Würfe",
Expand Down
6 changes: 6 additions & 0 deletions languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "Menú de Configuración de PF2e RPG #s",
"buttons": {
"export": "Exportar Configuraciones",
"import": "Importar Configuraciones",
Expand All @@ -558,6 +559,11 @@
"cancel": "Cancelar"
}
},
"notification": {
"save": "¡Configuraciones guardadas con éxito!",
"submit": "¡Configuraciones enviadas con éxito!",
"cancel": "Menú de configuraciones cerrado sin guardar"
},
"tabs": {
"home": "Inicio",
"rolls": "Tiradas",
Expand Down
6 changes: 6 additions & 0 deletions languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "Menu de Configuration PF2e RPG #s",
"buttons": {
"export": "Exporter Paramètres",
"import": "Importer Paramètres",
Expand All @@ -558,6 +559,11 @@
"cancel": "Annuler"
}
},
"notification": {
"save": "Paramètres enregistrés avec succès!",
"submit": "Paramètres soumis avec succès!",
"cancel": "Menu de paramètres fermé sans enregistrement"
},
"tabs": {
"home": "Accueil",
"rolls": "Jets",
Expand Down
6 changes: 6 additions & 0 deletions languages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "PF2e RPG #s 設定メニュー",
"buttons": {
"export": "設定のエクスポート",
"import": "設定のインポート",
Expand All @@ -558,6 +559,11 @@
"cancel": "キャンセル"
}
},
"notification": {
"save": "設定が正常に保存されました!",
"submit": "設定が正常に送信されました!",
"cancel": "設定メニューは保存せずに閉じられました"
},
"tabs": {
"home": "ホーム",
"rolls": "ロール",
Expand Down
6 changes: 6 additions & 0 deletions languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "PF2e RPG #s 설정 메뉴",
"buttons": {
"export": "설정 내보내기",
"import": "설정 가져오기",
Expand All @@ -558,6 +559,11 @@
"cancel": "취소"
}
},
"notification": {
"save": "설정이 성공적으로 저장되었습니다!",
"submit": "설정이 성공적으로 제출되었습니다!",
"cancel": "설정 메뉴가 저장되지 않고 닫혔습니다"
},
"tabs": {
"home": "",
"rolls": "굴림",
Expand Down
6 changes: 6 additions & 0 deletions languages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "Menu Konfiguracji PF2e RPG #s",
"buttons": {
"export": "Eksportuj Ustawienia",
"import": "Importuj Ustawienia",
Expand All @@ -558,6 +559,11 @@
"cancel": "Anuluj"
}
},
"notification": {
"save": "Ustawienia zostały pomyślnie zapisane!",
"submit": "Ustawienia zostały pomyślnie zatwierdzone!",
"cancel": "Menu ustawień zamknięto bez zapisywania"
},
"tabs": {
"home": "Główna",
"rolls": "Rzuty",
Expand Down
6 changes: 6 additions & 0 deletions languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@
},
"menu": {
"settings": {
"title": "Меню Настроек PF2e RPG #s",
"buttons": {
"export": "Экспорт настроек",
"import": "Импорт настроек",
Expand All @@ -558,6 +559,11 @@
"cancel": "Отмена"
}
},
"notification": {
"save": "Настройки успешно сохранены!",
"submit": "Настройки успешно отправлены!",
"cancel": "Меню настроек закрыто без сохранения"
},
"tabs": {
"home": "Главная",
"rolls": "Броски",
Expand Down
18 changes: 9 additions & 9 deletions scripts/helpers/forms/settingsConfigForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export class SettingsConfigForm extends FormApplication {
// Add event listener for the Save button
html.find('#pf2e-rpg-save').on('click', (event) => {
event.preventDefault();
this._processForm(html, false); // Pass 'false' to not submit the form, only save
this._processForm(html, false); // Pass 'false' Fto not submit the form, only save
});
html.find('#pf2e-rpg-submit').on('click', (event) => {
event.preventDefault();
this._processForm(html, true); // Pass 'true' to indicate form submission
});
html.find('#pf2e-rpg-cancel').on('click', (event) => {
event.preventDefault();
ui.notifications.warn("Settings menu closed without saving");
ui.notifications.warn(game.i18n.localize(`${MODULE_ID}.menu.settings.notification.cancel`));
this.close(); // Close the form without saving
});
html.find('#pf2e-rpg-import').on('click', (event) => {
Expand All @@ -55,7 +55,7 @@ export class SettingsConfigForm extends FormApplication {
tabs: [
{
id: "home",
label: "Home",
label: game.i18n.localize(`${MODULE_ID}.menu.settings.tabs.home`),
icon: "fa-dragon",
home: true,
settings: {
Expand All @@ -64,7 +64,7 @@ export class SettingsConfigForm extends FormApplication {
},
{
id: "rolls",
label: "Rolls",
label: game.i18n.localize(`${MODULE_ID}.menu.settings.tabs.rolls`),
icon: "fa-dice-d20",
rolls: true,
settings: {
Expand Down Expand Up @@ -134,7 +134,7 @@ export class SettingsConfigForm extends FormApplication {
},
{
id: "token",
label: "Token",
label: game.i18n.localize(`${MODULE_ID}.menu.settings.tabs.token`),
icon: "fa-circle-user",
token: true,
settings: {
Expand Down Expand Up @@ -197,7 +197,7 @@ export class SettingsConfigForm extends FormApplication {
},
{
id: "critical",
label: "Critical",
label: game.i18n.localize(`${MODULE_ID}.menu.settings.tabs.critical`),
icon: "fa-explosion",
critical: true,
settings: {
Expand Down Expand Up @@ -225,7 +225,7 @@ export class SettingsConfigForm extends FormApplication {
},
{
id: "text",
label: "Text",
label: game.i18n.localize(`${MODULE_ID}.menu.settings.tabs.text`),
icon: "fa-message-captions",
text: true,
settings: {
Expand Down Expand Up @@ -350,12 +350,12 @@ export class SettingsConfigForm extends FormApplication {
if (submit) {
// If submitting, call _updateObject to store the data
await this.saveSettings(dataObject);
ui.notifications.info("Settings submitted successfully!");
ui.notifications.info(game.i18n.localize(`${MODULE_ID}.menu.settings.notification.submit`));
this.close();
} else {
// If saving, call _updateObject to store the data
await this.saveSettings(dataObject);
ui.notifications.info("Settings saved successfully!");
ui.notifications.info(game.i18n.localize(`${MODULE_ID}.menu.settings.notification.save`));
}
}
async saveSettings(data) {
Expand Down
4 changes: 2 additions & 2 deletions templates/settings/tabs/home.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
</div>
<button id="pf2e-rpg-export">
<i class="fas fa-file-export"></i>
{{localize "pf2e-rpg-numbers.menu.settings.export"}}
{{localize "pf2e-rpg-numbers.menu.settings.buttons.export"}}
</button>
<button id="pf2e-rpg-import">
<i class="fas fa-file-import"></i>
{{localize "pf2e-rpg-numbers.menu.settings.import"}}
{{localize "pf2e-rpg-numbers.menu.settings.buttons.import"}}
</button>
</span>

0 comments on commit 966b8b7

Please sign in to comment.