From 85d0ebbc8e52c5af59e27e151f413381e81af1a0 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Thu, 6 Mar 2014 17:21:26 +0100 Subject: [PATCH] improve(i18n): move potion to strings, add content.json for generic content --- dist/habitrpg-shared.js | 8 ++++++-- locales/en/content.json | 4 ++++ script/content.coffee | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 locales/en/content.json diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index e9f63e0adf..9cdb809ffe 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11255,8 +11255,12 @@ _.each(gearTypes, function(type) { api.potion = { type: 'potion', - text: "Health Potion", - notes: "Recover 15 Health (Instant Use)", + text: (function() { + return i18n.t('potionText'); + }), + notes: (function() { + return i18n.t('potionNotes'); + }), value: 25, key: 'potion' }; diff --git a/locales/en/content.json b/locales/en/content.json new file mode 100644 index 0000000000..8f3843001a --- /dev/null +++ b/locales/en/content.json @@ -0,0 +1,4 @@ +{ + "potionText": "Potion", + "potionNotes": "Recover 15 Health (Instant Use)" +} \ No newline at end of file diff --git a/script/content.coffee b/script/content.coffee index 295984a8b1..7308a3cdd9 100644 --- a/script/content.coffee +++ b/script/content.coffee @@ -300,7 +300,7 @@ _.each gearTypes, (type) -> --------------------------------------------------------------- ### -api.potion = type: 'potion', text: "Health Potion", notes: "Recover 15 Health (Instant Use)", value: 25, key: 'potion' +api.potion = type: 'potion', text: (-> i18n.t('potionText')), notes: (-> i18n.t('potionNotes')), value: 25, key: 'potion' ### ---------------------------------------------------------------