How to translate html page using the plugin i18next? - i18next

i see example page How to use i18next? Problems with translations
but after this code, i have in console error: Uncaught ReferenceError: i18n is not defined
WHY??? Where can I download i18next.js to convert html page?

From the official site:
there are two possibilities: to install it with npm from repository, or
https://github.com/i18next/i18next/blob/master/i18next.min.js

In version 2.x of the library, i18n has been replaced by i18next and the API has changed considerably.

Related

Nuxt.js Failed to construct 'URL': Invalid URL - UUID

I have a problem with the nuxt.js pages named _id.vue and the url use uuid. When I try to access the URL I got this error. How to resolve this?
I find the solution for this problem
Upgrade version Nuxt.js to version 2.14 from 2.10

How to run ui testing?

I get an error when I start testing the application:
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
...
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
/home/mmvs/Desktop/ReactNative/node_modules/react-navigation/src/index.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export * from '#react-navigation/core';
How to solve this error?
You need to add moduleNameMapper in package.json
look at this link : https://jestjs.io/docs/en/webpack#handling-static-assets

How to fix relative module error for a newly created nuxt.js app with starter template?

I tried to create a nuxt app with the guide from the official website, chose default options because I wanted the starter template but on running npm run dev, I keep encountering the error:
This relative module was not found:
* ./components/nuxt-error.vue in ./.nuxt/index.js
I've tried searching about it but I couldn't find any useful resource/fix. I've also tried vue init nuxt-community/starter-template for the installation but I still get the same error.
Any fixes?
So I found a solution. I couldn’t figure out the error because the nuxt-error.vue file was actually imported correctly. Turns out “npm” installations have been giving me issues (had issues with TailwindCSS too).
So if you ever encounter this error on loading the base nuxt app, recreate the project using “yarn” instead. Works like magic!
This Error basically means, that in one of your files you are trying to import another file with the relative path of ./components/nuxt-error.vue but no file with this path exists.
However
I just read that vue init nuxt-community/starter-template is deprecated and no longer maintained. Instead of fixing this Error you should restart your project with npx create-nuxt-app <yourAppName>. https://github.com/nuxt-community/starter-template

Unable to load video.js into Aurelia module using 'import'

I'm working with Video.js, and am running into a problem when attempting to load the module using a standard ES6 import.
I installed video.js using:
npm install --save video.js.
I'm importing into my
video-player.js file using:
import videojs from 'video.js';
I'm getting the following error when attempting to load the page:
GET http://localhost:9001/dist/video.js.js 404 (Not Found)
Any idea why I'm seeing the .js.js extension, and why this is not working? This is the procedure recommended in the Video.js docs.
Aurelia automatically adds the .js extension so you can remove that. Also, make sure you have correctly added video.js as a dependency to aurelia.json. Is the location correct in /dist?

Rails with Jader gets 'failed to require "fs"' error

I am trying to use client side Jade templates that are precompiled by Ruby on Rails and available through JST.
I added the jader gem
gem "jader", "~> 0.0.8"
In configuration/initializers I created an initializer called jader.rb that contains:
Jader.configure do |config|
config.views_path = Rails.root.join('app','assets','javascripts','views')
config.mixins_path = Rails.root.join('app','assets','javascripts','mixins')
end
In app/assets/javascripts/views I added an index.js.jst.jade file
Hello World!
Lastly in my javascript file I have:
$('#app-content').append(JST["views/index"]());
When I run Rails and browse to the page triggering the code I am getting the following error:
failed to require "fs"
(in /my-project/app/assets/javascripts/views/index.js.jst.jade)
I understand that the problem is that jade is a node.js project and the require function is having a problem. How do I fix the require error?
If you are looking at using Jade templates only on the client side (with Rails asset pipeline), I recommend https://github.com/inossidabile/jade
It's likely there is an error in your index.jade template.
From the jade rails-fix pull request here, ExecJS used by rails does not support require("fs") and will throw 'failed to require "fs" even if it's a template error. Hopefully this should point you in the right direction.
To debug, you can replace the content of index.jade template with with a 1-liner jade placeholder to see if it renders well. Alternatively, try it out rendering the index.jade template with a nodejs server if possible to be sure the template renders without any whinning.