internationalization

Cannot write chinese characters to a filename

依然范特西╮ 提交于 2020-01-03 09:07:29
问题 public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); String fileName = in.nextLine(); Writer out = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("C:/temp/"+fileName+".txt"), "UTF-8"));//Ex thrown out.close(); } I'm trying to create a writer that can handle chinese characters to the file name. So I can create a file called 你好.txt for example. However I get a FileNotFoundException with the above code, it works perfectly fine for

angular 5 change locale dynamically for i18n

北战南征 提交于 2020-01-03 08:42:15
问题 I am trying to change locale dynamically to change i18n language. I have two files, the one with english values and the other one with french values. What I've tried for now is something like that : ngOnInit() { const localeName = localStorage.getItem('locale') || 'fr'; import(`@angular/common/locales/${localeName}.js`).then(locale => { registerLocaleData(locale.default); }); } but it gave me the following error : error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015

Country codes list - C#

Deadly 提交于 2020-01-03 07:19:34
问题 I have a string which I need to verify if it's a Country code. The culture is German. Is there any method that I can call to get a list of Country codes in a German culture without having to type out all the 274 (?) codes myself? Thanks, Teja. 回答1: When you say "country code" I assume you mean the two-letter code as in ISO 3166. Then you can use the RegionInfo constructor to check if your string is a correct code. string countryCode = "de"; try { RegionInfo info = new RegionInfo(countryCode);

How to change dojo locale after dojo loaded?

久未见 提交于 2020-01-03 06:46:07
问题 We need set locale in data-dojo-config before dojo loaded so that dojo.i18n will work with this locale. Is there any workaround that we can change this locale in dojo/_base/config after dojo loaded so that any further dojo.i18n call will work with this new locale? I have a single page application, by carefully design, I already be able to recreate all my UI widgets dynamically anytime. I want to add a Select somewhere so that user can change languages on the fly. Currently the only solution I

Localising a PWA web manifest

陌路散爱 提交于 2020-01-03 05:42:08
问题 Is there a way in which a web manifest can be localised? i.e. having multiple translations of name , description etc... I have thought of a couple of potential solutions but they each have pretty big drawbacks... Potential Solution 1 (preferred but not sure if it will work) Dependant on the locale in the url ( example.com/en/foo ), load the relative manifest. For example: For example.com/en/foo , load example.com/en/manifest.json For example.com/jp/foo , load example.com/jp/manifest.json

PHP: Displaying Korean Text in a Webpage

為{幸葍}努か 提交于 2020-01-03 02:56:34
问题 How to display Korean Text in a webpage. i have been using these meta tags and headers <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="ko"/> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> ini_set('default_charset', 'UTF-8'); header('Content-Type: text/html;charset=utf-8'); But nothing works.. please help!! NOTE: I tried every tag 1 at a time not all at once. 回答1: Use: ini_set('default_charset', 'UTF

Is it possible to generate a global list of marked strings at compile time/runtime?

非 Y 不嫁゛ 提交于 2020-01-02 18:23:16
问题 So, I'm working on translating my C++ app into multiple languages. What I'm currently using is something like: #define TR(x) (lookupTranslatedString( currentLocale(), x )) wcout << TR(L"This phrase is in English") << endl; The translations are from a CSV file which maps the english string to the translated string. "This phrase is in English","Nasa Tagalog itong pagsabi" This is simplified, but that's the basic idea. My question is about generating the list of English phrases that need to be

Is it possible to generate a global list of marked strings at compile time/runtime?

大兔子大兔子 提交于 2020-01-02 18:23:03
问题 So, I'm working on translating my C++ app into multiple languages. What I'm currently using is something like: #define TR(x) (lookupTranslatedString( currentLocale(), x )) wcout << TR(L"This phrase is in English") << endl; The translations are from a CSV file which maps the english string to the translated string. "This phrase is in English","Nasa Tagalog itong pagsabi" This is simplified, but that's the basic idea. My question is about generating the list of English phrases that need to be

What are the options for making a simple static website multilingual?

北城以北 提交于 2020-01-02 12:56:50
问题 I'm setting up a static website which I want to display in two languages. I can't find a comprehensive overview of the different options (e.g. server-side loading vs front-end loading vs using different folders. What are the advantages of each option (e.g. for SEO, maintainability, scalability etc.)? Ideally the translations will be stored in separate json files. The main thing I care about is translation - less so the other aspects of i18n and l10n. For example how might I translate: <html

UI Truncation on Localized Win7 Versions

你。 提交于 2020-01-02 12:25:33
问题 I have a 2 UI developed in C# .NET 3 and Wise Installer respectively. The UI is a Page of Wizard. This works perfectly alright on Win 7 English OS. But when I deploy the app on Win7 Korean or Chinese. I see the truncation. I see the issue even if I hard code the Font as the default font for any localized OS is different. Other Things, I tried were - Changing the Windows Theme, Changing the resolution. But the Issue remains there. I want to understand what could be the reason for such change?