internationalization

What's the expected outcome of uppercasing embedded English words in Turkish text?

纵然是瞬间 提交于 2019-12-06 13:02:41
I am aware of the Turkish "I" problem, where uppercasing of "i" is different in Turkish and in English. However, does Turkish commonly embed foreign words (e.g. English names) in Turkish text? For example let's say someone embeds the text "Microsoft Windows" in otherwise Turkish text and I'd like to uppercase the text. Should the "i"'s in the English words (company and product) be uppercased using English rules or using Turkish rules? Or would the English word already be such a form that uppercasing/lowercasing of it using Turkish rules would give the expected results for Turkish speakers? Yes

Change language of text in template in play framework 2.1.1

ぐ巨炮叔叔 提交于 2019-12-06 13:01:44
I want the user of the application can change the language in my play2 (play 2.1.1, scala 2.10.1) web application. I use @Messages.get(...) in my templates for i18n. I have application.langs="en,ru" in application.conf. I pass "en" or "ru" to that method: def index = Action { Ok(views.html.index()) } def changeLanguage(lang:String) = Action { implicit request => Logger.logger.debug("Change user lang to : " + lang) val referrer = request.headers.get(REFERER).getOrElse(HOME_URL) Redirect(referrer).withLang(Lang(lang)) } routes: GET / controllers.Application.index GET /index controllers

How to translate models in Sails.js?

戏子无情 提交于 2019-12-06 13:01:15
问题 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. 回答1: You can do it 2 ways: 1.) Duplicate the fields in you model

Set Oracle NLS_LANGUAGE from java in a webapp

[亡魂溺海] 提交于 2019-12-06 12:47:58
问题 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

what is the best way to do internationalization in php?

孤人 提交于 2019-12-06 12:39:03
问题 For a PHP-MySQL application, what is the best way to handle internationalization? Do I save the data in MySQL or flat files? Is there any standard library that comes with PHP or do I need to write my own functions? 回答1: Use the new Internationalization module if you're using PHP 5.3. It uses the ICU library that's compatible with C/C++ and Java. gettext() is on its way to becoming legacy code. 回答2: You can use gettext(): <?php // Set language to German putenv('LC_ALL=de_DE'); setlocale(LC_ALL

Play 2.4.x how use Messages and not MessagesApi I18N

本小妞迷上赌 提交于 2019-12-06 11:54:00
I've done a little bit different form the internationalization guide, at the play I18N guide I forced the result to the language in the query string, it works, but it needs to be done in the "correct way". It's a good form to keep the work and look for better approach later: NOTE: I USED THE "MessagesApi" to make it happen. please see the code below: package controllers import play.api._ import play.api.mvc._ import play.api.i18n.I18nSupport import play.api.i18n.Messages.Implicits._ import play.api.i18n.MessagesApi import javax.inject.Inject import play.api.i18n.Lang import play.api.i18n._

Devise and I18n - reset password routing issues

此生再无相见时 提交于 2019-12-06 11:48:47
问题 I added I18n to my RoR app that is using Devise and I am now getting an error if I try to do a password reset. The error is: Routing Error No route matches {:action=>"edit", :controller=>"devise/passwords", :reset_password_token=>"uMopWesaxczNn2cdePUQ"} How can I correctly set up my Devise routing to account for I18n? routes.rb scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do devise_for :users, path_names: {sign_in: "login", sign_out: "logout"}, controllers: {omniauth

Django 1.2.3 - Internationalization - makemessages does not detect all strings

[亡魂溺海] 提交于 2019-12-06 11:37:55
问题 One more question about Django concerning localization of javascript files. Django provides a small and convenient javascript library which is used like gettext to internationalize strings in javascript files. I set it up successfully (at least the interpolate function works) and I could generate the po file for the French language. However, not all strings are detected. I don't really know why because they all look the same. I couldn't find anything on the Django Trac and the official docs.

Configuring string externalization in Eclipse to use ${key} as field name

纵饮孤独 提交于 2019-12-06 11:23:32
问题 Suppose I have a simple code like this: public class ExternalizeStringDemo { public static void main(String[] args) { System.out.println("Hello world"); } } Now, I want to externalize the greeting, perhaps to facilitate internationalization/localization/etc. Using Eclipse, I can use the String Externalization wizard (Source/Externalize Strings), and configure it like this: I can proceed with the wizard and it will propose these changes: Create file Personal Toys/src/Messages.java Create file

AddExtensionObject - Performance

≯℡__Kan透↙ 提交于 2019-12-06 11:10:44
问题 .NET XSLT engine allows passing objects to the XSLT processing engine through the AddExtensionObject method. Can someone comment on the performance of using this to retrieve localized strings to be used in the XSLT? 回答1: Extension objects can be used to improve performance if a part of an XSLT transformation is deemed inefficient. While the use of methods of an extension method would not decrease performance (excluding buggy and inefficient code), they will not improve performance