internationalization

Python: date formatted with %x (locale) is not as expected

不羁岁月 提交于 2019-12-04 12:03:53
I have a datetime object, for which I want to create a date string according to the OS locale settings (as specified e.g. in Windows'7 region and language settings). Following Python's datetime formatting documentation , I used the %x format code which is supposed to output " Locale’s appropriate date representation. ". I expect this "representation" to be either Windows "short date" or "Long date" format, but it isn't either one. (I have the short date format set to d/MM/yyyy and the long date format to dddd d MMMM yyyy , but the output is dd/MM/yy ) What's wrong here: the Python

Case-insensitive UTF-8 string collation for SQLite (C/C++)

Deadly 提交于 2019-12-04 11:54:00
问题 I am looking for a method to compare and sort UTF-8 strings in C++ in a case-insensitive manner to use it in a custom collation function in SQLite. The method should ideally be locale-independent. However I won't be holding my breath, as far as I know, collation is very language-dependent, so anything that works on languages other than English will do, even if it means switching locales. Options include using standard C or C++ library or a small (suitable for embedded system) and non-GPL

Wordpress multilanguage plugin [closed]

ε祈祈猫儿з 提交于 2019-12-04 11:44:09
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 months ago . I have a blog on Wordpress in which I need to serve contents in several different languages. I don't want to translate the articles, I just want to have some in each of the languages and just have a way of switching between them. I was looking for a wordpress plugin that allows such functionality but so far I found only xLanguage but it's not what I intend to use if for, although it's pretty close.

Call different (localized) view based on current culture

狂风中的少年 提交于 2019-12-04 11:31:17
I'm using LocalizationAttribute which implements ActionFilterAttribute to localize views. I simply put [Localize] on controller. I was using LocalizeStrings.resx files to apply based on which language is on current thread. Everything works for this simple case (with localized strings). Now I want to localize complete pages (not just strings). To acomplish this which approach do you use? Do I need to identify which thread is current on controller and based on that value to call view: public ActionResult AboutUs() { switch (Thread.CurrentThread.CurrentUICulture.Name) { case "en-US": return View(

JavaScript: Format number/currency w/regards to culture like .NET's String.Format()?

喜你入骨 提交于 2019-12-04 11:00:25
This seems like a problem someone would've already solved in the year 2009, but I can't find a decent JavaScript library that will take a number like: 12345.58 And format it correctly based on a specific culture (ie, "nl-nl") or ISO currency code. dojo showed promise, but it doesn't include many cultures by default, and actually wasn't working properly in my tests. I basically want something that is 100% or near-100% equivalent to what .NET does for me, when I run: String.Format([cultureInfo Object], "{0:N}", myValue) ' for numbers and String.Format([cultureInfo Object], "{0:C}", myValue) '

Database localization

一个人想着一个人 提交于 2019-12-04 10:59:23
问题 I have a number of database tables that contain name and description columns which need to be localized. My initial attempt at designing a DB schema that would support this was something like: product ------- id name description local_product ------- id product_id local_name local_description locale_id locale ------ id locale However, this solution requires a new local_ table for every table that contains name and description columns that require localization . In an attempt to avoid this

Displaying a unicode text in C#

你说的曾经没有我的故事 提交于 2019-12-04 10:57:40
My App displays English, Japanese and Chinese characters on a TextBox and a LinkLabel. Currently, I check if there are unicode characters and change the font to MS Mincho or else leave it in Tahoma. Now MS Mincho displays Japanese properly, but for Chinese I have to use Sim Sun. How can I distinguish between the two? How can I ensure that unicode text are displayed properly regardless of the font/language? If you have unicode characters for each of the text, using a font that supports unicode should cover it properly for you (e.g. Arial Unicode MS). You can't ensure that unicode text is

Dynamic locale switching in a JSF app?

痞子三分冷 提交于 2019-12-04 10:46:57
I have an application where the user can dynamically switch between locales from the welcome page of my application. I see that the earlier developer (inherited the code without much documentation) has overridden the following three methods from ViewHandler and tells me that this is required for dynamic switching of the Locale...any help is highly appreciated Also, do let me know if there is a better way of handling this public Locale calculateLocale(FacesContext facescontext) { Locale userLocale = LocaleManager.getInstance().getCurrentLocale(); if (userLocale != null) { return userLocale; }

How to link to language's homepage for untranslated page in django-cms?

陌路散爱 提交于 2019-12-04 10:21:22
Within django-cms I have two languages, with one page in Dutch currently not translated into English. When viewing this page, language_chooser does not provide a link for the English translation (as there is not). However, I would like to link the link to the English translation to link to the homepage (or some other English page if it makes sense). Now I could create the needed template tag myself, or some template trickery, but I think this problem has been solved before. Sadly though, I could not find any example of such a solution. Language chooser is used like this: <p><small>Choose your

Return Custom Validator Error Grails

耗尽温柔 提交于 2019-12-04 09:53:03
I'm only getting the default validator message. What am I doing wrong? class Questao { static hasMany = [alternativas:Alternativa] static constraints = { alternativas (validator: {val, obj -> if(val.size() < 2) return ['validator.message'] //custom message }) } } /i18n questao.alternativas.validator.message = "must be greater than two" default.invalid.validator.message= Property [{0}] of class [{1}] with value [{2}] does not pass custom validation Thanks You're returning a list containing your message code - you need to return just the code: alternativas validator: { val, obj -> if (val.size()