internationalization

Best way to manage/share common translation strings between bundles

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 17:32:27
问题 I read official docs about translation and i18n and say that xliff files must be put inside bundle or in app/Resources/translations directory. I have many bundles with your own strings, but some strings are used in others bundles too. Which is best strategy to manage/share common translation strings between bundles? 回答1: Personally, I don't use bundles for app specific code, so I keep all resources — views, translations, assets, etc — in app/Resources . You could consider this approach as

Dynamic messages with gettext (AngularJS)

纵然是瞬间 提交于 2019-12-10 17:28:25
问题 I have a application with a Django backend and an AngularJS front-end. I use the angular-gettext plugin along with Grunt to handle translations. The thing is, I sometimes received dynamic strings from my backend through the API. For instance a MySQL error about a foreign key constraint or duplicate key entry. How can I add this strings to the .pot file or non harcoded string in general ? I've tried to following but of course it cannot work : angular.module('app').factory('HttpInterceptor', ['

Play! Framework - Can my view template be localised when rendering it as an AsyncResult?

ぃ、小莉子 提交于 2019-12-10 17:22:46
问题 I've recently started using the Play! framework (v2.0.4) for writing a Java web application. In the majority of my controllers I'm following the paradigm of suspending the HTTP request until the promise of a web service response has been fulfilled. Once the promise has been fulfilled, I return an AsyncResult . This is what most of my actions look like (with a bunch of code omitted): public static Result myActionMethod() { Promise<MyWSResponse> wsResponse; // Perform a web service call that

Locale-aware Perl regular expressions (matching word boundaries)

眉间皱痕 提交于 2019-12-10 16:49:01
问题 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 from MySQL to UTF8 (using decode_utf8), and so on... Unfortunately, to no avail. Google also did not help much. Is there any chance to get the following regex locale-aware so that $street = "Täststraße

Displaying Korean Characters - iOS App

三世轮回 提交于 2019-12-10 16:27:06
问题 I am trying to display Korean text in my iPhone app. The app appends the Unicode of letters one by one to an NSMutableString and displays the string on the screen after each letter is appended. I understand that there are some rules for conjoining letters (Jamo). Is there a function for automatically applying all these rules to a string of letters or do I need to write code to make changes (e.g., changing a consonant to a tail consonant if there is a vowel before it)? 回答1: FCA. It's you who

Displaying japanese instead of chinese in a textview

 ̄綄美尐妖づ 提交于 2019-12-10 16:18:38
问题 When displaying japanese text in a textview, android defaults to using a chinese font, showing the wrong characters, exemplified here. Setting the locale to japanese works on the emulator, but doesn't work on my galaxy s3, probably because it doesn't support Japanese. There other solution is to set the font programattically from an asset such as: textView.setTypeface(Typeface.createFromAsset(getAssets(), "DroidSansJapanese.ttf")); but that seems like a bit of a kludge. Is there any way to set

i18n using Angular Translate StaticFilesLoader

こ雲淡風輕ζ 提交于 2019-12-10 16:08:50
问题 I'm following this tutorial at ng-newsletter to apply i18n to my app using Angular-Translate. The app works fine when I include the translations within my app.js file, but I'm having trouble getting the StaticFilesLoader to work. This is my app.js file with the working code commented out- angular.module('myApp', [ 'ngCookies', 'ngRoute', 'ngResource', 'pascalprecht.translate', 'myApp.services', 'myApp.directives', 'myApp.controllers', ]); angular.module('myApp.services', ['ngResource']);

Angular 5 Universal (SSR) with dotnet core not working with i18n angular tools on Staging server

耗尽温柔 提交于 2019-12-10 16:06:01
问题 I'm trying to make the Angular Project Template with dotnet core running with the I18n Angular tool. (https://docs.microsoft.com/en-us/aspnet/core/spa/angular?tabs=visual-studio) Here is what I have in my startup class app.Map("/fr", fr => { fr.UseSpa(spa => { // To learn more about options for serving an Angular SPA from ASP.NET Core, // see https://go.microsoft.com/fwlink/?linkid=864501 spa.Options.SourcePath = "ClientApp"; spa.UseSpaPrerendering(options => { options.BootModulePath = $"{spa

Get List of Supported Currencies

孤街浪徒 提交于 2019-12-10 15:54:24
问题 Other than just guessing (like I've done below), is there a more direct and efficient way of reflectively retrieving a list of all currencies supported by your JavaScript environment? function getSupportedCurrencies() { function $(amount, currency) { let locale = 'en-US'; let options = { style: 'currency', currency: currency, currencyDisplay: "name" }; return Intl.NumberFormat(locale, options).format(amount); } const getAllPossibleThreeLetterWords = () => { const chars =

Angular 2 and i18n in typescript

廉价感情. 提交于 2019-12-10 15:54:18
问题 I saw that angular2 implements i18n for its components and that by using i18n (and all its related attributes like i18n-title, plurals etc ...) you can internationalize your html templates. But i was wondering how can you internationalize strings that are provided by your typescript code. For example i have a popup where depending on the error that is throw by my backend i print in it a different message. That message is provided by a variable binding to my template and i did not found a way