internationalization

Strings in Applescript depends on the system language - are there universal names?

 ̄綄美尐妖づ 提交于 2019-12-04 19:58:41
I write some Applescripts that are gonna be deployed on machines set to different languages. I just realised that when I, for example, is waiting for an application to open a window (e.g., a Save/Open dialog) my scripts fail because on systems set to other languages these windows are not called Save or Open anymore, but rather have a translated name. How do I handle this? Do windows have "universal base name" I can look for rather than the name I Accessibility Inspector shows? And I guess there are other strings that also are translated that I might need to access (menus, menu commands and so

How to translate models in Sails.js?

余生颓废 提交于 2019-12-04 19:54:58
I'm working on a simple app with a few models which need to have multilingual attributes. E.g., a model "Article" with a "title" string attribute should have translation for English and French. I'm aware that Sails.js ships with I18n node module, but that seems to handle hardcoded string translations only. Does anyone have any experience with this or sample code to point me to? I'm looking for a best practice here, if possible. You can do it 2 ways: 1.) Duplicate the fields in you model for each language like: { title_en: "string", title_fr: "string", } 2.) You can add a "language"-attribute

Rails 3 change default english numbers to arabic numbers

孤街醉人 提交于 2019-12-04 19:33:39
I want to change the default numbers from english to arabic when the user switches to the arabic interface. 13 => ١٣ 89 => ٨٩ What is the best way to tackle this problem? I add in helper module ARABIC_NUMBERS = %w(٠ ١ ٢ ٣ ٤ ٥ ٦ ٧ ٨ ٩) def ta numbers numbers = numbers.to_s if numbers.is_a? Integer results = numbers.chars.map { |char| ARABIC_NUMBERS[char.to_i] }.join end Check this code : https://github.com/gdotdesign/rails-arabic-convert/blob/master/app/helpers/convert_helper.rb . It's a helper to convert a english number to an arabic number. I came up with this quick solution. I added the

ASP.NET MVC 2 i18n

扶醉桌前 提交于 2019-12-04 19:33:38
I found the following page on i18n and ASP.NET: http://wiki.asp.net/page.aspx/55/internationalization/ The videos were very helpful although they apply to ASP.NET WebForms more than ASP.NET MVC, e.g., the videos show you how to internationalize controls rather than text -- which leads me to another realization: there isn't (or I couldn't find) a resources folder in my MVC applications -- just folders like AppData. Is there a simple way (like in the videos) to internationalize plain text in ASP.NET MVC? If not, do I have to use some sort of ASP control? There's a guide here: http://adamyan

django unicode encode/decode errors

淺唱寂寞╮ 提交于 2019-12-04 19:29:38
My site needs to be able to serve data in different languages. I set it so it uses utf-8 and the db settings are set to that as well. I've been getting different different unicode errors over the admin. For example: In the admin list, when a field from the list contains a non ascii char. (i get UnicodeDecodeError) When adding a new entry, a UnicodeEncodeError if the unicode method for the model returns an utf-8 decode (which fixes #1). When using a filter_horizontal in the admin, if data from the used model contains non ascii chars, then the filter disappears from the form. If I set the

Set Oracle NLS_LANGUAGE from java in a webapp

我的梦境 提交于 2019-12-04 19:25:24
My understanding of JDBC is that it automatically sets the Oracle NLS_LANGUAGE/NLS_TERRITORY session parameters based on the default Locale of the JVM. This is handy for a stand-alone swing app, but seems useless for a java webapp. The only solution I can come up with is to specifically set the session parameters right before actually doing a database query, something similar to: Connection c = // However you get it. Statement s = c.createStatement(); s.execute("alter session set NLS_LANGUAGE = 'SPANISH'"); // Do actual query here My questions: Is this the best way to set the Oracle language

Ruby On Rails: pluralize for other languages

孤人 提交于 2019-12-04 19:21:57
问题 I am building apps for a non-english audience. Right now, I use english nouns to name my models, yet I prefer to use native dutch ones. As the convention uses the plural of the class name for tables, I assume it is the pluralize method inside Rails (where it resides, I wouldn't know). How can I change the pluralize method and where is it located? Would this break Rails? I am using Rails 2.3.5 and Ruby 1.8.7 Example: The Book class becomes books now. My Boek class becomes boeks , but it is

Flip UIImageViews for Right to Left Languages

醉酒当歌 提交于 2019-12-04 19:12:47
问题 iOS automatically flips the entire ViewController when using a RTL language like Arabic and does a great job with most of the layout, especially text. The default behavior is to flip the layout but leave UIImageViews the same orientation (since you generally don't want to reverse images). Is there a way to specify that some images should be flipped (such as arrows) when the phone is set to a RTL language? 回答1: iOS 9 includes the imageFlippedForRightToLeftLayoutDirection method that you can

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

拈花ヽ惹草 提交于 2019-12-04 19:01:45
问题 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 UTF-8 under certain locales (like ru_RU.UTF-8 ). std::ctype is very simplistic assuming that to upper/to lower can be done on per-character base (case conversion may change number of characters and it is

Django: change app language programmatically (without /i18n/setlang/ view)

▼魔方 西西 提交于 2019-12-04 18:42:06
My situation is the following: I'm developing a multi-language site and currently I use the Django view /i18n/setlang/ to let user switch language from a dropdown menu, and all works fine… but now, I wish to set the language programmatically, specifically I have a form with a series of settings and, among these, there is a "favorite language" voice, once the user submit the form, my view saves the User model and theoretically after that it should set the application language using the saved preference, but it does not work. What I tried is: from django.utils.translation import activate