internationalization

Angular 5 - Translating Strings in TypeScript

北慕城南 提交于 2019-12-06 01:08:05
问题 I am using i18n for my tranlsations and am happy with how this works on the html side. However if I have error messages etc defined in strings in my typescript I would like a way to translate these and can't find a way to do it. Is there a workaround to achieve this? 回答1: This is not possible through the library's API until now ( @angular/language-service v7.2 ). Anyway, you can see my answer under another similar question for a workaround . 回答2: There is an open question on Angular GitHub

Get all available cultures from a .resx file group

耗尽温柔 提交于 2019-12-06 00:26:35
问题 I need to programatically list the available cultures in a resx file group, but the ResourceManager class doesn't seem to help. I may have : Labels.resx Labels.fr-FR.resx Labels.ro-RO.resx and so on However, how can I find these three (or how many would there be) cultures at runtime? 回答1: Look for satellite assemblies in your application's directory: for each subdirectory, check if its name corresponds to a culture name, and if it contains a .resources.dll file : public IEnumerable

Does there exist a publicly accessible parsable Country/Country Code list? [closed]

左心房为你撑大大i 提交于 2019-12-06 00:12:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I find that I always find it useful to have a list of all Countries and their country codes. If someone provided it in multiple formats (eg: SQL, DDL, Xml, CSV, JSON, YAML... ). I've found sites that attempt to sell a list of countries but that seems crazy to me. Is there an open source project that I'm

Can xgettext be used to extract specific domain strings only?

北城余情 提交于 2019-12-05 23:43:46
(Really surprised this isn't answered anywhere online; couple posts over the past few years with a similar question, but never answered. Let's hope the Stackoverflow crew can come to the rescue) Situation: When using gettext to support application localization, one sometimes wishes to specify a 'domain' with dgettext('domain', 'some text string'). However, when running xgettext , all strings wrapped with dgettext(...) are spit out into one file (default: messages.po). Given the following example: dgettext('menus', 'login link'); dgettext('menus', 'account link'); dgettext('footer', 'copyright

Changing locale in karma-jasmine unit test for angularJS

拈花ヽ惹草 提交于 2019-12-05 23:33:20
I am attempting to change locale in a jasmine unit test for angularJS (being run through Karma) using angular-dynamic-local . describe('currency filter', function () { var currencyFilter; var tmhDynamicLocale; beforeEach(function () { module('tmh.dynamicLocale'); inject(function ($injector) { var $filter = $injector.get('$filter'); currencyFilter = $filter('currency'); tmhDynamicLocale = $injector.get('tmhDynamicLocale'); }); }); it('formats US currency in standard form', function () { expect(currencyFilter(50.17)).toBe("$50.17"); }); it('formats French Canadian value with $ at end and comma

Spring 4 i18n & l10n (Cannot change HTTP accept header)

浪子不回头ぞ 提交于 2019-12-05 23:31:19
I need help to solve this error message. Im working with spring 4 and I want to implement i18n & l10n on my project. When I try to change language this message appears. Below follows my code. Please, anyone could help me with this issue? http://imgur.com/NZ9RaC8 Output: ago 21, 2014 10:29:43 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/webapp] threw exception [Request processing failed; nested exception is java.lang.UnsupportedOperationException: Cannot change HTTP accept header - use a different locale

How to add internationalization support to Blogger?

不羁的心 提交于 2019-12-05 23:01:21
How to add internationalization support to Blogger? Is it possible to deal with multiple languages within one blog? Is it possible to add own translation and don't use Google Translate widget ? Thanks. Mike These should be set in html head of your blog (Design -> Edit HTML, insert after <head>) <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js' type='text/javascript'></script> <script src='http://csjs.googlecode.com/files/csjs_1.1.3.js' type='text/javascript'></script> <script src='http://csjs.googlecode.com/files/csjs.lang_1.0.0.js' type='text/javascript'></script>

Do you know of a good program for editing/translating resource (.rc) files?

倖福魔咒の 提交于 2019-12-05 22:49:36
问题 I'm building a C++/MFC program in a multilingual environment. I have one main (national) language and three international languages. Every time I add a feature to the program I have to keep the international languages up-to-date with the national one. The resource editor in Visual Studio is not very helpful because I frequently end up leaving a string, dialog box, etc., untranslated. I wonder if you guys know of a program that can edit resource (.rc) files and Build a file that includes only

java.util.MissingResourceException: Can't find bundle for base name

做~自己de王妃 提交于 2019-12-05 22:41:48
问题 I'm testing Java's i18n features and have a problem, I can't load the language file when it's not in the class root. Right now my files are in the /lang directory. Looked several answers here in SO, putting it in a classes subdir and loading it like lang.Messages , used complete location routing /Test/lang/Message (test is the project name), using just /lang/Message and still I'm getting the: java.util.MissingResourceException: Can't find bundle for base name error. Anything else to try? My

Rails not picking up custom date & time formats in en.yml

ぐ巨炮叔叔 提交于 2019-12-05 22:31:11
I'm not that familiar with I18N in Rails so bear with me. Trying to set a custom date & time format: #config/locales/en.yml en: date: formats: long_dateweek: "%A, %B %d, %Y" time: formats: very_short: "%H:%M" But when I try to use them I just get the default formats: 1.9.3p194 :001 > Time.now.to_date.to_s(:long_dateweek) => "2012-08-22" 1.9.3p194 :002 > Time.now.to_time.to_s(:very_short) => "2012-08-22 16:12:47 -0700" Tried restarting console (and even the server) to no avail... What'd I miss? You need to use the I18n.l method as follows: 1.9.3p194 :001 > I18n.l Time.now.to_date, :format =>