The default locale setting was indicated, however, the _locales directory is absent

Recently, I delved into the world of Chrome extensions and decided to create a basic localization extension. I made sure to include a "Default locale" in my manifest file, even though I already have a "_locales" directory set up.

Here is an excerpt from my manifest:

{
    "name": "__MSG_appTitle__",
    "description": "__MSG_appDesc__",
    "version": "1.0.0",
    "manifest_version": 2,
    "default_locale" : "en",
    "chrome_url_overrides" : {
      "newtab": "newtab.html"
    }
}

A snapshot of my project files and directories (including the _locales folder) can be viewed below:

https://i.sstatic.net/MbjGu.png

Answer №1

It appears that the issue you are experiencing is due to your _locales folder being located within the HelloExtension directory, which is not on the same level as your manifest file. I encountered the same error when I arranged my extension in a similar wayhttps://i.sstatic.net/Er4fT.png

To resolve this issue, you should organize your _locales directory like this, https://i.sstatic.net/MT4yr.png

Note: You can maintain the current structure, but ensure that your _locales folder is at the same level as your manifest.json

Answer №2

Don't miss this - Manifest File

default_locale Indicates the specific subdirectory within _locales that possesses the default strings for this extension. This particular aspect is mandatory in extensions outfitted with a _locales directory, yet it should be omitted in extensions lacking a _locales directory. Refer to Internationalization for more information.

Answer №3

When I removed the line

"default_locale": "en"
from my code, everything started working perfectly:

{
    "name": "__MSG_appTitle__",
    "description": "__MSG_appDesc__",
    "version": "1.0.0",
    "manifest_version": 2,
    "chrome_url_overrides" : {
    "newtab": "newtab.html"
    }
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

ng-bind-html behaving unexpectedly

index.html <div ng-bind-html="htmlElement()"></div> app.js $scope.htmlElement = function(){ var html = '<input type="text" ng-model="myModel" />'; return $sce.trustAsHtml(html); } However, when attempting to retrieve t ...

Retrieve the text that has been chosen and have it displayed with lines

I'm attempting to extract the selected text and format it with line breaks for a VSCODE Extension. const document = editor.document; const selection = editor.selection; const position = editor.selection.end; const word = document.getTe ...

Stopping multiple queries in Node.js can be achieved by using proper error handling

Upon verifying the existence of the name, the program continues to the subsequent query and proceeds with inserting data, which results in an error due to multiple responses being sent. How can I modify it to halt execution after checking if (results.row ...

Issue with Mapping JSON to List of Objects in Flutter results in null value

In my JSON structure, I have data like this: { "message": "", "status": "complete", "results": [ { "id": 66, "user": { "id": 80, ...

Encountered an error when attempting to access the property "addOption" on an undefined object

Every time I try to implement search functionality, I keep running into this error: "cannot read property 'addOption' of undefined in JavaScript selectize." I have confirmed that my result array does contain data. This is my JavaScript code: ...

Navigating through React Native - A guide to accessing the initial navigation state on React Navigation

Is it possible to retrieve the initial state in a similar format as what is provided by the onStateChange prop in NavigationContainer? Unfortunately, onStateChange does not run during the initial render. While I was successful in obtaining the state whil ...

Leveraging Express and Node.js: The Ultimate Approach to Invoking an External API

I'm brand new to working with Express and Node.js. I'm currently attempting to access an external API in order to populate data on a webpage. Is there a more efficient way to make this API call directly from Express itself (I know that the http m ...

What is the method for creating a loop in Angular?

let m = 5; for (let i = 0; i < m; i++) { document.write(i); } What is the output of i in Angular? This code is not functioning as expected. $scope.B = []; angular.forEach([0, 1, 2, 3], function (value, index) { $scope.B.push ...

Traverse through an array of pictures and add the data to a Bootstrap placeholder within HTML markup

In my quest to create a function that populates placeholders in my HTML with images from an array, I am encountering a problem. Instead of assigning each image index to its corresponding placeholder index, the entire array of images is being placed in ever ...

What scenarios call for the utilization of setScriptTimeout?

When using Selenium WebDriver, there is a method called setScriptTimeout(time, unit). The description of this method states that it Specifies the time allowed for an asynchronous script to finish executing before an error is thrown. If the timeout is set ...

Is it a breach of separation of concerns to validate using ng-pattern?

I have a requirement in Singapore to validate contact numbers entered by users. The number must start with 6, 8, or 9 and should have a total of 8 digits. I am currently utilizing ng-pattern on an input field with a regex solution, but I am concerned abo ...

Tips for integrating Server-Side Rendering into an already established React.js app running on Express.js

I am currently working on a React application and I am looking to add SSR using Express.js. Initially, I made a mistake by creating a repository with just a frontend folder containing the entire React app with typescript, babel, and webpack configurations ...

Issue with triggering ReactJS onClick function accurately

For the function to work correctly, I had to add e.preventDefault(). However, my goal is for it to redirect the user to '/' after submitting the form. Below is the function that I am attempting to trigger: onAddPoints = (e) => { e.prevent ...

In MongoDB, learn the process of efficiently updating nested objects in a dynamic manner

We have a variety of nested configurations stored in MongoDB. Initially, we store the following object in MongoDB: const value = { 'a': { 'b': 1 } } collection.insertOne({userId, value}) Now, I would like to modify the object in ...

Is it possible to use ref in React to reference various elements based on specific actions?

I'm having trouble targeting the clicked button using a ref as I always get the second one. Any ideas on how to solve this issue? Also, if I have a native select element with two optgroups, is it possible to determine from which optgroup the selection ...

Utilizing correct Django CSRF validation when making a fetch post request

I've been experimenting with JavaScript's fetch library to perform a form submission on my Django application. Despite my efforts, I keep running into CSRF validation issues. The Ajax documentation suggests specifying a header, which I have atte ...

Why doesn't the 'javascript' named directory have access to my localhost?

My Ubuntu 16.04 system is running Apache 2.4.18. Recently, I created a directory called "javascript" within /var/www/html and added an HTML file to it. However, when attempting to access the file via localhost/javascript/, I received the following error me ...

The Node.js JSON string displays as "[object Object]" in the output

Front End // js / jquery var content = { info : 'this is info', extra : 'more info' } $.ajax({ type: 'POST', url: '/tosave', data: content }); Node // app.js app.post('/tosave', funct ...

Ways to include input values

In my form, there are 4 text boxes labeled as customer_phy_tot, customer_che_tot, and customer_bio_tot. I want to add up the values entered in these 3 boxes and display the sum in a 4th input box called customer_pcb_tot. customer_bio_obt.blur(function(){ ...

Tips for executing a function only once within the animation loop in Three.js

Is there a way to call a function only once when a certain condition is met in Three.js? I am currently sampling the frames per second (FPS) to send it to an external service. The FPS is sampled and averaged over time, and the average value is sent after 1 ...