internationalization

Multi language PHP application: best practice?

 ̄綄美尐妖づ 提交于 2019-12-06 03:33:18
问题 I'd like to get your feedback over the way I implemented multi-language support on my PHP MVC web app. That's how I did: in the /app folder I created a /languages folder which contains one file per language (english.php, spanish.php, etc.) each file contains a serie of variables with the same names in each files, containing the texts to render in the views these variables are then echoed in the different views a "language" cookie variable is updated when the user changes the language in the

Right to left tooltip text c#

∥☆過路亽.° 提交于 2019-12-06 03:29:40
Using WinForms, I have a string which I want to set into a ToolTip. The string is separated by lines with Environment.NewLine , like so: x.ToolTipText = "aaaaaa" + Environment.NewLine + "bbb"; when this string is set to the ToolTip it looks: aaaaaa bbb But my problem is when I want it to be localized to Arabic and ToolTip does not support the default RightToLeft property, so it looks very bad. I want it to look like: aaaaaa bbb Also: String.PadLeft does not help! Any idea? Second try. Didn't manage to get the previous solution attempt to behave correctly. Found an alternate way by rendering

Static library and internationalization

别说谁变了你拦得住时间么 提交于 2019-12-06 02:59:48
I have a question regarding static libraries. I need to localize some text inside my library. So I created a bundle where I put my different localized files. Then, I created a function like this : NSString *MyLocalizedString(NSString* key, NSString* comment) { static NSBundle* bundle = nil; if (!bundle) { NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"MyStaticLib.bundle"]; bundle = [[NSBundle bundleWithPath:path] retain]; } return [bundle localizedStringForKey:key value:@"" table:nil]; } But when I use it, it always return the english localized string

Angular 4 Ngx-translate pipe not working

依然范特西╮ 提交于 2019-12-06 02:26:31
问题 I want to make an angular 4 app that is multilangual. I have followed the answer on Angular 2 - Multilingual Support but it doesn't work. I did every step, from 1 to 5 on that page and my appmodule looks the same. I have a file en.json in a folder i18n, located in my assets folder. The file contains { "TEST":"little test"} and in my HTML: <a [routerLink]="['/home']" class="tile waves-effect waves-light btn-large"> <span> {{ "TEST" | translate }}</span> </a> And when I use it I get TEST

Changing locale in Angular at runtime?

筅森魡賤 提交于 2019-12-06 02:24:26
问题 I was doing some research on changing Angular locale at runtime and found this thread: How to set locale in DatePipe in Angular 2? . Is it still the case that there is no way to change locale at runtime? I have an application that features several pipes to format number, date and language depending on the locale, but implementing many custom pipes for each locale -- rather than having the ability to change it during runtime--seems ridiculous. What solutions would you purpose? 回答1: I bet you

Change text direction for all pages

孤街浪徒 提交于 2019-12-06 02:16:36
问题 I am working on a web project that can be in multi langauges, i have done all of that, i still have one thing. the pages when shows in english is from left to right. some languages on my website needs to be from right to left Note please, my question is about the whole page not the text in fields. how can i do that please? I am using this code for launching threads for many languages. Thread.CurrentThread.CurrentCulture = new CultureInfo(CultureName); Thread.CurrentThread.CurrentUICulture =

Marionette.Renderer, Underscore templates and internationalization with i18next

大兔子大兔子 提交于 2019-12-06 02:07:52
问题 We are currently in the need of adding internationalization to a medium sized app using Backbone.Marionette and underscore templates. After some thorough research, two valid options are emerging : underi18n which provides direct integration with underscore, but lacks pluralization, which becomes essential for supporting more than french and english i18next which provides a powerful API but only direct integration with handlebars templates We will need on a longer term to localize in many more

Converting Greek to Uppercase in Java

不问归期 提交于 2019-12-06 01:59:38
问题 What I'm trying to do is fairly simple: String example = "Τάχιστη αλώπηξ βαφής ψημένη γη - Mary Had A Little Lamb"; String upper = example.toUpperCase(); In Greek, only the first letter of an uppercase word should contain accented characters. // upper contains the following (incorrect) string: // ΤΆΧΙΣΤΗ ΑΛΏΠΗΞ ΒΑΦΉΣ ΨΗΜΈΝΗ ΓΗ - MARY HAD A LITTLE LAMB // correct string: // ΤΑΧΙΣΤΗ ΑΛΩΠΗΞ ΒΑΦΗΣ ΨΗΜΕΝΗ ΓΗ - MARY HAD A LITTLE LAMB (The accents are hard to see, but they're there.) According to

Tool to find duplicate keys and value in properties file

眉间皱痕 提交于 2019-12-06 01:37:32
问题 is there a tool that tells me redundant keys and values that are there in my one or many properties file. 回答1: There is an Ant task, RscBundleCheck, that checks for the existence of duplicate keys in a set of resource files: http://rscbundlecheck.sourceforge.net/ This would be simple way to integrate checking for duplicate properties into your build process. 回答2: /** * Purpose: Properties doesn't detect duplicate keys. So this exists. * @author shaned */ package com.naehas.tests.configs;

i18n with jinja2 + GAE

久未见 提交于 2019-12-06 01:37:12
问题 I googled for a GAE + jinja i18n example but could not find it. Can anyone provide a link or working example? My effort uses the django translations and I don't know if this is the recommend way of doing it. import jinja2 from django.utils import translation from django.utils.translation import gettext, ngettext, ugettext, ungettext, get_language, activate class DjangoTranslator(object): def __init__(self): self.gettext = gettext self.ngettext = ngettext self.ugettext = ugettext self