Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

internationalized social-media.js.

  • Loading branch information...
commit 134f64f0a3316de0641441a8f91ffaa3d92eaacd 1 parent b6d90ab
@toolness authored
Showing with 8 additions and 4 deletions.
  1. +4 −1 js/fc/nls/misc.js
  2. +4 −3 js/fc/ui/social-media.js
View
5 js/fc/nls/misc.js
@@ -4,6 +4,9 @@ define({
description: 'Miscellaneous strings.',
root: {
"page-load-err": 'Sorry, an error occurred while trying to get the page.',
- "publish-err": 'Sorry, an error occurred while trying to publish.'
+ "publish-err": 'Sorry, an error occurred while trying to publish.',
+ "facebook-locale": "en_US",
+ "default-tweet": "Check out the #MozThimble page I just made:",
+ "tweet": "Tweet"
}
});
View
7 js/fc/ui/social-media.js
@@ -6,7 +6,7 @@
* they click the like button and we don't like that kind of
* monitoring behaviour.
*/
-define(function() {
+define(["i18n!fc/nls/misc"], function(i18nBundle) {
return function SocialMedia() {
var urlPlaceHolder = "__URL__PLACE__HOLDER__";
@@ -16,7 +16,8 @@ define(function() {
var self = {
facebook: {
id: "facebook-jssdk",
- src: "//connect.facebook.net/en_US/all.js#xfbml=1",
+ src: "//connect.facebook.net/" +
+ i18nBundle['facebook-locale'] + "/all.js#xfbml=1",
html: "<div class='fb-like' data-href='"+urlPlaceHolder+"' data-send='false' data-action='recommend' data-layout='button_count' data-show-faces='false' data-font='tahoma'></div>",
afterHotLoad: function() {
// Facebook needs additional help, because it needs
@@ -39,7 +40,7 @@ define(function() {
twitter: {
id: "twitter-wjs",
src: "//platform.twitter.com/widgets.js",
- html: "<a href='https://twitter.com/share'class='twitter-share-button' data-text='Check out the #MozThimble page I just made: ' data-url='"+urlPlaceHolder+"' data-via='Mozilla' data-count='none'>Tweet</a>"
+ html: "<a href='https://twitter.com/share'class='twitter-share-button' data-text='" + i18nBundle['default-tweet'] + " ' data-url='"+urlPlaceHolder+"' data-via='Mozilla' data-count='none'>" + i18nBundle['tweet'] + "</a>"
},
/**
Please sign in to comment.
Something went wrong with that request. Please try again.