internationalization

Translation in .yml with optional parameter

拥有回忆 提交于 2019-12-06 16:34:36
问题 I want to make a translation my_translation with an optional parameter. For example: > I18n.t('my_translation') => "This is my translation" > I18n.t('my_translation', parameter: 1) => "This is my translation with an optional parameter which value is 1" Is this possible? 回答1: Yes, definitely. You just write the translations like this: my_translation: This is my translation with an optional parameter which value is %{parameter} Is the parameter really optional? In above translation, you have to

Serve an i18n angular app on Firebase using functions

谁说胖子不能爱 提交于 2019-12-06 15:28:03
I'm trying to handle requests correctly to a localized angular app hosted on Firebase. The goal is to load the right app bundle depending on: 1) A cookie named locale . 2) The accept-language header. 3) Default to en-us when others are unavailable. When localizing angular apps with i18n, angular-cli generates bundles (versions of your app) for each language/locale present in angular.json . Firebase serves your bundles as static content and it has serious security measurements disallowing path traversals. I tried both setting rewrites and redirects in firebase.json but there is no facilities to

How do I log russian text or non-latin?

坚强是说给别人听的谎言 提交于 2019-12-06 15:03:54
Everything works well in the previous version of XCode. But today in the XCode 4.3.2 I have a problem. How do I log russian text or non-latin? NSLog(@"russian text: русский текст"); NSString *text = @"russian text: русский текст"; const char *textC = [text UTF8String]; NSString *getText = [NSString stringWithCString:textC encoding:NSUTF8StringEncoding]; NSLog(@"___text: %@", getText); My logs russian text: —Ä—É—Å—Å–∫–∏–π —Ç–µ–∫—Å—Ç ___text: russian text: —Ä—É—Å—Å–∫–∏–π —Ç–µ–∫—Å—Ç UPDATE: The bug take place only on real device (ipod touch 5.1). It works properly on iphone simulator. Works fine

Unable to use I18n.t call in an initializer file in Rails 3.1.1

為{幸葍}努か 提交于 2019-12-06 14:43:35
I would like to use I18n.t in an initializer file in Rails 3.1.1. This question already exists for Rails 2 (http://stackoverflow.com/questions/3514536/unable-to-use-i18n-t-call-in-an-initializer-file). Supposedly, it was answered by a subsequent release. It appears to be an issue again in Rails 3.1.1. The problem: I have a custom time format called :dxl. I would like to format my Email.sent_at datetime as :dxl. The solution: In can add the format to en.yml (time.formats.dxl) and use it with: I18n.localize(email.sent_at, :format => :dxl) I also want to show the utc time. I do not see a way to

ASP.NET MVC 2 i18n

被刻印的时光 ゝ 提交于 2019-12-06 14:41:02
问题 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

Symfony translations on dynamic content

南楼画角 提交于 2019-12-06 14:35:20
问题 With Symfony I'm aware that you can create translation files in which you specify the text for different languages etc. This works great for form labels, and other static text across an application. What I'm wondering though is how you could achieve internationalisation with dynamic content. For example if you have a Product entity with a description field. The administrator can alter this text through the back-end. So how would you implement the international alternatives for dynamic text?

Marionette + i18n in templates

。_饼干妹妹 提交于 2019-12-06 13:44:55
问题 I want to do some basic i18n in my application I loaded the i18n plugin (from require.js) to my Application and created a directory nls in which i have several files e.g. project.js I set up the default location in main.js file like config : { i18n : { locale : 'de-de' } } I now want to use the files in my View / Template. Can somebody explain to me how this is done? The templates are setup in one template.js file My View: define(['marionette', 'templates', 'i18n!nls/project'], function

UI Truncation on Localized Win7 Versions

大憨熊 提交于 2019-12-06 13:29:27
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? Is there any official documentation regarding such a behavior? What could be the solution to this issue

Django internationalization: prefix_default_language & language redirect

主宰稳场 提交于 2019-12-06 13:15:04
问题 I'm adding internationalization to my Django project. The idea of how it should work is the following: When a user enters "/" i.e. the "homepage" we try to get his/her language preferences from our session. If it's not our default language (EN), we redirect the user to the local version, like /ES/, /RU/, /CN/, etc If we have no such session data, we check Accept-Language and redirect the user to the local version if we support such If we don't support user's Accept-Language OR if it's EN - we

Grails message.properties changes not taking effect in deployed application

瘦欲@ 提交于 2019-12-06 13:13:44
I have a really annoying problem with a deployed Grails application on tomcat 7 I created a tool in my website that basically allows the site admin to edit message.properties files so that he can change the messages for a certain language as he desire. All the changes are saved successfully to the file he edited. In development, while running the website from STS (Soring Source Tools Suite; somethng like eclips) I just refresh the website in the browser and I see the changes instantly, all the changes that made to the message.properties file for the selected language is taking effect correctly