I would like to internationalize my extension on the Google Chrome Web Store. More precisely: I would like to display a title, a description and a detailed description in the native language of each country I target.
To do this, I followed the official Google documentation: https://developer.chrome.com/docs/webstore/i18n/
So I modified the manifest.json file by putting the following elements:
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
In my "local" folder are contained all my messages.json files displaying a title and a description for each language. Here is an example of a messages.json file (in Spanish):
{
"appName": {
"message": "La Touche Musicale - Aprender a tocar el piano en línea"
},
"appDesc": {
"message": "Aprende a tocar el piano fácilmente con las canciones que te gustan"
}
}
I compressed my folder and imported the zip into the Chrome developer dashboard. The different languages appear well in the item edition and I can change the detailed description according to the language.
However, the name and description, filled in each of my messages.json files and not editable from the dashboard, remain in English. For example, if I choose the Spanish language, the title and description displayed are :
Title: "La Touche Musicale - Learn piano online
Description: "Learn piano easily with the songs you love".
enter image description here
This is the title and description of the language I selected by default (en) in the manifest.json file.
Why don't the title and description adapt to the selected language, as I defined in the messages.json files?
ATTACHED DOCUMENTS :
Whole content of the manifest.json file :
{
"manifest_version": 2,
"name": "MSG_appName",
"description": "MSG_appDesc",
"default_locale": "en",
"version": "1.1",
"browser_action": {
"default_popup": "hello.html",
"default_icon": {
"16": "images/icon16.png",
"32": "images/icon32.png",
"128": "images/icon128.png"
}
},
"icons": {
"16": "images/icon16.png",
"32": "images/icon32.png",
"128": "images/icon128.png"
}
}
Whole content of a messages.json file (es) [All messages.json files have exactly the same structure and content (except for the language translation)]:
{
"appName": {
"message": "La Touche Musicale - Aprender a tocar el piano en línea"
},
"appDesc": {
"message": "Aprende a tocar el piano fácilmente con las canciones que te gustan"
}
}
Before the uploading in CWS you should test the extension in at least one of designed extension languages.
To do this you can set a language in your browser as "display Chrome in this language".
Related
There has been a continuous extension rejection, even with icons, screenshots, descriptions all uploaded. Anybody has encountered the same recently?
Item has a blank description field, or missing icons or screenshots, and appears to be suspicious.
The manifest is like
{
"short_name": "My Tabs",
"name": "My Tabs",
"description": "This extension will help uses to quickly open often visited pages.",
"icons": {
"16": "tabs.png",
"48": "tabs.png",
"128": "tabs.png"
},
...
}
I'm trying to make a google chrome extension, but I'm having a problem. Please answer as basic as possible as I'm really bad at code. Whenever I upload something as a zip file, it says
"An error occurred: Failed to process your item. manifest.json:5:26:
unexpected char."
This is my code :
{
"name": "ROBLOX Character Asset ID",
"version": "1.9.0", // version
"manifest_version": 2,
"description": "This extension is for GFX artists who need their customer's character asset ID",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"alarms",
"background",
"debugger",
"notifications",
"cookies",
"https://www.roblox.com/"
],
"background": {
"scripts": ["bgWork.js", "jQuery-ver3.js"]
},
"icons": { "16": "icon.png",
"48": "icon.png",
"128": "icon.png" }
}
This has to do with the content in your scripts and when you load the extension it not being able to be processed as I loaded your manifest.json just fine (though with blank js files). So don't look towards your manifest.json, you must have an illegal character in your js file.
I was wondering if it was possible to set a 'placeholder' value for a field in the manifest.json file of a Chrome extension. For example, I just started a new extension and my manifest looks like this :
{
"manifest_version": 2,
"author" : "My Name",
"name": "Extension Name",
"version": "0.0.1",
"description": "Desc",
"icons": { "16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png" },
"browser_action" : {
"default_title" : "Extension",
"default_icon" : {
"16": "icon32.png",
"48": "icon48.png",
"128": "icon128.png"
},
"default_popup" : "dropdown.html",
"js" : ["dropdown.js"]
},
"content_scripts" : [ {
"matches" : ["http://*/*, https://*/*"],
"js" : ["some_script.js"]
} ]
}
However, I have not yet made the icno*.png files so, obviously, whenever trying to load the extension, chrome says that it can't find the icon files.
Can I do something like :
//[...]
"default_icon" : {
//Will be added later
},
//[...]
or do I have to just delete the "browser_icon" and "icons" fields and add them later?
I found nothing in the Official Google Documentation.
In general, placeholder values are not permitted in the manifest.json. Many of the fields are checked for validity and/or that the resource is available when the manifest.json is loaded. This is necessary because these values are immediately used. Thus, they must be valid. The checking includes verifying the icon files for the browser_action and page_action keys. These files must exist for the extension to be loaded. Overall, what is required to be resolved, in order for the manifest.json to load, is explicitly stated in the error displayed when you attempt to load the unpacked extension from chrome://extensions/. You will need to resolve all errors in order for the extension to be loaded.
For icon files, you can usually delete the reference, or provide a placeholder icon file that contains an actual graphic. Personally, I just copy one of an assortment of icons I generally use, which are in the public domain, into a generically named icon file (e.g. icon.png, or myIcon.png, etc.). If you want, you could do a search for public domain icons which you could use for this purpose. There are a lot of choices.
I'm getting a serious issue with uploading an app to Chrome Store. Keeps saying:
"An error occurred: Failed to process your item.
The 128x128 icon file is missing.".
I do have the 128x128 .png file in there. This is my .json file:
{
"name": "Radio Player UK",
"version": "1.0",
"manifest_version": 2,
"description": "Radio, but without the rubbish. The best radio stations are here. Choose from lots of great radio stations.",
"app":{
"urls": ["http://www.radioplayeruk.com"],
"launch":{
"web_url": "http://www.radioplayeruk.com/index.php"
}
},
"icons":{
"icons": {
"16": "logo16.png",
"128": "logo.png"
}
}
}
I know the file extensions are case sensitive and have adjusted this accordingly.
Can anybody shed some light on why I keep getting this message?
You have set the icons twice. According to the Google docs it should be just one icons key.
So, your manifest should be:
{
"name": "Radio Player UK",
"version": "1.0",
"manifest_version": 2,
"description": "Radio, but without the rubbish. The best radio stations are here. Choose from lots of great radio stations.",
"app":{
"urls": ["http://www.radioplayeruk.com"],
"launch":{
"web_url": "http://www.radioplayeruk.com/index.php"
}
},
"icons": {
"16": "logo16.png",
"128": "logo.png"
}
}
I'm writing a chrome extension page action that works on certain URLs, more I realized that the URL specifies the icon shows in situations like this www.google.com/urlespecifies, I want the icon to appear only when the User is within the site.
My background file is thus
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (~tab.url.indexOf('urlespecifies.com')) {
chrome.pageAction.show(tabId);
}
});
my manifest
{
"name": "Compra Protegida",
"version": "1.6",
"description": "Alerta usuários ao acessar sites de compras virtuais não recomendado pelo Reclame Aqui ou presentes na Lista do Procon. ",
"background" : {
"scripts" : [ "background.js" ]
} ,
"page_action": {
"default_icon": "19.png",
"default_title":"Site não recomendado",
"default_popup":"popup.html"
},
"permissions" : [
"tabs"
],
"icons" : {
"48" : "48.png",
"128" : "128.png"
},
"manifest_version": 2
}
Do you ask how to compare with urlespecifies.com? I modified your background.js to appear only within the specify site like this.
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (tab.url.indexOf('urlespecifies.com') > -1) {
chrome.pageAction.show(tabId);
}
});
Hope it helps.