Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Language option #20

Merged
merged 1 commit into from

2 participants

@ada

You can now set the language for the button. English is set as default.

@sirkitree sirkitree merged commit bc5cf0e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 22, 2014
  1. Language option

    Alex authored
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 0 deletions.
  1. +6 −0 README.md
  2. +8 −0 google-plus-signin.js
View
6 README.md
@@ -13,6 +13,12 @@ A good starting place for a Google Plus sign-in button. Specify your client id a
4. Create a listener on your `$scope` for `event:google-plus-signin-success` to detect when your users are authenticated.
5. *Optional:* Listen for `event:google-plus-signin-failure` to handle authentication errors and sign outs.
+## Options
+1. Language ([supported languages](https://developers.google.com/+/web/api/supported-languages)):
+```html
+ <google-plus-signin clientid="620125449078" language="sv"></google-plus-signin>
+```
+
## Bower
Installable via `bower`:
View
8 google-plus-signin.js
@@ -35,6 +35,14 @@ angular.module('directive.g+signin', []).
}
});
+ // Default language
+ // Supported languages: https://developers.google.com/+/web/api/supported-languages
+ attrs.$observe('language', function(value){
+ window.___gcfg = {
+ lang: value ? value : 'en'
+ };
+ });
+
// Asynchronously load the G+ SDK.
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
Something went wrong with that request. Please try again.