Skip to content

Commit

Permalink
Merge pull request #3698 from troyjfarrell/grain_client_i18n
Browse files Browse the repository at this point in the history
I18n for grain renaming and grain deletion prompt
  • Loading branch information
kentonv authored Aug 6, 2023
2 parents f6c2c5e + 459adb6 commit a16f444
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions shell/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,17 @@
"was": "was: %s",
"renamedFrom": "renamed from: %s"
},
"grainTitlePopup": {
"prompt": "Set new title:",
"promptNotOwner": "Set a new personal title: (does not change the owner's title for this grain)"
},
"grainDeleteButton": {
"hint": "Move to trash",
"text": "Move to trash"
},
"grainDeletePopup": {
"confirmationMessage": "Really move this grain to your trash?"
},
"grainDebugLogButton": {
"hint": "Show Debug Log",
"text": "Log"
Expand Down
6 changes: 3 additions & 3 deletions shell/imports/client/grain-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ GrainLog = new Mongo.Collection("grainLog");

const promptNewTitle = function (grain) {
if (grain) {
let prompt = "Set new title:";
let prompt = TAPi18n.__('grains.grainTitlePopup.prompt');
if (!grain.isOwner()) {
prompt = "Set a new personal title: (does not change the owner's title for this grain)";
prompt = TAPi18n.__('grains.grainTitlePopup.promptNotOwner');
}

const title = window.prompt(prompt, grain.title());
Expand Down Expand Up @@ -159,7 +159,7 @@ Template.grainDeleteButton.events({
"click button": function (event) {
const activeGrain = globalGrains.getActive();
const grainId = activeGrain.grainId();
let confirmationMessage = "Really move this grain to your trash?";
let confirmationMessage = TAPi18n.__("grains.grainDeletePopup.confirmationMessage");
if (window.confirm(confirmationMessage)) {
Meteor.call("moveGrainsToTrash", [grainId]);
globalGrains.remove(grainId, true);
Expand Down

0 comments on commit a16f444

Please sign in to comment.