From 65344e8a8cc766b57b93cabee3f8342353171384 Mon Sep 17 00:00:00 2001 From: Andre Alves Garzia Date: Mon, 15 Feb 2016 11:21:00 -0200 Subject: [PATCH] implementing new features for localization of navigation element. First L10N for navigation is SV --- activity-data/content/sv/activity.md | 2 ++ app.js | 5 +++++ index.html | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/activity-data/content/sv/activity.md b/activity-data/content/sv/activity.md index 42e03af..530570a 100644 --- a/activity-data/content/sv/activity.md +++ b/activity-data/content/sv/activity.md @@ -1,6 +1,8 @@ --- title: Ping Kong github: mozilla/mozilla-club-activity-ping-kong +github_label: Visa på Github +discourse_label: Diskussion image: pingkong.png competencies: - {label: "Webb mekanik", type: "web-mechanics"} diff --git a/app.js b/app.js index 89c2ef9..ebae636 100755 --- a/app.js +++ b/app.js @@ -227,6 +227,11 @@ return ""; } }); + + Handlebars.registerHelper('withDefaultValue', function (value, safeValue) { + var out = value || safeValue; + return new Handlebars.SafeString(out); + }); // Start the app. diff --git a/index.html b/index.html index dea6208..755ef43 100755 --- a/index.html +++ b/index.html @@ -35,11 +35,11 @@
  • - Discussion + {{withDefaultValue activity.meta.discourse_label "Discussion"}}
  • - View on Github + {{withDefaultValue activity.meta.github_label "View on Github"}}