Setting locale error with i18n in converse.js - javascript

i have built the converse.js files according to the steps in option 3 in this link: https://conversejs.org/docs/html/quickstart.html
Then i had the JavaScript and CSS files in Dist directory. I saved the dist directory in my webpage root directory.
Then i added the JavaScript and CSS filed to the head section of the index page. I also initialized the converse.js in the bottom section of the index page. Everything worked perfect with this integration.
I also changed the locale to different languages which can be found in '/dist/locale' directory. I am able to change the
locale to all the 39 languages except one: 'ug'. This is a new language which i have translated recently.
When i set i18n to 'ug', the converse.js is in English which is failure in the setting. Then i looked at
the browser console to see if there is any errors. I found the following errors for the issue:
FATAL: Cannot find module './ug.js' log.js:68:19
log log.js:68
fatal log.js:93
initialize index.js:121
initialize core.js:574
initialize converse.js:53
initialize entry.js:31
<anonymous> index.html:57
can anybody knows how to solve the issue? Thanks
I expect to see the converse.js in Uyghur lanugage.

Related

Jekyll Converters::Scss build issue: No such file or directory # dir_chdir - /github/workspace/docs

I keep getting this error when I try to publish a site to GitHub pages.
Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/css/style.scss':
19
No such file or directory # dir_chdir - /github/workspace/docs
When I try to change the folder to root, it publishes the readme.md file. When I change it to doc, I get this error.
The file runs fine locally. I don't know what the problem is. I searched online but did not find a solution that helps. Any help works.
The error is on my main branch when I try to publish it.
Links to the repo and the error on GitHub:
https://github.com/Rsmdo/dadport2
https://github.com/Rsmdo/dadport2/tree/main
I tried making a new repo but this did not solve the issue, also I went through the code to see if there were any parsing errors but there were none.
https://talk.jekyllrb.com/t/cannot-deploy-site-via-github/6883/11 says that "Jekyll can’t find the files the theme uses". The page also suggests using root instead of docs or any folder.
There are options to set the directory where Jekyll writes files to and reads file from, for example: bundle exec jekyll s -s /docs, which leads to errors in my case due to the non-existing path based on the root path (the path can also be relative I guess).
See Source: /docs, the other path do not show the docs path though.
PS C:\Users\User\usr.github.io> bundle exec jekyll s -s /docs
Configuration file: none
Source: /docs
Destination: C:/Users/User/usr.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Error reading file C:/Users/User/usr.github.io/_layouts/archive.html: No such file or directory # rb_sysopen - C:/docs/Users/User/usr.github.io/_layouts/archive.html
This may help:
https://jekyll.one/pages/public/manuals/jekyll/user_guide/configuration/
https://github.com/burtlo/jekyll-core/blob/master/site/docs/configuration.md

Recommended PhpStorm configuration for Shopware?

I have noticed the JavaScript classes not resolving when typing the following in a Shopware JavaScript plugin:
This got me thinking. Is there any way to solve this not resolving? Are there any other configuration recommendations for Shopware development in PhpStorm? I've already seen some in the Shopware Academy backend course and the documentation, but might there be more?
Updated answer, quick solution
In your project directory tree find src/Storefront/Resources/app/storefront, right click the folder, Mark directory as, Resource Root. This should make the aliased modules resolved.
Older answer, possible permanent fix
Theoretically PhpStorm should be able to resolve the aliases defined in src/Storefront/Resources/app/storefront/webpack.config.js.
However it fails analyzing that file:
Webpack
Can't analyze webpack.config.js: coding assistance will ignore module resolution rules in this file.
Possible reasons: this file is not a valid webpack configuration file or its format is not currently supported by the IDE.
Error details: Definition file does not exists
I found the reason is line 465 of src/Storefront/Resources/app/storefront/webpack.config.js:
const injector = new WebpackPluginInjector('var/plugins.json', webpackConfig, 'storefront');
Replacing that line with the following line made the modules using the aliases resolvable:
const injector = new WebpackPluginInjector(path.resolve(projectRootPath, 'var/plugins.json'), webpackConfig, 'storefront');
If you're using the development template and the Shopware mono-repo is located in the platform diretory this change will make Webpack look for platform/var/plugins.json instead. So either copy or symlink var/plugins.json to that location.
This is obviously just a temporary workaround and needs to properly be fixed eventually.
As a side note: The separate webpack.config.js for the administration also fails to be analyzed by PhpStorm as of now. So this won't fix non-resolvable aliases for PhpStorm in the administration.

