Best way to internationalize simple PHP website

Although ext/gettext and ext/intl are both related to i18 (internationalization), gettext deals with translation while intl deals with internationalizing things like number and date display, sorting orders and transliteration. So you’d actually need both for a complete i18-solution. Depending on your needs you may come up with an home-brew solution relying on the extensions mentioned … Read more

How to use enable pseudo-locale in Windows for testing?

How do i enable pseudo-locale’s in Windows? Initially the four pseudo-locale’s are not visible in the Control Panel: (archive.org) Note that NLS does not automatically enumerate the pseudo-locales or expose them in the regional and language options portion of the Control Panel. They are only enumerable if values are set in the registry. You enable … Read more

How to specify your webpage’s language so Google Chrome doesn’t offer to translate it

Google Chrome currently requires several tags to make an (HTML5) document opt out of translation. Before doing this, you should be sure that you know your audience’s language, as otherwise it will prevent foreign sites from properly translating your site. The relevant tags are: <meta charset=”UTF-8″ /> <meta name=”google” content=”notranslate” /> <meta http-equiv=”Content-Language” content=”en_US” /> … Read more

Yii2 translation does not work

You Just Follow This Steps…… Step 1: In the common directory , create messages folder. Step 2: Create i18n.php file inside common/config directory with following content: <?php return [ ‘sourcePath’ => __DIR__. ‘..’ . DIRECTORY_SEPARATOR . ‘..’ . DIRECTORY_SEPARATOR . ‘..’ . DIRECTORY_SEPARATOR, ‘languages’ => [‘en-EN’, ‘ru-RU’], //Add languages to the array for the language … Read more

Localizing strings in iOS: default (fallback) language?

To avoid all those lengthy syntax and more having more descriptive var name for translators, I derived my own helper method L() for translation and falling back to English NSString * L(NSString * translation_key) { NSString * s = NSLocalizedString(translation_key, nil); if (![[[NSLocale preferredLanguages] objectAtIndex:0] isEqualToString:@”en”] && [s isEqualToString:translation_key]) { NSString * path = [[NSBundle … Read more

Can I use Angular i18n to translate string literals in typescript code

I can confirm what @JB Nizet is referring to in his answer is now working in Angular 9, so this works: foo() { const appTitle = $localize`:@@siteTitle:Example Title`; // appTitle is now translated based on locale titleService.setTitle(appTitle); } You can read more about it here https://github.com/angular/angular/blob/master/packages/localize/init/index.ts

Send emails with international accent and special characters

You need to use MIME. Add mail headers: MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 (If you are already using a MIME multipart/alternative to put HTML and text in the same mail, you put the Content-Type: text/plain;charset=utf-8 on the sub-headers of the text part instead.) This is assuming that the encoding you’ll be sending your “international” characters in … Read more