elianore
elianore

Reputation: 319

chrome extension- manifest version 2 _locales issues

i'm trying to update my manifest version for my extension but it gave me this problem:

default locale was specified, but _locales subtree is missing.

this is my manifest.json file, can anyone tell me where is the problem and what can i do?

{
  "name": "Selected Text", 
  "version": "0.1", 
  "manifest_version": 2,
  "description": "Selected Text and some changes", 
  "default_locale":"en", 
  "browser_action": { 
    "default_title": "S. Text", 
    "default_icon": "online.png",
    "default_popup": "popup.html"
  },
  "permissions": [
    "tabs", 
    "chrome://favicon/", 
    "http://*/*",  
    "https://*/*" 
  ],
  { 
    "matches": ["http://*/*"], 
    "js": ["selection.js"], 
    "run_at": "document_start", 
    "all_frames": true
  }
}

Upvotes: 22

Views: 19740

Answers (4)

RocketDonkey
RocketDonkey

Reputation: 37259

It sounds like you are missing the required _locales directory in your extension root. Since you are specifying a default_locale, you need to provide a _locales directory, inside of which lie your internationalization options. In your case, you would need to at least have a folder titled _locales/en, inside of which you have a messages.json file, inside of which you would set your specific parameters (see here for more information).

Upvotes: 48

Carson
Carson

Reputation: 7998

Please check the file hierarchy. It should be something like below,

- manifest.json
- 📂 _locales    👈
    - 📂 en 
        - messages.json
    - 📂 es
        - messages.json
    - 📂 ...
        - messages.json

Reference

Upvotes: 1

WlanKabl
WlanKabl

Reputation: 1

I got the same issue.

Its "default_locate": "en",.

But then there is still an error. So just leave it out.

Upvotes: 0

"default_locale":"en",

look at this code and think. you will get solution .

Upvotes: -5

Related Questions