What is the proper way to localize a static website
UPDATE:
As of March 2012, 99translations has been discontinued. Another similar service I've found is www.getlocalization.com/
ORIGINAL MESSAGE:
You could use something like 99translations.com. Open a project there and ask your community to help with translation. For example this is how the guys at smartgwt did it
Simplest way to create multiple-language one-page website
I'm not sure if this is efficient but since you have very little text, This will work.
// Maintain a supported Language List
var langList = ['en', 'zh'];
// Get browser Language
var userLang = navigator.language || navigator.userLanguage;
// extract Language (en-US => en)
userLang = userLang.substring(0, 2);
// Call the function to set language
changeLang(userLang);
// function to change language
function changeLang(lang) {
langList.forEach((langEle) => {
// if language matches, display
if (langEle == lang) {
var langElems = document.querySelectorAll('.' + langEle)
langElems.forEach((elem) => {
elem.style.display = "block"
})
}
// hide the language text
else {
hideLang(langEle)
}
})
}
// function to hide language
function hideLang(lang) {
var langElems = document.querySelectorAll('.' + lang)
langElems.forEach((elem) => {
elem.style.display = "none"
})
}
<h1><span lang="en" class="en">Hello</span> <span lang="zh" class="zh">你好</span></h1>
<button onclick="changeLang('en')">English</button><button onclick="changeLang('zh')">Chinese</button>
PHP Simple HTML DOM Parser Returns Nothing On a Specific Website
You'll never get any price content from this web-page since it is loaded with JavaScript. If you want to achieve this, you'll need to use another scraping tool.
Your first reflex when you use SimpleHTMLDom is to echo the HTML you parse to see what the library is able to read ! Even the word تومان isn't read in this case !
echo $html = file_get_html('https://meghdadit.com/product/75293/');
How to see an HTML page on Github as a normal rendered HTML page to see preview in browser, without downloading?
The most comfortable way to preview HTML files on GitHub is to go to https://htmlpreview.github.io/ or just prepend it to the original URL, i.e.: https://htmlpreview.github.io/?https://github.com/bartaz/impress.js/blob/master/index.html
How would I show an HTML page in Eclipse at Design Time?
- menu: window / show view / other ...
- enter browser in the search box on top
- select internal web browser
i would recommend you to install the web development tools
- menu: help / install new software
- select the software site for your eclipse installation (in my case it's "Helios - http://download.eclipse.org/releases/helios")
- enter "web" in the search bar (and wait a little bit) and select "Eclipse Web Developer Toos" and "Web Page Edtior (Optional)"
Related Topics
Fade Background Image in and Out with Jquery
JavaScript - .Innerhtml Changes Auto Close Tags
How to Keep the Menu State on Page Reload
How to Reorder Divs Using Flex Box
Reformat String Containing Date with JavaScript
How to Develop Desktop Apps Using HTML/Css/Javascript
Jquery - Sticky Header That Shrinks When Scrolling Down
How to Debug Jquery Ajax Calls
How to Append a Div Inside an Svg Element
Change Form Values After Submit Button Pressed
Shrink Div to Text That's Wrapped to Its Max-Width
How to Apply CSS to the Elements Within an Iframe
Understanding Cross-Domain Issue in Iframes
How to Open a Url in a New Tab Using JavaScript or Jquery
Obtain Form Input Fields Using Jquery
How to Pass a JavaScript Variable to Another Browser Window