Skip to content

Commit

Permalink
Add i18n support
Browse files Browse the repository at this point in the history
  • Loading branch information
strugee committed Apr 18, 2019
1 parent 4977fda commit c50928a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
16 changes: 16 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extensionName": {
"message": "Make ReCaptcha's \"I'm not a robot\" accurate",
"description": "Name of the extension."
},

"extensionDescription": {
"message": "Makes ReCaptcha's \"I'm not a robot\" text more accurate",
"description": "Description of the extension."
},

"replacementText": {
"message": "I want to do unpaid image classification",
"description": "Text that \"I'm not a robot\" will be replaced with"
}
}
13 changes: 13 additions & 0 deletions _locales/qqx/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extensionName": {
"message": "(extensionName)"
},

"extensionDescription": {
"message": "(extensionDescription)"
},

"replacementText": {
"message": "(replacementText)"
}
}
6 changes: 4 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"manifest_version": 2,
"name": "Make ReCaptcha's \"I'm not a robot\" accurate",
"name": "__MSG_extensionName__",
"version": "1.0",

"description": "Makes ReCaptcha's \"I'm not a robot\" text more accurate",
"description": "__MSG_extensionDescription__",

"default_locale": "en",

"icons": {
"48": "icons/border-48.png"
Expand Down
2 changes: 1 addition & 1 deletion recaptcha.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var label = document.querySelector('#recaptcha-anchor-label');
if (label) {
label.innerText = 'I want to do unpaid image classification';
label.innerText = browser.i18n.getMessage('replacementText');
}

0 comments on commit c50928a

Please sign in to comment.