2
投票
4答案
1658 次观看

使用PHP根据浏览器和URL组合自动检测语言文件

我的网站上有来自世界各地的许多人。整个过程都是UTF-8,因此人们可以自由提交内容并以他们希望的任何语言发言-从希腊语到英语。 现在,用户唯一无法控制的是内置网站语言,用于导航和注册说明之类的内容。这些字符串在语言文件中,但是可以轻松翻译。 因此,现在我需要知道如何构建一个系统,该系统将尝试自动检测用户的首选语言,同时仍然允许对其进行更改。 执行此操作的最简单方法是检查Accept-Language标头用户浏览器发送。大多数浏览器将以用户所需的语言安装-即便如此,他们也可以在设置中更改语言。 问题是网吧用户可能想要更改这些设置,但将无法执行,或者用户可能没有足够的网络能力甚至无...

0
投票
2答案
1129 次观看

谷歌建议API不适用于中文语言环境

在使用中文语言环境时,Google建议API存在问题。我随机选择中文象形文字,并使用REST API检索建议。不幸的是,Google总是返回一个空的建议列表(我完全确定,我将请求转换为utf-8,并且可以与其他语言(例如俄语)一起正常使用: 样品申请 http://suggestqueries.google.com/complete/search?qu =%E9%80%9F Google答案: window.google.ac.h([“速”,[]]) 有人知道如何检索针对中国语言环境的建议吗?也许我缺少一些标志或东西?也许有来自Google的官方文件说不支持中文?还...

0
投票
2答案
576 次观看

Windows Vista中的区域设置更改未反映在.NET应用程序中

我已按照此处。运行C#.NET应用程序时,我期望Thread.CurrentThread.CurrentUICulture和Thread.CurrentThread.CurrentCulture会反映此en-GB设置。但是,我仍然在美国。有什么我想念的吗?

20
投票
5答案
19098 次观看

我如何知道我的PostgreSQL服务器是否使用“ C”语言环境?

我正在尽我所能来优化我的PostgreSQL 8.3数据库表,但是我不确定是否需要对某些要对字符串的前N个字符执行varchar_pattern_ops的列使用LIKE。根据本文档,仅需要使用xxx_pattern_ops“...当服务器不使用标准的'C'语言环境时。” 有人可以解释这是什么意思吗?如何检查数据库使用的语言环境?

82
投票
10答案
212112 次观看

SimpleDateFormat和基于语言环境的格式字符串

我试图根据给定的语言环境以不同的方式用Java格式化日期。例如,我希望英语用户看到“ 2009年11月1日”(格式为“ MMM d,yyyy”),而挪威用户希望看到“ 1. nov。2009”(“ d。MMM。yyyy”)。 如果我将语言环境添加到SimpleDateFormat构造函数中,则月份部分工作正常,但是其余部分呢? 我希望可以将与语言环境配对的格式字符串添加到SimpleDateFormat,但是我找不到任何方法。有可能还是需要让我的代码检查语言环境并添加相应的格式字符串?

0
投票
1答案
772 次观看

在iPhone应用程序上选择特定的本地化

如何让用户在我的应用中选择特定的本地化?我有一本书,我希望用户能够阅读它的所有不同译本。

5
投票
5答案
7461 次观看

本地主机有时很慢

我在基本的webdev学习过程中使用firefox作为默认浏览器,我想知道为什么当我以ftp或p2p格式进行文件传输时,访问本地主机需要这么多的时间,就像我访问http一样来自世界另一端的服务器。 有什么主意吗?你知道如何解决它吗? ps:我在Windows VISTA计算机上使用WAMP

16
投票
6答案
31289 次观看

解析具有短月份且不带点的日期

我有一个字符串,表示法语语言环境中的日期:08年9月10日: 我需要解析该字符串,所以我想到了这个SimpleDateFormat: String format2 = "dd-MMM-yy"; 但是我对月份部分有问题,这似乎应该以结束点表示: df2.format(new Date()); 给我: 28-oct.-09 现在让我理解SimpleDateFormat(“ 09-oct-08”)的最佳方法是什么? 完整代码: String format2 = "dd-MMM-yy"; DateFormat df2 = new SimpleDateFo...

0
投票
1答案
1060 次观看

在iPhone中设置我的语言环境

我正在做一个用户倒计时的应用程序。计时器可以在我的模拟器上正常工作。但是,当我将其安装到设备中时,计时器显示出一些时差。希望它与语言环境有关。谁能帮我解决这个问题??拜托... 预先感谢, 士宾

1
投票
5答案
9656 次观看

OSX上的locale.getlocale()问题

我需要获取系统区域设置才能执行许多操作,最终我想使用gettext转换我的应用程序。我将同时在Linux和OSX上分发它,但是在OSX Snow Leopard上遇到了问题: $ python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocal...

1
投票
2答案
2186 次观看

python语言环境货币和负数

为什么? C:\path12321gt;manage.py shell Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getlocale() ('Spanish_Colombia', '1252') >>&...

4
投票
4答案
8605 次观看

Facebook FQL user table `sex` field : how to return male/female even the user is using different locale?

Situation: my facebook application ( http://apps.facebook.com/mymagicmirror/ ) needed to detect user's gender, and then query opposite sex or male or female FQL: SELECT uid, name, pic, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user_id.') and sex='male' Problem: When t...

2
投票
1答案
222 次观看

.NET counterpart of Java's locale's variant: does it exist?

Are there localisation mechanisms available under .NET (out of the box) that support something like Java's locale's variant? Beside the language and country I would like to be able to have a variant, say, per users' domain. My users represent various domains and their vocabulary varies. I was try...

0
投票
1答案
200 次观看

Supporting limited number of currencies in Cocoa(Touch)

Early versions of our app will only support a limited number of currencies. If a user should try to use our app with an unsupported currencyCode then I'd like to set the currencyCode to one that is supported. I'm getting myself confused bouncing between NSNumberFormatters, currencyCodes, NSLocale...

22
投票
6答案
25262 次观看

Grails how to change the current locale

How can I change the current locale ? I tried to put controller/action?lang=de but my locale is still en_US I tried to override the value using this piece of code: def key = "org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER" def localeResolver = request.getAttribute(key) loca...

3
投票
1答案
2032 次观看

Why is nl_langinfo(CODESET) different from locale charmap?

This post originated from How do you get what kind of encoding your system uses in c/c++? I tried using nl_langinfo(CODESET) but I got ANSI_X3.4-1968 instead of UTF-8 (which is what I get when typing: locale charmap). Am I using nl_langinfo() wrong? How should I use it?

4
投票
1答案
1292 次观看

Locale-aware Perl regular expressions (matching word boundaries)

I'm currently somewhat stuck getting a regular expression in Perl (taken from an earlier question of mine) to match word characters from a non-ASCII locale (i.e., German umlauts). I already tried various things such as setting the correct locale (using setlocale), converting data that I receive ...

0
投票
1答案
2796 次观看

C# sort list of strings with specific scandinavian culture in mind

i have a list of country names. Now i want to sort them alphabeticly, with the users culture in mind. I have the 4 scandinavian cultures norway, sweden, danmark en finland. For sweden, the Ö (O with two dots if it's not printed correctly) must appear at the end, after the Z, but for danmark it's...

11
投票
2答案
751 次观看

Are there any updates of localization support in C++0x?

The more I work with C++ locale facets, more I understand --- they are broken. std::time_get -- is not symmetric with std::time_put (as it in C strftime/strptime) and does not allow easy parsing of times with AM/PM marks. I discovered recently that simple number formatting may produce illegal U...

4
投票
4答案
2671 次观看

Has C#/.NET builtin conversion routines for length units?

Has C#/the .NET library builtin routines or constants for converting e. g. millimetres to inches? If so, where can I find them? (I just do not want to produce duplicate code again and again.)

0
投票
3答案
193 次观看

Special Characters in non english languages

How can I generate a text file containing all character codes in a specific locale for example 1029 Czech. I basically want to generate a list of every character that exists in their alphabet?

0
投票
3答案
2746 次观看

How to set DB2 ODBC driver locale?

I want to import data from a DB2 database into MS Access via ODBC. The connection is set up and working but decimal values get converted due to some locale issue (German Windows). 234.75 ends up as 23475 in the Access table. I had the same issue with Oracle but was able to fix it by setting the...

0
投票
2答案
2800 次观看

Encoding issue under Groovy

I am developing an application which should work under different languages (german, spanish, etc). The application uses an Oracle DB. I have CRUD business processes and I have the standard views (create, edit, show, list). No problems for creating, showing and listing any record containing specia...

11
投票
7答案
30276 次观看

Is there a way to get a timeZone with (only) a country code (valid ISO-3166 code)?

I'm trying to get a TimeZone for a user. For this I have a country code which is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as: http://www.chemie.fu-berlin.de/diverse/doc/I...

3
投票
1答案
945 次观看

How to format numbers according to locale in Haskell?

In Python I can use locale.format to pretty-print numbers according to locale setting: >>> import locale >>> locale.setlocale(locale.LC_ALL, "en_US.UTF-8") 'en_US.UTF-8' >>> locale.format("%.2f",1234567.89,grouping=True) '1,234,567.89' How can I do the same in Haskel...

3
投票
2答案
1518 次观看

Convert NSString with a number to appropriate phone number localization format

NSString *phoneNumber = @"2310234432"; I would like to create a new string out of the above but format the phone number according to the current localization. Is there a "native" way I can do this or do I have to write my own methods to return it for every locale ? Thanx

9
投票
4答案
3324 次观看

locale-dependent ordering for std::string

I am trying to compare std::strings in a locale-dependent manner. For ordinary C-style strings, I've found strcoll, which does exactly what I want, after doing std::setlocale #include <iostream> #include <locale> #include <cstring> bool cmp(const char* a, const char* b) { ...

2
投票
3答案
324 次观看

Does the formatting of a date depend on both the user's locale and calendar system?

I feel this question is very general for all programmers on all languages. This is somewhat blurry. First, there are locales, which encapsulate cultural information and other stuff. I believe these locale objects also encapsulate information about date and time formatting, i.e. how to display a d...

1
投票
1答案
530 次观看

Java Locale issue in vendor Applet

I have a vendor Applet that is trying to use no longer supported locale settings. De compiled Code is as follows String s1 = System.getProperty("java.version"); String s2 = System.getProperty("user.language"); String s; if(s1.regionMatches(true, 0, "1.4", 0, 3)) s = System.getPr...

19
投票
2答案
34950 次观看

Java Date Format for Locale

How can I find the DateFormat for a given Locale?