internationalization

How to change culture to a DateTimepicker or calendar control in .Net

…衆ロ難τιáo~ 提交于 2019-12-17 15:58:08
问题 How to set internationalization to a DateTimepicker or Calendar WinForm control in .Net when the desire culture is different to the one installed in the PC? 回答1: It doesn't seem to be possible to change the culture. See this KB article. 回答2: Based on previous solution, I think the better is: dateTimePicker.Format = DateTimePickerFormat.Custom; dateTimePicker.CustomFormat = Application.CurrentCulture.DateTimeFormat.ShortDatePattern; 回答3: System.Threading.Thread.CurrentThread.CurrentCulture =

Angular 5 internationalization

爱⌒轻易说出口 提交于 2019-12-17 15:29:58
问题 I'm building an application using the latest Angular5 and what I need is for a user to be able to switch languages. I've never had to implement this in an Angular2+ (actually I'm using Angular5). I need to set translations in two places: Component's template html - change labels to the specified language In code in the component.ts file - I may need to translate some strings that are built dynamically under particular conditions in the code I was looking at ngx-translation and it looks to do

How can I tell if a string contains multibyte characters in Javascript?

一曲冷凌霜 提交于 2019-12-17 15:28:11
问题 Is it possible in Javascript to detect if a string contains multibyte characters? If so, is it possible to tell which ones? The problem I'm running into is this (apologies if the Unicode char doesn't show up right for you) s = "𝌆"; alert(s.length); // '2' alert(s.charAt(0)); // '��' alert(s.charAt(1)); // '��' Edit for a bit of clarity here (I hope) . As I understand it now , all strings in Javascript are represented as a series of UTF-16 code points, which means that regular characters

Database modeling for international and multilingual purposes

牧云@^-^@ 提交于 2019-12-17 15:03:40
问题 I need to create a large scale DB Model for a web application that will be multilingual. One doubt that I've every time I think on how to do it is how I can resolve having multiple translations for a field. A case example. The table for language levels, that administrators can edit from the backend, can have multiple items like: basic, advance, fluent, mattern... In the near future probably it will be one more type. The admin goes to the backend and add a new level, it will sort it in the

Writing UTF8 text to file

◇◆丶佛笑我妖孽 提交于 2019-12-17 14:54:58
问题 I am using the following function to save text to a file (on IE-8 w/ActiveX). function saveFile(strFullPath, strContent) { var fso = new ActiveXObject( "Scripting.FileSystemObject" ); var flOutput = fso.CreateTextFile( strFullPath, true ); //true for overwrite flOutput.Write( strContent ); flOutput.Close(); } The code works fine if the text is fully Latin-9 but when the text contains even a single UTF-8 encoded character, the write fails. The ActiveX FileSystemObject does not support UTF-8,

How to specify your webpage's language so Google Chrome doesn't offer to translate it

青春壹個敷衍的年華 提交于 2019-12-17 10:31:31
问题 I have a page that Google Chrome insists on thinking is in French. Here's a snapshot of it: http://yootles.com/outbox/overcleverchrome.html Note that I'm including a meta http-equiv tag to tell it that it's in fact in English: <meta http-equiv="Content-language" content="en"> But it doesn't help. Is there anything else I can do to prevent this? 回答1: Google Chrome currently requires several tags to make an (HTML5) document opt out of translation. Before doing this, you should be sure that you

Best practice javascript and multilanguage

╄→尐↘猪︶ㄣ 提交于 2019-12-17 10:22:29
问题 what is the best practice for multilanguage website using DOM Manipulating with javascript? I build some dynamic parts of the website using javascript. My first thought was using an array with the text strings and the language code as index. Is this a good idea? 回答1: When I've built multi-lingual sites before (not very large ones, so this might not scale too well), I keep a series of "language" files: lang.en.js lang.it.js lang.fr.js Each of the files declares an object which is basically

JavaScript validation issue with international characters

风流意气都作罢 提交于 2019-12-17 10:16:11
问题 We use the excellent validator plugin for jQuery here on Stack Overflow to do client-side validation of input before it is submitted to the server. It generally works well, however, this one has us scratching our heads. The following validator method is used on the ask/answer form for the user name field (note that you must be logged out to see this field on the live site; it's on every /question page and the /ask page) $.validator.addMethod("validUserName", function(value, element) { return

set language within a django view

寵の児 提交于 2019-12-17 10:15:52
问题 background: The view is called when a payment service pings back a payment outcome behind the scenes - afterwhich I need to send an email in the right language to confirm payment and so on. I can get the language code back in the request from the payment server and would like to use that along with Django's i18n systems to determine which language to send my email out in. So I need to set the language of my django app from within a view. And then do my template rendering and emailing all in

Unicode characters in servlet application are shown as question marks

喜你入骨 提交于 2019-12-17 10:03:47
问题 Recently I have implemented internationalization based on How to internationalize a Java web application?. But now I am facing a problem in some of the pages. If it is English language, it is showing well, but if we choose any other language then all the values in that page are showing as ????????? . I have checked for exceptions in server logs, but I couldn't find anyone. How is this caused and how can I solve it? 回答1: Seeing ?????? instead of intelligible characters (and even instead of