No translation key or locale provided. Skipping translation... sveltekit-i18n - javascript

I have a problem with the translation using sveltekit-i18n.
I tried to install and use the library for 3 time but I always had this problem.
No translation key or locale provided. Skipping translation...
I also followed the example that I found in the docs (multi-page) but the translation didn't work.
Could you please help me?
I attach the link of my repo. It's a little project that I just started. You can find the file in translation.js following the path src/lib/translation and the test in the file +about.svelte following the path src/routes/about.
Can somebody help me please?
I really don't want know how I can fix it. I did several research, but I couldn't find anything.
Thank you

Related

Clarifai-node-js api import error while using it reactjs

and
Hi. I attach 2 pictures. There I am having an issue while importing Clarifai-nodejs-grpc.
Please check these pictures and help me with this.
Thank you so much
It seems like this issue has been reported here already: https://github.com/Clarifai/clarifai-nodejs-grpc/issues/25
While I get someone to take on look on Clarifai's end, please use simple REST calls: https://docs.clarifai.com/api-guide/data/create-get-update-delete (see "Javascript (REST) snippet")

Image4io and NodeJS: Documentation is clearly outdated. How do I upload an image?

I guess this is as much a call to attention on the fact that the documentation seems to be outright incorrect in its application, as well as just generally lacking. Normally, I would send that part of the message to them personally, but, their contact form is also giving me errors and not sending, so it's not like I have the means to anyway. In the mean time, I'm more worried about getting this code to work, so hopefully someone experienced with this SDK or an Image4io team member sees this and can provide a public answer for others stumbling into this road block.
For starters, I initialized the Image4io object as described in the github here: https://github.com/Image4IO/image4ionodeSDK/
website documentation: https://image4.io/en/documentation/api-sdk/#operation/UploadImage
The image upload example provided on the website's documentation looks like this:
let client=new Image4ioAPI.Image4ioAPI(apiKey,apiSecret);
var request = new Models.UploadImagesRequest("/folderName", true, true);
request.Add("/path/to/image/location/name-of-the-image.jpg", "name-of-the-image", "name-of-the-image.jpg");
let response=client.UploadImage(request);
3 out of the very sparse 4 lines of code they provide give errors. Where did this Models object come from? There is no corresponding class in the import and the code example obviously doesn't show where it was defined. Just what is it and where did it come from?
Well, I found a matching function "UploadImagesRequest" in the original import class, so my guess is Models was deprecated and its functionality was moved into the Image4io class object. If that was the case the solution would be to simply access that function instead... But it's not used the same. It has 4 arguments, the 4th being a "Image4io.UploadFile[]" type. This type has no use examples in the documentation or further details describing what it is exactly. I assume image byte data goes in there somehow, but how?
Finally we have request.Add... except we don't because that isn't a function :( it looks like this was used to actually get the image data (maybe of the type UploadFile?) based on the path of the image. If this function is gone now, how do get file data for use in the upload request function?
Any and all help in figuring out this SDK would be greatly appreciated. Google searches yielded no meaningful results, so hopefully we can help in that department as well. For all I know I just got the wrong version somehow. I guess I could try downgrading to a version that matches the documentation but... that's not a fix in my eyes at all.
Let me know if there's any more info I could provide to help
You can upload image like this:
var client=new Image4ioClient(API_KEY,API_SECRET);
var files=Array();
files.push(new UploadFile("./test.jpg","test.jpg"));
client.UploadImage(new UploadImagesRequest("/",true,false,files))
.then(res=>console.log(res))
If you have binary data at hand, you can write it to a temporary file and then upload them.

Requiring a .js file in Windows

I'm just starting to pick up javascript and casperjs for a project that I'm doing. I'm trying to create a project that uses babyparse in it.
Currently I have babyparse.js located at C:\js\babyparse.js.
I'm having trouble including babyparse, and I've tried a couple different ways of doing it.
1) eval('C:\js\babyparse.js') - I come up with a syntax error "Invalid Character \u0008". I found this on StackOverflow, but I was unable to find the unicode character in babyparase.js.
2) require('C:\js\babyparse.js') - this just doesn't even find the right path in windows. I'm assuming that's because of the backslash pathing of windows as opposed to the regular unix forwardslash.
3) require('C:\\js\\babyparse.js') - this gets the correct path in windows, but I get the error that CasperJS couldn't find the module C:\js\babyparse.js
I feel like I've looked a lot through stackoverflow, but maybe I'm just missing something obvious. Thanks in advance for the help!
Currently I have babyparse.js located in C:\js\babyparse
require('C:\js\babyparse.js')
You've got the path wrong it seems. The correct path would be
require('C:\\js\\babyparse\\babyparse.js')
Beware that babyparse is a node.js module. It may use some of node.js native modules wich are not present in PhantomJS javascript interpreter in which case your script will break.
If you want to use csv parsing while scraping, it's definitely better to use PapaParse which is specifically designed as general-flavour javascript without dependencies, "not even jQuery".
I managed to solve the problem!
The following snippet worked for me:
var fs = require('fs');
eval(fs.read('papaparse.js'));

jsdoc issue: Full path to source file is displayed (unwantedly)

I'm using jsdoc3 for my project and everything compiles nicely.
But this I've been fiddling with for the last 2 days and I give up :(
When using the most basic call from MacOsX Terminal to run jsdoc I ALWAYS get the full path of my source file within the generated documentation.
Example:
./jsdoc ../projectname/js/jsfile.js
In the generated index file I can see a h1 with "index" and below it a h2 with the full path to the js file:
/Users/username/projects/path/projectname/js/jsfile.js
I don't like that it shows my complete local path...
After reading up I thought it would be relative to where I run jsdoc from.
But all this has the same exact result:
cd /Users/username/projects/path/projectname
../jsdoc-master/jsdoc js/jsfile.js
as well as
cd /Users/username/projects/path/projectname/js
../../jsdoc-master/jsdoc jsfile.js
The problem is, that this path is also used with the line number references and on the sourcecode page. And it's really not nice that my internal path is displayed...
The output I would want is projectname/js/jsfile.js or at least just jsfile.js, but I can not for the life of me get this to work.
I hope someone can tell me what I'm doing wrong.
regards,
Jan
#Louis helped me figure out it was a problem with the alpha version.
3.2.2 did not export the full path to the docs.
Unfortunately it had other problems, like the lacking of support for unordered lists.
So I decided to stick with 3.3.0 and make a shell script correcting the wrong output of jsdoc afterwards.
Contents of the shell file:
./jsdoc-master/jsdoc ./projectname/js/jsfile.js
ABSPATH=$(cd "$(dirname "$0")"; pwd)
perl -pi -e "s?$ABSPATH/projectname/js/??g" ./out/*.html
So this basically deletes the full path from the generated html files.
It's a bit dirty, but it works...
regards,
Jan

Google closure depswriter.py --root_with_prefix, what is prefix and root for?

I went through sample in https://developers.google.com/closure/library/docs/depswriter
and many readins on another related question in
depswriter.py complains 'The command line is too long'
After housr of googling, and meddling with sample code from google web, I still do not understand what the --root_with_prefix is for.
$ closure-library/closure/bin/build/depswriter.py --root_with_prefix="myproject ../../myproject" > myproject-deps.js
why must myproject be specified as prefix, and ../../myproject as root?
I can only guess a relationship between base.js and the dependencies file is specified as ../../myproject. I cant understand the relationship between prefix and the rest. Appreciate any help, and sorry for being obtuse if this is so obvious for some. I did google for explanation but failed to find any explanation that I can understand.

Categories

Resources