jqGrid Language Detection - javascript

I am working on JqGrid and came across an issue related language. I need to support both English & French.
I added English and French locale file into the scripts folder and referred the files in the html file.But the jqGrid is not detecting the browser language automatically and display the last loaded language always.
Is there a better solution for this issue? Ideally, jqGrid should have capability to detect the language and load the locale file automatically. Couldnt find a solution anywhere.
Your help is highly appreciated. Thank you.

Related

Force localizaition in SharePoint Framework (spfx)

I have a question regarding localization in SharePoint Framework. I have a simple webpart, which should change language not matter of the SharePoint settings. For example SP sites are full in English, but the user has to have a change to switch the language to Spanish or German. The question is how can I do it easily?
I have a webpart context which has localization property which are passed and normally, I suppose they are used to load the correct language, right?
So can I somehow programmatically change it? Or is there a another correct or better way?
Thanks in advance.

How To Play .any custom video file such as asf ,ts,mov etc in html pages using javascript/jquery?

Please give me the steps to do that.
If any external plugins are required please state it in the answer.
It would be glad if you can give detail explanation as I am just beginner in embedding video files in html pages and want to know more about it.
It’s not possible. Some formats can be transmuxed to a fragmented mp4 container on the fly via JavaScript. However they would still need to be the correct codecs. A “detailed explanation” would be longer that the answer field allows.
If you need a detailed explanation, I recommend the book “video demystified”
FYI. Please read https://stackoverflow.com/help/how-to-ask

How to validate html page and fix it with javascript

I recently ran into the problem related to html document validation. It seems to me that Chrome is pretty clever and can fix most of the mistakes.
In my case I receive raw html file with mistakes and I need to load it on Sumsung TV powered by Tizen 2.4. Unfortunately it doesn't provide the same features as Chrome so I need to fix documents by myself.
What do you think about html validation with help of javascript (My app is written in js).
Download html page and save it
1.2. Download all the related files (css,js,images) and fix links
fix all the problems (use some library, or may be there are some
good validators, but it is better to do offline)
Open document
You can use a linter; a quick search on Github showed up some JavaScript-powered HTML-linters:
htmllint: for HTML5
Bootling: for Bootstrap

Multi language on static website with i18next client side

I made a website with HTML, CSS and Javascript without using a CMS, so it's all kind of static. I've been asked to make this project into a multi language website (the current language and English). Now I am looking for a good way to implement all the translations.
I've seen a simple solution with i18next using client-side Javascript, but I'm wondering if this isn't harmful for SEO (the url doesn't change when selecting another language) and if there is a better solution for this.
https://github.com/dwkns/i18next-translation-tutorial
Hidden content may not be read by the search engines. It's better to have two versions of entire site in subfolders.
If you really want to do it with javascript, try to put both content visible in html (users with no javascript should see both) and then with javascript hide one of them after page loading. But i suggest the first approach, it's more realiable.
source about google do this: https://www.freshegg.co.uk/blog/technical-seo/google/how-does-google-treat-hidden-content
No issue with that. Google and other search engines run javascript as user browsers. Just add some links so google could discover the pages in other language (not only have autodetection)
The only drawback you have currently are routes are not translated but that could be solved, eg. https://github.com/i18next/i18next-express-middleware#add-localized-routes

How can i change the language of my Html5 hybrid application using java script and jQuery?

In my application i have a option of language selection.
When I select an option, the entire application language should be changed.
I have already tried using Google and Microsoft api but guess that is paid. Is there any free api using javascript that can help me regarding this problem.
This post might be what you are looking for. They are talking about:
A wordpress, change language plugin widget.
A jQuery handler to change language by directing to another url.
Have a nice day!
Two options:
#1
Have a look here. Click "Options" top right and select another langauges. Open a datebox plugin widget and it will be in the language you specified.
I like the way it's done using Crowdin, although you will end up with all your text in .js files. If you check out one of the languages sample files this will be a lot of meat to load if your site becomes more complex.
#2
Do this server side. I'm (using Coldfusion) loading a langauge object on first page load and cache this until the user selects a new language. My langauge object is about 60k with 2000 entries. You could also send this to the page from server via json and store it in the page, then you could reference it from Jquery/Javascript.
I will probably end up trying to switch from server side to using the first approach and will try to see if I can split up my language .js files according to JQM page and then load them together with require, which would mean only a few ks per page. If you don't mind having a bunch of langauge files for each language and page, this would probably be the best "Mobile" approach.

Categories