Why is the file upload ignoreing the language setting? - html

I have an English and German site, where the user can switch from English to German. When the user switches the site, the content is translated, the language information is set (lang="en", lang="de") but file upload (<input type="file">) is in German. Is there a way to translate it without customizing the file upload?
Example (egnlish):
<html lang="en" xml:lang="en">
<head>
<title>Internationalisation test</title>
</head>
<body>
<form>
<input type="file" name="test">
</form>
</body>
</html>
Example (german):
<html lang="de" xml:lang="de">
<head>
<title>Internationalisation test</title>
</head>
<body>
<form>
<input type="file" name="test">
</form>
</body>
</html>

The file input button's caption is not in German per se, but in web browser's language. Should you use a web browser with different language pack or install it on different OS language, the language would be different.
Is there any way to fix this?
Yes and no.
I'll start with no. If you want to stick to standard HTML control <input type="file"> there is no way to translate the caption.
What you can do though, is to replace the control with non-standard one (usually people tend to use flash-based file upload controls), or... The other way is to actually hide the control (setting z-axis) and put your own text box and a button over it.
That's basically it.

Related

input type tag missing in browser when tested through wordpress

I've started coding html in wordpress. I have a html code with label tag and an input tag of type "text". The input field is not getting displayed in browser. The same code works fine in eclipse. What might be the problem. When I save the post as draft the tag disappears. Not able to solve the issue. Kindly help me in this regard.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Hello testing</title>
</head>
<body>
<div> <label> Name:</label> <input type="text"> </div>
</body>
</html>
Above image is the code run through eclipse
Above one is the image run through wordpress preview
when writing html in the Wordpress editor, you can only use tags that are allowed by Wordpress. Dont think the input tag is one if them.
Look at this:
https://en.support.wordpress.com/code/#html-tags
The "input" tag is not supported by WordPress editor.

How I Override Body Tag In Ctrl+Shift+I Inspector

I have some Html code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ControlShiftI Example</title>
</head>
<body>
Enter UserName <input type="text" name="user"><br>
Enter Password <input type="password" class="password-input" name="pass">
</body>
</html>
that I am running on browser after ctrl+shift+i in inspecor I want to override some other code in complete body tag.
in above after I dont want to see this body tag code some override code i want see.
is this possible?
This is not possible.
Hide Javascript
If your concern is having a tidier HTML because Javascript code takes too much space, just <script src="externalFile.js"></script>
If your concern is you want to hide your code, because you don't want others to read it and understand it, you could minify and obfuscate the code, for example with UglifyJS. However the inspector can undo the minification by prettifying the code. Obfuscation however cannot be totally undone depending on techniques used.
Hide HTML
If this question is not about javascript and you want to reduce the number of html lines:
<object data="externalHTMLFile.html"></object>
or
<iframe src="externalHTMLFile.html"></iframe>
There are also other ways.
But you cannot simply hide some html from the inspector or remove the ability from the user to open the external HTML file and read all the HTML.

Eclipse HTML: placeholder is not an attribute?

I am using the latest version of Eclipse Luna (for Java EE developers), and when I insert an <input type='text' placeholder='test123', eclipse says "Undefined attribute name (placeholder).".
Why is it like that? Have I done something wrong? Is there a way of fixing this?
Add the <!DOCTYPE html> indicating that its HTML5, placeholder is a new element in HTML5 and doesn't exists on HTML4 or early versions
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form>
<input placeholder="aspdkpoas"/>
</form>
</body>
</html>
Eclipse checks for html tags and attributes against the doctype. Make sure that you have given doctype on top. It will fix the problem.
Also, Eclipse uses IE internally. You can configure it to firefox/chrome for better tags and attribute comparison.
Refer to this How can I change eclipse's Internal Browser from IE to Firefox on Windows XP? for changing your browser.

How can I show following text in html textarea?

I have a String like the following. Please take a look:
I put it as a image, this is not displaying in here too. If I put that String here it becomes the following:
21154537878887GHE\u0044\u0045
Now my question: is there any way to put the original String into an HTML <textarea> without changing the encoding?
I think you must define your char set in the head.
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="denis kohl">
<!-- Date: 2014-09-04 -->
</head>
<body>
Try adding the attribute accept-charset="UTF-8" to the HTML form element that contains the textarea. Then parse the encoded value via JavaScript. For example:
HTML:
<form accept-charset="UTF-8">
<textarea id="textBox"></textarea>
</form>
JavaScript:
document.getElementById("textBox").value = "21154537878887GHE\u0044\u0045";
<textarea name="Input" cols="36" rows="5" wrap="virtual">
Could you try to define the wrap method, you can choose:
wrap: off, virtual, hard, physical, soft
The Textarea formatting looks nothing like they originally intended. Typically, all the Textarea text will squashed into a single paragraph with none of the original line breaks or spacing in evidence.
The reason for this is that the CGI program (to handle the text in the textbox) has to specify a MIME Type when they are preparing the email or other document and many of these programs elect to use a MIME Type of "text/html" so that they can use HTML formatting to make the email or document more presentable. The problem with this approach is that the contents of an HTML Textarea input box require the use of a MIME Type "text/plain" otherwise the Textarea formatting will not display properly in the final output.
<meta http-equiv="Content-Type" content="text/plain; charset=utf-8">
Knowing the above I hope this will help you to find the solution.
Do this:
<textarea>211&#001c;545&#001c;378887GHE\u0044\u0045</textarea>
Note that what happens when this is rendered is that all the characters that can be displayed in the chosen (in css) font are displayed normally, while most browsers fall back to the Unicode BMP Fallback Font (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=UnicodeBMPFallbackFont) which simply fills in the gaps in whatever font you might be using. The exact result will be browser-dependent.

How to fix the font issue in HTML?

I have Html (hello.html) like bellow
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Test</title>
</head>
<body>
<div>
¿Hola cómo está?
</div>
</body>
</html>
It shows out as "¿Hola cómo está?" when run in browser
Is there any solution to get correct out put without altering the
hello.html file?
I hope that, it is in Spanish language but i looking for any other solution like as change the encode type or font in browser or editor.
Edit: Just noticed the requirement. But some Spanish characters require Unicode and you have to declare that in your html file.
Put this in your head.
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
I don't see whats wrong, if you are refering to the font type in the html and the webpage is different is because of your editor, if you really want to change the font you will need to set the font tag around your text or even better define it in the CSS
Based on the clarification in the comment section to your question....
If you are using Google Chrome, and your computer is set to an English locale, load the page, then right click on the body, and select "Translate to English."
Sounds like an interview trick question, rather than a programming one.
No.
You cannot do this without altering the html file.
Place this <meta> tag in your Head Section
<meta charset="UTF-8">