Why is CodeMirror failing with the examples that are part of the downloaded zip file?

I am new to CodeMirror and having difficulty getting it to work -- I am specifically looking to get it to work with Groovy.
The following are the steps I have taken:
Downloaded CodeMirror-master.zip
Unzipped it.
Attempted to open "CodeMirror-master/mode/groovy/index.html"
When I open that file, the Groovy code in that file is not formatted. That file references "lib/codemirror.js". The file structure in the zip file does not contain "codemirror.js" in the "lib" directory. However, it does contain "codemirror.js" in the "src" directory. So, I copied everything from the "src" directory to the "lib" directory and it still doesn't display the formatted code from the example. When I open the Chrome browser developer tools it shows 4 errors, but I am so new to this type of development that I don't know what to do. I don't understand why "CodeMirror is not defined" is being thrown -- I assumed that the example code from CodeMirror would work...
The errors I see are as follows:
Uncaught SyntaxError: Cannot use import statement outside a module (codemirror.js)
Uncaught ReferenceError: CodeMirror is not defined
at matchbrackets.js:10:9
at matchbrackets.js:11:3
Uncaught ReferenceError: CodeMirror is not defined
at groovy.js:10:9
at groovy.js:11:3
Uncaught ReferenceError: CodeMirror is not defined
at index.html:76:20
What took me down the path of trying out the examples was that I was unable to get it running with my own code after trying to follow the instructions and I have been banging my head against this for too long.
Any help would be greatly appreciated.
After banging my head against for too long, I have finally found the answer:
the zip file that is currently being distributed is faulty (ie files are not where they are supposed to be and other files are missing).
I had to use the instructions for downloading it via NPM (ie npm install codemirror), then copy that directory structure to my project.

Error with JavaScript enabled tests (Bootstrap 3, Rails 4, Travis CI)

I have strange error that appears only in CI environment. This error does not appear in develpment, production or even local test environments.
ActionController::RoutingError: No route matches [GET] "/fonts/bootstrap/glyphicons-halflings-regular.svg"
Full trace can be found here
In development and production enviroments successfull reqest goes to /assets/bootstrap/glyphicons-halflings-regular.woff. There is a difference in /fonts/ - /assets and svg - woff part. All errors generated by JavaScript enabled tests (Poltergeist / PhantomJS driver). Regular Capybara tests are all green. Chrome devtools says that request for font file is generated by jquery.js, not the page or css file.
This is related to the bootstrap-sass gem. I'm using version 3.3.4.1 of it with Rails 4.2.
My presenting issue was very similar but slightly different: the same error in CI with 404 for /fonts/bootstrap/glyphicons-halflings-regular.woff but a different path in dev, /fonts/glyphicons....
The solution that worked for me was adding the following line before including the bootstrap JS with SASS:
$icon-font-path: "bootstrap/";
#import 'bootstrap';
My best clue came from the comments on this issue in the gem's tracker:
https://github.com/twbs/bootstrap-sass/issues/480#issuecomment-49237119
If you have similar setup to us, you installed Bootstrap manually on Rails and had to do some manual CSS style overrides to point the Glyphicon fonts to the right path. (/assets/botostrap... instead of /fonts/bootstrap...). However the original styles are still present in bootstrap.css, and even though they're overridden, it appears that somehow PhantomJS is still detecting and making use of those originals.
In our case, we had to search for all references to glyphicons-halflings in bootstrap.css and change the path to the correct one. After we do so, the routing errors disappear.
Good luck!

Stop Webstorm of Displaying Error on hbs! Plugin for require.js

There are two files in my project:
index.js where the following code is
define([ 'exports', 'hbs!./general'], function (exports, generalTemplate) {
});
general.handlebars which is correctly taken by require.js and the hbs! plug-in.
I'm basically using Require.js with Handlebars.js and the https://github.com/SlexAxton/require-handlebars-plugin for automating the creation of templates from files.
It works correctly, but Webstorm 8 (and also 7 before it) doesn't understand the file is correct so it always complains with: Cannot resolve file 'general'. It is the same with every file using that plugin prefix.
I coudln't find where (if it exists) to turn that notification off, because it underlines the entire file, and its parent directories as having errors.
How can I remove this error of being reported?
This notification can't be turned off unfortunately - annotator-level inspections can't be suppressed.
The issue with relative paths resolving when loading plugins for non-js extensions is tracked as WEB-1167, please vote

Categories

Resources