fix(sharing): Translatable share strings

This commit is contained in:
Sabe Jones 2015-11-11 13:35:14 -05:00
parent cc2a6d4db1
commit cc92b985a2
7 changed files with 19 additions and 8 deletions

View file

@ -140,5 +140,11 @@
"streakAchievementCount": "<%= streaks %> 21-Day Streaks",
"twentyOneDays": "You've completed your Daily for 21 days in a row!",
"dontBreakStreak": "Amazing job. Don't break the streak!",
"dontStop": "Don't Stop Now!"
"dontStop": "Don't Stop Now!",
"levelUpShare": "I leveled up in Habitica by improving my real-life habits!",
"questUnlockShare": "I unlocked a new quest in Habitica!",
"hatchPetShare": "I hatched a new pet by completing my real-life tasks!",
"raisePetShare": "I raised a pet into a mount by completing my real-life tasks!",
"wonChallengeShare": "I won a challenge in Habitica!",
"achievementShare": "I earned a new achievement in Habitica!"
}

View file

@ -1,10 +1,11 @@
include ../avatar/generated_avatar
mixin achievementFooter
- var tweet = env.t('achievementShare');
.modal-footer(style='margin-top:0', ng-init='loadWidgets()')
.container-fluid
.row.text-center
.col-xs-4
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I earned a new achievement in Habitica!&via=habitica&url=#{env.BASE_URL}/social/achievement&count=none')=env.t('tweet')
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/achievement&count=none')=env.t('tweet')
.col-xs-4
.fb-share-button(data-href='#{env.BASE_URL}/social/achievement', data-layout='button')
.col-xs-4

View file

@ -1,6 +1,7 @@
include ../avatar/generated_avatar
script(type='text/ng-template', id='modals/hatchPet.html')
- var tweet = env.t('hatchPetShare');
.modal-content(style='min-width:28em')
.modal-body.text-center(style='padding-bottom:0')
h3(style='margin-bottom: 0')=env.t('hatchedPet',{egg:'{{::hatchedPet.egg}}', potion:'{{::hatchedPet.potion}}'})
@ -25,7 +26,7 @@ script(type='text/ng-template', id='modals/hatchPet.html')
.container-fluid
.row
.col-xs-3
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I just hatched a {{::hatchedPet.potion}} {{::hatchedPet.egg}} by completing my real-life tasks!"&via=habitica&url=#{env.BASE_URL}/social/hatch-pet&count=none')=env.t('tweet')
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/hatch-pet&count=none')=env.t('tweet')
.col-xs-4(style='margin-left:.8em')
.fb-share-button(data-href='#{env.BASE_URL}/social/hatch-pet', data-layout='button')
.col-xs-4(style='margin-left:.8em')

View file

@ -1,7 +1,7 @@
include ../avatar/generated_avatar
script(type='text/ng-template', id='modals/levelUp.html')
- var level = '{{user.stats.lvl}}';
- var tweet = env.t('levelUpShare');
.modal-content(style='min-width:28em')
.modal-body.text-center(style='padding-bottom:0')
h3(style='margin-bottom: 0')=env.t('gainedLevel')
@ -24,7 +24,7 @@ script(type='text/ng-template', id='modals/levelUp.html')
.container-fluid
.row
.col-xs-3
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=I+got+to+Level+#{level}+in+Habitica+by+improving+my+real-life+habits!&via=habitica&url=#{env.BASE_URL}/social/level-up&count=none')=env.t('tweet')
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/level-up&count=none')=env.t('tweet')
.col-xs-4(style='margin-left:.8em')
.fb-share-button(data-href='#{env.BASE_URL}/social/level-up', data-layout='button')
.col-xs-4(style='margin-left:.8em')

View file

@ -86,6 +86,7 @@ script(type='text/ng-template', id='modals/questInvitation.html')
button.btn.btn-primary(ng-click='questAccept(); $close()')=env.t('accept')
script(type='text/ng-template', id='modals/questDrop.html')
- var tweet = env.t('questUnlockShare');
.modal-content(style='min-width:28em')
.modal-body.text-center
h3=env.t('unlockedAQuest')
@ -110,7 +111,7 @@ script(type='text/ng-template', id='modals/questDrop.html')
.container-fluid
.row
.col-xs-3
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I unlocked the quest {{::selectedQuest.text()}} in Habitica!"&via=habitica&url=#{env.BASE_URL}/social/unlock-quest&count=none')=env.t('tweet')
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/unlock-quest&count=none')=env.t('tweet')
.col-xs-4(style='margin-left:.8em')
.fb-share-button(data-href='#{env.BASE_URL}/social/unlock-quest', data-layout='button')
.col-xs-4(style='margin-left:.8em')

View file

@ -1,6 +1,7 @@
include ../avatar/generated_avatar
script(type='text/ng-template', id='modals/raisePet.html')
- var tweet = env.t('raisePetShare');
.modal-content(style='min-width:28em')
.modal-body.text-center(style='padding-bottom:0')
h3(style='margin-bottom: 0')=env.t('raisedPet',{pet:'{{::raisedPet.displayName}}'})
@ -25,7 +26,7 @@ script(type='text/ng-template', id='modals/raisePet.html')
.container-fluid
.row
.col-xs-3
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I just raised a {{::raisedPet.displayName}} mount by completing my real-life tasks!"&via=habitica&url=#{env.BASE_URL}/social/raise-pet&count=none')=env.t('tweet')
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/raise-pet&count=none')=env.t('tweet')
.col-xs-4(style='margin-left:.8em')
.fb-share-button(data-href='#{env.BASE_URL}/social/raise-pet', data-layout='button')
.col-xs-4(style='margin-left:.8em')

View file

@ -1,6 +1,7 @@
include ../avatar/generated_avatar
script(type='text/ng-template', id='modals/wonChallenge.html')
- var tweet = env.t('wonChallengeShare');
.modal-content(style='min-width:28em')
.modal-body.text-center
h3(style='margin-bottom: 0')=env.t('wonChallenge')
@ -30,7 +31,7 @@ script(type='text/ng-template', id='modals/wonChallenge.html')
.container-fluid
.row
.col-xs-3
a.twitter-share-button(href='https://twitter.com/intent/tweet?text="I just won the Challenge {{::user.achievements.challenges[user.achievements.challenges.length - 1]}} in Habitica!"&via=habitica&url=#{env.BASE_URL}/social/won-challenge&count=none')=env.t('tweet')
a.twitter-share-button(href='https://twitter.com/intent/tweet?text=#{tweet}&via=habitica&url=#{env.BASE_URL}/social/won-challenge&count=none')=env.t('tweet')
.col-xs-4(style='margin-left:.8em')
.fb-share-button(data-href='#{env.BASE_URL}/social/won-challenge', data-layout='button')
.col-xs-4(style='margin-left:.8em')